2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-02 11:37:07 +00:00

Add dir1/dir2/dir3/foo.bar (permision 755) to /install/postscripts on the management node before diskless and diskfull OS provisioning to a compute node to verify that the execute permission of foo.bar is preserved after provisioning. Failure of doing so will prevent some postscripts under multiple levels of sub-directories from running during the postscript phase.

This commit is contained in:
Wai Yee Wong 2020-04-15 16:28:31 -04:00
parent 10fe1b81f6
commit ddf982f2d8
2 changed files with 56 additions and 0 deletions

View File

@ -18,6 +18,15 @@ check:rc==0
cmd:chtab key=nameservers site.value="<xcatmaster>"
check:rc==0
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:makedns -n
check:rc==0
cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN;fi
@ -75,4 +84,23 @@ check:rc==0
cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi
cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist;else rm -rf /test.synclist;fi
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=
cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'"
check:rc==0
cmd:xdsh $$CN "grep \"The number is ONE\" /var/log/xcat/xcat.log"
check:rc==0
check:output=~ The number is ONE
cmd:xdsh $$CN "grep \"The number is NOT 1\" /var/log/xcat/xcat.log"
check:rc==0
check:output=~ The number is NOT 1
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

View File

@ -14,6 +14,15 @@ cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpser
cmd:chdef -t node $$SN groups=service,all
check:rc==0
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:makedns -n
check:rc==0
cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi
@ -82,4 +91,23 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconserverc
cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist;else rm -rf /test.synclist;fi
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=
check:rc==0
cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'"
check:rc==0
cmd:xdsh $$CN "grep \"The number is ONE\" /var/log/xcat/xcat.log"
check:rc==0
check:output=~ The number is ONE
cmd:xdsh $$CN "grep \"The number is NOT 1\" /var/log/xcat/xcat.log"
check:rc==0
check:output=~ The number is NOT 1
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