test case update for *def commands
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9611 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
5f274b1801
commit
447d6ecd2d
@ -1,10 +1,30 @@
|
||||
start:chdef_null
|
||||
description:chdef without any flag
|
||||
cmd:chdef
|
||||
check:rc!=0
|
||||
check:output=~Usage
|
||||
end
|
||||
|
||||
start:chdef_t_o_attr
|
||||
start:chdef_t_node
|
||||
description:chdef -t node
|
||||
cmd:mkdef -t node -o testnode groups=all
|
||||
check:rc==0
|
||||
cmd:chdef -t node -o testnode groups=aix
|
||||
check:rc==0
|
||||
cmd:lsdef -t node -l testnode
|
||||
check:rc==0
|
||||
check:output=~groups=aix
|
||||
cmd:chdef testnode groups=linux
|
||||
check:rc==0
|
||||
cmd:lsdef -t node -l testnode
|
||||
check:rc==0
|
||||
check:output=~groups=linux
|
||||
cmd:rmdef -t node testnode
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:chdef_t_network
|
||||
description:chdef -t network
|
||||
cmd:chdef -t network -o testnetwork net=111.222.33.0 mask=255.255.255.254
|
||||
check:rc==0
|
||||
cmd:lsdef -t network -l testnetwork
|
||||
@ -21,7 +41,8 @@ check:output=~gateway=111.222.34.1
|
||||
cmd:rmdef -t network testnetwork
|
||||
end
|
||||
|
||||
start:chdef_p_t_o_attr
|
||||
start:chdef_p
|
||||
description:chdef -p -t node
|
||||
cmd:mkdef -t node -o testnode groups=all
|
||||
check:rc==0
|
||||
cmd:chdef -p -t node -o testnode groups=aix
|
||||
@ -31,7 +52,8 @@ check:output=~groups=all,aix
|
||||
cmd:rmdef -t node testnode
|
||||
end
|
||||
|
||||
start:chdef_m_t_o_attr
|
||||
start:chdef_m
|
||||
description:chdef -m -t node
|
||||
cmd:mkdef -t node -o testnode groups=all,testgroup
|
||||
check:rc==0
|
||||
cmd:chdef -m -t node -o testnode groups=testgroup
|
||||
@ -42,38 +64,20 @@ cmd:rmdef -t node testnode
|
||||
end
|
||||
|
||||
start:chdef_z
|
||||
description:chdef -z
|
||||
cmd:mkdef -t node -o testnode groups=all
|
||||
check:rc==0
|
||||
cmd:lsdef -l $$CN -z > /tmp/testnode.stanza
|
||||
cmd:lsdef testnode -z > /tmp/testnode.stanza
|
||||
check:rc==0
|
||||
cmd:perl -pi -e 's/$$CN/testnode/g' /tmp/testnode.stanza
|
||||
cmd:perl -pi -e 's/all/aix/g' /tmp/testnode.stanza
|
||||
cmd:cat /tmp/testnode.stanza | chdef -z
|
||||
check:rc==0
|
||||
cmd:lsdef -l testnode -z > /tmp/testnode1.stanza
|
||||
cmd:lsdef testnode -l
|
||||
check:rc==0
|
||||
cmd:diff -w /tmp/testnode.stanza /tmp/testnode1.stanza
|
||||
check:rc==0
|
||||
cmd:rm -f /tmp/testnode1.stanza
|
||||
check:output=~groups=aix
|
||||
cmd:rm -f /tmp/testnode.stanza
|
||||
cmd:rmdef -t node testnode
|
||||
end
|
||||
|
||||
start:chdef_t_o_attr_noderange
|
||||
cmd:chdef -t node -o orignode mgt=fsp cons=hmc pprofile=orignode groups=lpar,all
|
||||
check:rc==0
|
||||
cmd:lsdef -l orignode -z > /tmp/orignode.stanza
|
||||
check:rc==0
|
||||
cmd:perl -pi -e 's/orignode/testnode/g' /tmp/orignode.stanza
|
||||
cmd:cat /tmp/orignode.stanza | chdef -z
|
||||
check:rc==0
|
||||
cmd:lsdef -l testnode -z > /tmp/testnode.stanza
|
||||
check:rc==0
|
||||
cmd:diff /tmp/orignode.stanza /tmp/testnode.stanza
|
||||
check:rc==0
|
||||
cmd:rm -f /tmp/orignode.stanza
|
||||
cmd:rm -f /tmp/testnode.stanza
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rmdef -t node orignode
|
||||
end
|
||||
|
||||
start:chdef_group
|
||||
@ -82,31 +86,31 @@ cmd:mkdef -t node -o testnode1-testnode2 mgt=hmc cons=hmc groups=all,systemp
|
||||
check:rc==0
|
||||
cmd:mkdef -t node -o testnode3-testnode4 mgt=ipmi cons=ipmi groups=all,systemx
|
||||
check:rc==0
|
||||
cmd:mkdef -t group -o testgrp members=testnode1,testnode3
|
||||
cmd:mkdef -t group -o testgrp1 members=testnode1,testnode3
|
||||
check:rc==0
|
||||
cmd:lsdef -s testgrp
|
||||
cmd:lsdef -s testgrp1
|
||||
check:rc==0
|
||||
check:output=~testnode1
|
||||
check:output=~testnode3
|
||||
check:output!~testnode2
|
||||
check:output!~testnode4
|
||||
cmd:chdef -t group -o testgrp -p members=testnode2,testnode4
|
||||
cmd:chdef -t group -o testgrp1 -p members=testnode2,testnode4
|
||||
check:rc==0
|
||||
cmd:lsdef -s testgrp
|
||||
cmd:lsdef -s testgrp1
|
||||
check:rc==0
|
||||
check:output=~testnode1
|
||||
check:output=~testnode3
|
||||
check:output=~testnode2
|
||||
check:output=~testnode4
|
||||
cmd:chdef -t group -o testgrp -m members=testnode1,testnode2
|
||||
cmd:chdef -t group -o testgrp1 -m members=testnode1,testnode2
|
||||
check:rc==0
|
||||
cmd:lsdef -s testgrp
|
||||
cmd:lsdef -s testgrp1
|
||||
check:rc==0
|
||||
check:output!~testnode1
|
||||
check:output=~testnode3
|
||||
check:output!~testnode2
|
||||
check:output=~testnode4
|
||||
cmd:rmdef -t group testgrp
|
||||
cmd:rmdef -t group testgrp1
|
||||
check:rc==0
|
||||
cmd:rmdef -t node -o testnode1-testnode4
|
||||
check:rc==0
|
||||
@ -178,8 +182,27 @@ cmd:rmdef -t node -o testfsp
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:chdef_t_o_error
|
||||
cmd:chdef -t testtype -o testnode groups=all,aix
|
||||
check:rc!=0
|
||||
check:output=~Error
|
||||
start:chdef_n
|
||||
description:chdef -n
|
||||
cmd:mkdef -t node -o testnode1 mgt=hmc cons=hmc groups=all,systemp
|
||||
check:rc==0
|
||||
cmd:chdef testnode1 -n testnode2
|
||||
check:rc==0
|
||||
cmd:lsdef testnode1
|
||||
check:output=~Could not find
|
||||
cmd:lsdef testnode2
|
||||
check:rc==0
|
||||
check:output=~Object name
|
||||
check:output=~mgt=hmc
|
||||
check:output=~cons=hmc
|
||||
check:output=~groups=all,systemp
|
||||
cmd:rmdef testnode2
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:chdef_t_o_error
|
||||
description:chdef -t wrongtype
|
||||
cmd:chdef -t wrongtype -o testnode groups=all,aix
|
||||
check:rc!=0
|
||||
check:output=~Usage
|
||||
end
|
||||
|
@ -1,10 +1,12 @@
|
||||
start:lsdef_null
|
||||
description: lsdef without any flag
|
||||
cmd:mkdef -t node -o testnode groups=all
|
||||
check:rc==0
|
||||
cmd:lsdef
|
||||
check:rc==0
|
||||
check:output=~testnode\s*\(node\)
|
||||
cmd:rmdef testnode
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:lsdef_a
|
||||
@ -13,6 +15,12 @@ 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
|
||||
check:rc==0
|
||||
#prune auditlog and eventlog tables
|
||||
#to avoid massive output with lsdef -a
|
||||
cmd:tabprune auditlog -a
|
||||
check:rc==0
|
||||
cmd:tabprune eventlog -a
|
||||
check:rc==0
|
||||
cmd:lsdef -a
|
||||
check:output=~testnode
|
||||
check:output=~testnetwork
|
||||
@ -20,7 +28,9 @@ cmd:lsdef --all
|
||||
check:output=~testnode
|
||||
check:output=~testnetwork
|
||||
cmd:rmdef -t network testnetwork
|
||||
check:rc==0
|
||||
cmd:rmdef -t node testnode
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:lsdef_t_o_l
|
||||
@ -39,7 +49,9 @@ check:output=~net=1.2.3.0
|
||||
check:output=~mask=255.255.255.0
|
||||
check:output!~testnode
|
||||
cmd:rmdef -t network testnetwork
|
||||
check:rc==0
|
||||
cmd:rmdef -t node testnode
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:lsdef_t_o_l_z
|
||||
@ -130,8 +142,47 @@ check:output=~testnode\s+\(node\)
|
||||
cmd:rmdef -t node testnode
|
||||
end
|
||||
|
||||
start:lsdef_t_auditlog
|
||||
description:lsdef -t auditlog
|
||||
cmd:tabprune auditlog -a
|
||||
check:rc==0
|
||||
cmd:lsdef -t auditlog
|
||||
check:rc==0
|
||||
check:output=~auditlog
|
||||
end
|
||||
|
||||
start:lsdef_t_eventlog
|
||||
description:lsdef -t eventlog
|
||||
cmd:tabprune eventlog -a
|
||||
check:rc==0
|
||||
cmd:lsdef -t eventlog
|
||||
check:rc==0
|
||||
check:output!~not a valid xCAT object type
|
||||
end
|
||||
|
||||
start:lsdef_t_policy
|
||||
description:lsdef -t policy
|
||||
cmd:lsdef -t policy
|
||||
check:rc==0
|
||||
check:output=~1\s+\(policy\)
|
||||
cmd:lsdef -t policy -o 1 -l
|
||||
check:rc==0
|
||||
check:output=~rule=allow
|
||||
end
|
||||
|
||||
start:lsdef_t_site
|
||||
description:lsdef -t site
|
||||
cmd:lsdef -t site
|
||||
check:rc==0
|
||||
check:output=~clustersite
|
||||
cmd:lsdef -t site -o clustersite -l
|
||||
check:rc==0
|
||||
check:output=~xcatdport
|
||||
end
|
||||
|
||||
start:lsdef_t_err
|
||||
cmd:lsdef -t test -o test
|
||||
description:lsdef -t wrongtype -o
|
||||
cmd:lsdef -t wrongtype -o test
|
||||
check:rc!=0
|
||||
check:output=~Error
|
||||
end
|
||||
|
@ -1,10 +1,12 @@
|
||||
start:mkdef_null
|
||||
description:mkdef without any flag
|
||||
cmd:mkdef
|
||||
check:rc!=0
|
||||
check:output=~Usage
|
||||
end
|
||||
|
||||
start:mkdef_t_o_attr
|
||||
start:mkdef_node
|
||||
description:mkdef -t node
|
||||
cmd:mkdef -t node -o testnode,testnode1 groups=all,aix
|
||||
check:rc==0
|
||||
cmd:lsdef -i groups testnode
|
||||
@ -16,7 +18,8 @@ check:output=~groups=all,aix
|
||||
cmd:rmdef -t node -o testnode,testnode1
|
||||
end
|
||||
|
||||
start:mkdef_f_t_o_attr
|
||||
start:mkdef_f
|
||||
description:mkdef -f
|
||||
cmd:mkdef -t node -o testnode groups=all,aix
|
||||
check:rc==0
|
||||
cmd:mkdef -f -t node -o testnode nodetype=lpar,osi groups=all
|
||||
@ -29,6 +32,7 @@ cmd:rmdef -t node -o testnode
|
||||
end
|
||||
|
||||
start:mkdef_z
|
||||
description:mkdef -z
|
||||
cmd:mkdef -t node -o orignode mgt=fsp cons=hmc pprofile=orignode groups=lpar,all
|
||||
check:rc==0
|
||||
cmd:lsdef -l orignode -z > /tmp/orignode.stanza
|
||||
@ -133,10 +137,26 @@ cmd:rmdef -t node -o testfsp
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:mkdef_t_network
|
||||
description: mkdef -t network
|
||||
cmd:mkdef -t network -o testnetwork net=1.2.3.0 mask=255.255.255.0 gateway=1.2.3.1
|
||||
check:rc==0
|
||||
cmd:lsdef -t network
|
||||
check:rc==0
|
||||
check:output=~testnetwork
|
||||
cmd:lsdef -t network -o testnetwork -l
|
||||
check:rc==0
|
||||
check:output=~net=1.2.3.0
|
||||
check:output=~mask=255.255.255.0
|
||||
check:output=~gateway=1.2.3.1
|
||||
cmd:rmdef -t network testnetwork
|
||||
end
|
||||
|
||||
start:mkdef_t_o_error
|
||||
cmd:mkdef -t testtype -o testnode groups=all,aix
|
||||
description:mkdef -t wrongtype
|
||||
cmd:mkdef -t wrongtype -o testnode groups=all,aix
|
||||
check:rc!=0
|
||||
check:output=~Error
|
||||
check:output=~Usage
|
||||
end
|
||||
|
||||
|
||||
|
@ -1,10 +1,12 @@
|
||||
start:rmdef_null
|
||||
description:rmdef without any flag
|
||||
cmd:rmdef
|
||||
check:rc!=0
|
||||
check:output=~Usage
|
||||
end
|
||||
|
||||
start:rmdef_t_o_node
|
||||
description:rmdef -t node -o
|
||||
cmd:mkdef -t node -o testnode,testnode1 groups=all,aix
|
||||
check:rc==0
|
||||
cmd:lsdef -t node testnode,testnode1
|
||||
@ -18,6 +20,7 @@ check:output=~Could not find an object named 'testnode1' of type 'node'.
|
||||
end
|
||||
|
||||
start:rmdef_t_node
|
||||
description:rmdef -t node
|
||||
cmd:mkdef -t node -o testnode,testnode1 groups=all,aix
|
||||
check:rc==0
|
||||
cmd:lsdef -t node testnode,testnode1
|
||||
@ -31,6 +34,7 @@ check:output=~Could not find an object named 'testnode1' of type 'node'.
|
||||
end
|
||||
|
||||
start:rmdef_node
|
||||
description:rmdef nodename
|
||||
cmd:mkdef -t node -o testnode,testnode1 groups=all,aix
|
||||
check:rc==0
|
||||
cmd:lsdef -t node testnode,testnode1
|
||||
@ -44,6 +48,7 @@ check:output=~Could not find an object named 'testnode1' of type 'node'.
|
||||
end
|
||||
|
||||
start:rmdef_t_o_network
|
||||
description:rmdef -t network
|
||||
cmd:mkdef -t network -o testnet net=1.2.3.0 mask=255.0.0.0 gateway=1.2.3.1
|
||||
check:rc==0
|
||||
cmd:lsdef -t network
|
||||
@ -96,30 +101,31 @@ cmd:lsdef -t group -o dyngrp
|
||||
check:output=~Could not find an object named 'dyngrp' of type 'group'.
|
||||
end
|
||||
|
||||
start:rmdef_f_all
|
||||
cmd:mkdir -p /tmp/db
|
||||
cmd:dumpxCATdb -p /tmp/db
|
||||
check:rc==0
|
||||
cmd:rmdef -f -a
|
||||
check:rc==0
|
||||
cmd:XCATBYPASS=yes lsdef -a
|
||||
check:rc==0
|
||||
check:output!~group
|
||||
check:output!~node
|
||||
check:output!~network
|
||||
check:output!~osimage
|
||||
check:output!~policy
|
||||
check:output!~notification
|
||||
check:output!~eventlog
|
||||
check:output!~boottarget
|
||||
check:output!~firmware
|
||||
check:output!~monitoring
|
||||
cmd:XCATBYPASS=yes restorexCATdb -a -p /tmp/db
|
||||
check:rc==0
|
||||
end
|
||||
#start:rmdef_f_all
|
||||
#cmd:mkdir -p /tmp/db
|
||||
#cmd:dumpxCATdb -p /tmp/db
|
||||
#check:rc==0
|
||||
#cmd:rmdef -f -a
|
||||
#check:rc==0
|
||||
#cmd:XCATBYPASS=yes lsdef -a
|
||||
#check:rc==0
|
||||
#check:output!~group
|
||||
#check:output!~node
|
||||
#check:output!~network
|
||||
#check:output!~osimage
|
||||
#check:output!~policy
|
||||
#check:output!~notification
|
||||
#check:output!~eventlog
|
||||
#check:output!~boottarget
|
||||
#check:output!~firmware
|
||||
#check:output!~monitoring
|
||||
#cmd:XCATBYPASS=yes restorexCATdb -a -p /tmp/db
|
||||
#check:rc==0
|
||||
#end
|
||||
|
||||
start:rmdef_t_err
|
||||
cmd:rmdef -t testtype -o testnode
|
||||
description:rmdef -t wrongtype
|
||||
cmd:rmdef -t wrongtype -o testnode
|
||||
check:rc!=0
|
||||
check:output=~Error
|
||||
check:output=~Usage
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user