2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-02 19:40:10 +00:00

updatenode_postscripts_permission is used to test that postscripts in nested sub-directories can execute on CN by running "updatenode -P" on MN (xcat-core issue #6579). A diskless or a diskfull image has been installed on CN at the point of testing.

This commit is contained in:
Wai Yee Wong 2020-04-16 11:53:19 -04:00
parent ddf982f2d8
commit 9920a4c7d9

View File

@ -665,7 +665,33 @@ cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstd
check:rc==0
end
start:updatenode_postscripts_permission
label:others,updatenode
description:This is to test that postscripts in nested sub-directories can execute on CN by running "updatenode -P" on MN (xcat-core issue #6579).
cmd:mkdir -p /install/postscripts/dir1/dir2/dir3
check:rc==0
cmd:echo -e '#!/bin/bash\n\nif [[ $1 == 1 ]] \nthen\n echo \"The number is ONE\";\nelse\n echo \"The number is NOT 1\"; \nfi\nexit 0;'> /install/postscripts/dir1/dir2/dir3/foo.bar
check:rc==0
cmd:chmod 755 /install/postscripts/dir1/dir2/dir3/foo.bar
check:rc==0
cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar 1,dir1/dir2/dir3/foo.bar 0"
check:rc==0
cmd:updatenode $$CN -P "dir1/dir2/dir3/foo.bar 1"
check:rc==0
check:output=~ The number is ONE
cmd:updatenode $$CN -P "dir1/dir2/dir3/foo.bar 0"
check:rc==0
check:output=~ The number is NOT 1
cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'"
check:rc==0
cmd:rm -f /install/postscripts/dir1/dir2/dir3/foo.bar
check:rc==0
cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3
check:rc==0
cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/foo.bar"
check:rc==0
cmd:xdsh $$CN "cd /xcatpost; rmdir -p dir1/dir2/dir3"
check:rc==0
cmd:chdef -m -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar 1,dir1/dir2/dir3/foo.bar 0"
check:rc==0
end