2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-01 10:25:33 +00:00

Merge pull request #5928 from tingtli/task424

Add a new case updatenode_syncfile_EXECUTEALWAYS_noderange to cover test for bug 5755
This commit is contained in:
cxhong
2019-01-30 11:14:06 -05:00
committed by GitHub

View File

@ -525,3 +525,129 @@ cmd:chtab key=xcatdebugmode site.value=0
check:rc==0
end
start:updatenode_syncfile_EXECUTE_EXECUTEALWAYS_noderange
label:others,updatenode
description:this teast case is to verify pr #5834. This test case should be executed on mn with hierarchy environment, with 2 comput nodes.In this case, $$CN and $$C2 are the 2 compute nodes.
cmd:xdsh $$CN,$$C2 rm /tmp/file.post1 /tmp/file.post2
cmd:xdsh $$CN,$$C2 rm /tmp/test1 /tmp/test2
cmd:echo "echo hello1 >> /tmp/test1" > /tmp/file.post1
check:rc==0
cmd:echo "echo hello2 >> /tmp/test2" > /tmp/file.post2
check:rc==0
cmd:chmod a+x /tmp/file.post1 /tmp/file.post2
cmd:mkdir -p /install/custom/install/__GETNODEATTR($$CN,os)__
cmd:echo "/tmp/file.post1 -> ($$CN) /tmp/file.post1" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "/tmp/file.post2 -> ($$C2) /tmp/file.post2" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "EXECUTE:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "/tmp/file.post1" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "EXECUTEALWAYS:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "/tmp/file.post2" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
check:rc==0
cmd:updatenode $$CN -F
check:output=~File synchronization has completed
check:rc==0
cmd:xdsh $$CN "cat /tmp/test1"
check:rc==0
check:output=~hello1
cmd:xdsh $$CN "rm -rf /tmp/test1"
check:rc==0
cmd:updatenode $$CN -F
check:output=~File synchronization has completed
check:rc==0
cmd:xdsh $$CN "cat /tmp/test1"
check:rc!=0
cmd:updatenode $$C2 -F
check:output=~File synchronization has completed
check:rc==0
cmd:xdsh $$C2 ls /tmp/file.post2
check:rc==0
cmd:xdsh $$C2 "cat /tmp/test2"
check:rc==0
check:output=~hello2
cmd:xdsh $$C2 "rm -rf /tmp/test2"
check:rc==0
cmd:updatenode $$C2 -F
check:output=~File synchronization has completed
check:rc==0
cmd:xdsh $$C2 ls /tmp/file.post2
check:rc==0
cmd:xdsh $$C2 "cat /tmp/test2"
check:rc==0
check:output=~hello2
cmd:xdsh $$C2 rm -rf /tmp/file.post2 /tmp/test2
cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "/tmp/file.post1 -> ($$CN) /tmp/file.post1" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "/tmp/file.post1 -> ($$C2) /tmp/file.post1" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "EXECUTE:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "/tmp/file.post1" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "EXECUTEALWAYS:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "/tmp/file.post2" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
check:rc==0
cmd:updatenode $$C2 -F
check:output=~File synchronization has completed
check:rc==0
cmd:xdsh $$C2 ls /tmp/file.post2
check:rc!=0
cmd:xdsh $$C2 "cat /tmp/test2"
check:rc!=0
check:output!=~hello2
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=
check:rc==0
cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
check:rc==0
end
start:updatenode_syncfile_EXECUTEALWAYS_src_dst_diff
label:others,updatenode
description:this teast case is to verify pr #5888.
cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -z >> /tmp/myimage.stanza
cmd:xdsh $$CN rm /tmp/h /tmp/script.sh /root/script2.sh /tmp/script2.sh /tmp/script3.sh
cmd:xdsh $$CN rm /tmp/test /tmp/test2 /root/test3 /root/test1
cmd:echo "echo hello >> /tmp/test" > /tmp/script.sh
check:rc==0
cmd:echo "echo hello2 >> /tmp/test2" > /tmp/script2.sh
check:rc==0
cmd:echo "echo hello3 >> /tmp/test3" > /root/script3.sh
check:rc==0
cmd:echo "echo hello1 >> /tmp/test1" > /root/script1.sh
check:rc==0
cmd:chmod a+x /tmp/script.sh /tmp/script2.sh /root/script3.sh /root/script1.sh
cmd:mkdir -p /install/custom/install/__GETNODEATTR($$CN,os)__
cmd:echo "/etc/hosts -> ($$CN) /tmp/h" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
cmd:echo "/tmp/script.sh -> ($$CN) /tmp/script.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
cmd:echo "/root/script1.sh -> ($$CN) /root/script2.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
cmd:echo "/tmp/script2.sh -> ($$CN) /tmp/script2.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
cmd:echo "/root/script3.sh -> ($$CN) /tmp/script3.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
cmd:echo "EXECUTEALWAYS:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
cmd:echo "/tmp/script.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
cmd:echo "/tmp/script2.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
cmd:echo "/root/script3.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
cmd:echo "/root/script1.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
check:rc==0
cmd:updatenode $$CN -F
check:output=~File synchronization has completed for nodes:\s*"$$CN"\s*
check:rc==0
cmd:xdsh $$CN ls /tmp/h
check:rc==0
cmd:xdsh $$CN ls /tmp/test
check:rc==0
cmd:xdsh $$CN ls /tmp/test2
check:rc==0
cmd:xdsh $$CN ls /tmp/test3
check:rc==0
cmd:xdsh $$CN ls /tmp/test1
check:rc==0
cmd:if [ -e /tmp/myimage.stanza ]; then rmdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute; cat /tmp/myimage.stanza | mkdef -z; rm -rf /tmp/myimage.stanza; fi
check:rc==0
cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist
check:rc==0
end