2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Revise the test case confignetwork_static_installnic

This commit is contained in:
GONG Jie 2017-08-24 15:34:09 +08:00
parent 3d3a880f78
commit 06c3ad5b37

View File

@ -945,8 +945,8 @@ cmd:xdsh $$CN "mkdir -p /tmp/backupnet"
check:rc==0
cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi
check:rc==0
cmd:xdsh $$CN "kill $(ps -A | awk '/dhclient/ { print $1 }')"
cmd:xdsh $$CN "kill -KILL $(ps -A | awk '/dhclient/ { print $1 }')"
cmd:xdsh $$CN "ps -A --format pid,comm | awk '/dhclient/ { print \$1 }' | xargs -r -n 1 kill"
cmd:xdsh $$CN "ps -A --format pid,comm | awk '/dhclient/ { print \$1 }' | xargs -r -n 1 kill -KILL"
cmd:xdsh $$CN 'rm -f /var/lib/dhcp/dhclient*.lease* /var/lib/dhclient/dhclient*.lease*'
check:rc==0
cmd:updatenode $$CN 'confignetwork -s'
@ -957,5 +957,5 @@ check:rc==0
cmd:test -e /tmp/CN.stanza && rmdef $$CN && mkdef -z </tmp/CN.stanza; rm -rf /tmp/CN.stanza
cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi
cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces"
cmd:xdsh $$CN "if [ -f /etc/init.d/network ] then ; /etc/init.d/network restart ; elif [ -f /etc/init.d/networking ] then ; /etc/init.d/networking restart ; fi"
cmd:xdsh $$CN "if [ -f /etc/init.d/network ] ; then /etc/init.d/network restart ; elif [ -f /etc/init.d/networking ] ; then /etc/init.d/networking restart ; fi"
end