From 878d2726ea5c22e9d8e98981b57c1a005ec362f7 Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 4 Jan 2019 02:30:20 -0500 Subject: [PATCH 1/3] add a new case updatenode_syncfile_EXECUTEALWAYS_noderange_hierarchy to cover test for bug 5755 --- xCAT-test/autotest/testcase/updatenode/cases0 | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index f917cae2f..f864c7ec2 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -525,3 +525,33 @@ cmd:chtab key=xcatdebugmode site.value=0 check:rc==0 end +start:updatenode_syncfile_EXECUTEALWAYS_noderange_hierarchy +label:others,updatenode +description:this teast case is to verify bug #5755,synclist: EXECUTEALWAYS ignore noderange. This test case should be executed on mn with hierarchy environment, with at least 2 installed diskful cn.In this case, $$CN and $$C2 are the 2 compute nodes. +cmd:xdsh $$CN,$$C2 rm /tmp/file.post +cmd:xdsh $$CN,$$C2 rm /tmp/test +cmd:echo "echo hello >> /tmp/test" > /tmp/file.post +check:rc==0 +cmd:chmod a+x /tmp/file.post +cmd:echo "/tmp/file.post -> ($$CN) /tmp/file.post" > /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.post" >> /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:rc==0 +cmd:xdsh $$CN "cat /tmp/test" +check:rc==0 +check:output=~hello +cmd:updatenode $$C2 -F +check:rc==0 +cmd:xdsh $$C2 ls /tmp/file.post +check:rc!=0 +cmd:xdsh $$C2 "cat /tmp/test" +check:rc!=0 +check:output!=~hello +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 From 9864626131111b6af1d7acc3ff4c0edb75bfd0d0 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 10 Jan 2019 01:18:05 -0500 Subject: [PATCH 2/3] update cases for EXECUTEALWAYS will only execute syncfile in the syncfile list --- xCAT-test/autotest/testcase/updatenode/cases0 | 69 +++++++++++++++---- 1 file changed, 56 insertions(+), 13 deletions(-) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index f864c7ec2..3e30ba4f8 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -525,31 +525,74 @@ cmd:chtab key=xcatdebugmode site.value=0 check:rc==0 end -start:updatenode_syncfile_EXECUTEALWAYS_noderange_hierarchy +start:updatenode_syncfile_EXECUTE_EXECUTEALWAYS_noderange label:others,updatenode -description:this teast case is to verify bug #5755,synclist: EXECUTEALWAYS ignore noderange. This test case should be executed on mn with hierarchy environment, with at least 2 installed diskful cn.In this case, $$CN and $$C2 are the 2 compute nodes. -cmd:xdsh $$CN,$$C2 rm /tmp/file.post -cmd:xdsh $$CN,$$C2 rm /tmp/test -cmd:echo "echo hello >> /tmp/test" > /tmp/file.post +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:chmod a+x /tmp/file.post -cmd:echo "/tmp/file.post -> ($$CN) /tmp/file.post" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +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.post" >> /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/test" +cmd:xdsh $$CN "cat /tmp/test1" check:rc==0 -check:output=~hello +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.post +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/test" +cmd:xdsh $$C2 "cat /tmp/test2" check:rc!=0 -check:output!=~hello +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 From 8ef8e593bf79a8ec304c5df85182d0b40cdd81d9 Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 25 Jan 2019 02:29:41 -0500 Subject: [PATCH 3/3] add test case for issue 5888: EXECUTEALWAYS error when another line in the synclist references the same destination node --- xCAT-test/autotest/testcase/updatenode/cases0 | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index 3e30ba4f8..1a109bc53 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -598,3 +598,56 @@ 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 + + + + +