Add test cases for lsdef command

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7644 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2010-09-26 01:43:20 +00:00
parent 42779221d7
commit 30f0909982
2 changed files with 32 additions and 0 deletions

View File

@ -1,4 +1,5 @@
start:lsdef_null
description: lsdef without any flag
cmd:mkdef -t node -o testnode groups=all
cmd:lsdef
check:rc==0
@ -7,6 +8,7 @@ cmd:rmdef testnode
end
start:lsdef_a
description: lsdef -a and lsdef --all
cmd:mkdef -t node -o testnode groups=all
check:rc==0
cmd:mkdef -t network -o testnetwork net=1.2.3.0 mask=255.255.255.0
@ -22,6 +24,7 @@ cmd:rmdef -t node testnode
end
start:lsdef_t_o_l
description: lsdef -o -l
cmd:mkdef -t node -o testnode groups=all
check:rc==0
cmd:mkdef -t network -o testnetwork net=1.2.3.0 mask=255.255.255.0
@ -40,6 +43,7 @@ cmd:rmdef -t node testnode
end
start:lsdef_t_o_l_z
description: lsdef -l -z
cmd:mkdef -t node -o testnode groups=all
check:rc==0
cmd:mkdef -t network -o testnetwork net=1.2.3.0 mask=255.255.255.0
@ -59,6 +63,7 @@ cmd:rmdef -t node testnode
end
start:lsdef_t
description: lsdef -t
cmd:mkdef -t node -o testnode groups=all
check:rc==0
cmd:mkdef -t network -o testnetwork net=1.2.3.0 mask=255.255.255.0
@ -72,6 +77,14 @@ cmd:rmdef -t node testnode
end
start:lsdef_t_i_o
description: lsdef -i
cmd:mkdef -t node -o testnode groups=all
check:rc==0
cmd:lsdef -t node -o testnode -i groups
check:rc==0
check:output=~groups=all
check:output=~testnode
cmd:rmdef -t node testnode
cmd:mkdef -t network -o testnetwork net=1.2.3.0 mask=255.255.255.0
check:rc==0
cmd:lsdef -t network -i net
@ -98,9 +111,25 @@ check:output=~testnode3
check:output=~testnode4
check:output!=testnode1
check:output!=testnode2
cmd:lsdef -t node -w cons==ipmi -w groups==linux
check:rc==0
check:output=~testnode3
check:output=~testnode4
check:output!=testnode1
check:output!=testnode2
cmd:rmdef -t node testnode1-testnode4
end
start:lsdef_s
description: lsdef -s
cmd:mkdef -t node -o testnode groups=all
check:rc==0
cmd:lsdef -s testnode
check:rc==0
check:output=~testnode\s+\(node\)
cmd:rmdef -t node testnode
end
start:lsdef_t_err
cmd:lsdef -t test -o test
check:rc!=0

View File

@ -434,6 +434,9 @@ sub loadcase
while($line=<FILE>){
$line = &trim($line);
next if(length($line) == 0);
#description line is only a comment
next if($line =~ /^description\s*:/);
if($line =~ /^start\s*:\s*(\w+)/){
$skip = 0;
my $name = $1;