2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-25 12:40:21 +00:00

update makenetwork and mkdef cases

This commit is contained in:
litingt
2018-12-14 02:55:03 -05:00
parent daa6c91991
commit 66a2641df1
2 changed files with 36 additions and 2 deletions

View File

@@ -70,5 +70,11 @@ cmd:rm -f /tmp/testnetworks
cmd:rm -f /tmp/inetworktest1
end
start:makenetworks_netname_exist
os:Linux
description:test makenetworks works as design when netname exists.
label:others,network
cmd:netname=`lsdef -t network |cut -d" " -f1 |sed -n '1p'`;makenetworks $netname
check:rc==0
check:output=~(already exists)
end

View File

@@ -159,6 +159,34 @@ check:output=~gateway=1.2.3.1
cmd:rmdef -t network testnetwork
end
start:mkdef_netname_exist
os:Linux
description:test mkdef works as design when netname exists.
label:mn_only,ci_test,db
cmd:netname=`lsdef -t network |cut -d" " -f1 |sed -n '1p'`;mkdef -t network -o $netname
check:rc==0
check:output=~(already exists)
end
start:mkdef_netname_notexist_without_net_mask
os:Linux
description:test mkdef works as design when net and mask is not defined.
label:mn_only,ci_test,db
cmd:mkdef -t network -o testnetworkwithoutnetandmask
check:rc!=0
check:output=~Error
end
start:mkdef_networks_if_net_mask_exists
os:Linux
description:test makenetworks works as design when net and mask exists. The network could not be created since net and mask are
the same.
label:mn_only,ci_test,db
cmd:netname=`lsdef -t network |cut -d" " -f1 |sed -n '1p'`;net=`lsdef -t network -o $netname |grep -i net |awk -F = '{print $2}'`;mask=`lsdef -t network -o $netname |grep -i mask |awk -F = '{print $2}'`;mkdef -t network -o testnetworkwithnetandmask net=$net mask=$mask
check:rc!=0
check:output=~(already exists)
end
start:mkdef_t_o_error
description:mkdef -t wrongtype
label:mn_only,ci_test,db