diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index a59bd6bb9..c76620631 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -34,7 +34,7 @@ check:rc==0 check:output=~booted cmd:xdsh $$CN hostname check:output=~$$CN -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output=~BOOTPROTO=none|static @@ -84,7 +84,7 @@ check:rc==0 check:output=~booted cmd:xdsh $$CN hostname check:output=~$$CN -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output=~BOOTPROTO=none|static @@ -137,11 +137,11 @@ check:output=~64 bytes from $$CN cmd:lsdef -l $$CN | grep status check:rc==0 check:output=~booted -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output=~BOOTPROTO=none|static -cmd:secondarynic=`xdsh $$CN ip addr |grep 100.1.0.100|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$secondarynic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$secondarynic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +cmd:secondarynic=`xdsh $$CN ip addr |grep 100.1.0.100|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$secondarynic"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$secondarynic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~100.1.0.100 check:output=~BOOTPROTO=none|static @@ -162,7 +162,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 @@ -173,16 +173,16 @@ check:rc==0 cmd:rmdef -t network -o confignetworks_test1 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$installnic*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$installnic*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output=~BOOTPROTO=none|static cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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 "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" end @@ -195,7 +195,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1496 check:rc==0 @@ -206,14 +206,14 @@ check:rc==0 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep -i MTU /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep mtu /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep -i MTU /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep mtu /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~MTU=1496|mtu 1496 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/" end @@ -226,7 +226,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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:cp -f /etc/hosts /etc/hosts.bak cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC @@ -243,10 +243,10 @@ check:output=~aliases1-2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:xdsh $$CN date -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 check:output=~BOOTPROTO=none|static -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 check:output=~BOOTPROTO=none|static cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 @@ -254,7 +254,7 @@ cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";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:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";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 check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi @@ -273,7 +273,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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:cp -f /etc/hosts /etc/hosts.bak cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC @@ -289,26 +289,26 @@ check:output=~$$CN-$$SECONDNIC-1 check:output=~$$CN-$$SECONDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~BOOTPROTO=none|static check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes check:output=~BOOTPROTO=none|static cmd:rmdef -t network -o confignetworks_test1 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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 check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/" @@ -379,7 +379,7 @@ cmd:chtab node=$$CN nics.disable=yes check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output!~11.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 check:rc==0 @@ -401,7 +401,7 @@ cmd:chtab node=$$CN nics.disable=1 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output!~11.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 check:rc==0 @@ -447,7 +447,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 @@ -473,21 +473,21 @@ check:output=~$$CN-$$THIRDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:xdsh $$CN date -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network-scripts/ifcfg-*$$THIRDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network-scripts/ifcfg-*$$THIRDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:output=~13.1.0.200 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$THIRDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$THIRDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:output=~14.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 cmd:rmdef -t network -o 14_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" @@ -496,7 +496,7 @@ cmd:xdsh $$CN "ip addr del 14.1.0.100/16 dev $$THIRDNIC" cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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 check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/" @@ -511,7 +511,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/; elif grep Ubuntu /etc/*release;then cp -f /etc/network/interfaces.d/* /tmp/backupnet/;else echo \"Sorry,this is not supported os\"; fi" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS|Rocky\" /etc/*release;then cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/; elif grep Ubuntu /etc/*release;then cp -f /etc/network/interfaces.d/* /tmp/backupnet/;else echo \"Sorry,this is not supported os\"; fi" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -524,7 +524,7 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=105.;var4=`echo $cnip |awk -F. check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=106.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test7 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "if grep SUSE /etc/*release;then grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep $second1ip /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "if grep SUSE /etc/*release;then grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS|Rocky\" /etc/*release;then grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep $second1ip /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second6ip=$var1$var3;second7ip=$var2$var3;chdef $$CN nicnetworks.$$SECONDNIC.6=confignetworks_test6 nicnetworks.$$SECONDNIC.7=confignetworks_test7 nictypes.$$SECONDNIC.6=vlan nictypes.$$SECONDNIC.7=vlan nicips.$$SECONDNIC.6=$second6ip nicips.$$SECONDNIC.7=$second7ip nicdevices.$$SECONDNIC.6=$$SECONDNIC nicdevices.$$SECONDNIC.7=$$SECONDNIC nictypes.$$SECONDNIC=ethernet check:rc==0 @@ -532,11 +532,11 @@ cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second6ip=$var1$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second6ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.6;elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second6ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6*; elif grep Ubuntu /etc/*release;then grep $second6ip /etc/network/interfaces.d/$$SECONDNIC.6;else echo \"Sorry,this is not supported os\"; fi" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second6ip=$var1$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second6ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.6;elif grep -E \"Red Hat|CentOS|Rocky\" /etc/*release;then grep $second6ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6*; elif grep Ubuntu /etc/*release;then grep $second6ip /etc/network/interfaces.d/$$SECONDNIC.6;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second7ip=$var2$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second7ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second7ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7*; elif grep Ubuntu /etc/*release;then grep $second7ip /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second7ip=$var2$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second7ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS|Rocky\" /etc/*release;then grep $second7ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7*; elif grep Ubuntu /etc/*release;then grep $second7ip /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 -cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC*; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS|Rocky\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC*; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second6ip=$var1$var3;xdsh $$CN "ip addr del $second6ip/8 dev $$SECONDNIC.6" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second7ip=$var2$var3;xdsh $$CN "ip addr del $second7ip/8 dev $$SECONDNIC.7" @@ -546,9 +546,9 @@ cmd:rmdef -t network -o confignetworks_test7 cmd:xdsh $$CN "ip link del dev $$SECONDNIC.6" cmd:xdsh $$CN "ip link del dev $$SECONDNIC.7" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" -cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC.6 /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC.6 /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC.6 /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS|Rocky\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC.6 /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 -cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network/; elif grep -E \"Red Hat .* 8.*|CentOS .* 8.*\" /etc/*release; then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; nmcli con reload;elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; elif grep Ubuntu /etc/*release;then 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 "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network/; elif grep -E \"Red Hat .* 8.*|CentOS .* 8.*\" /etc/*release; then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; nmcli con reload;elif grep -E \"Red Hat|CentOS|Rocky\" /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; elif grep Ubuntu /etc/*release;then cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 @@ -563,14 +563,14 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/; elif grep Ubuntu /etc/*release;then cp -f /etc/network/interfaces.d/* /tmp/backupnet/;else echo \"Sorry,this is not supported os\"; fi" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS|Rocky\" /etc/*release;then cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/; elif grep Ubuntu /etc/*release;then cp -f /etc/network/interfaces.d/* /tmp/backupnet/;else echo \"Sorry,this is not supported os\"; fi" cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:xdsh $$CN "if grep SUSE /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS|Rocky\" /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:output=~11.1.0.100 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= check:rc==0 @@ -589,11 +589,11 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 60_0_0_0-255_0_0_0 cmd:rmdef -t network -o 70_0_0_0-255_0_0_0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" -cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS|Rocky\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network/; elif grep -E \"Red Hat .* 8.*|CentOS .* 8.*\" /etc/*release; then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; nmcli con reload;elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; elif grep Ubuntu /etc/*release;then 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 "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network/; elif grep -E \"Red Hat .* 8.*|CentOS .* 8.*|Rocky .* 8.*\" /etc/*release; then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; nmcli con reload;elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; elif grep Ubuntu /etc/*release;then cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 @@ -608,8 +608,8 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -632,23 +632,23 @@ cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network-scripts/ifcfg-*bond0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond0ip /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network-scripts/ifcfg-*bond0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond0ip /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test1 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;xdsh $$CN "ip addr del $bond0ip/16 dev bond0" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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 check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" @@ -664,8 +664,8 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /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/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /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/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -690,15 +690,15 @@ check:rc!=0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" cmd:rmdef -t network -o confignetworks_test1 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /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 check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 @@ -713,8 +713,8 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 +cmd:if grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -735,9 +735,9 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-*bond0.2*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-*bond0.2*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-*bond0.3*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-*bond0.3*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 @@ -746,10 +746,10 @@ check:output=~bond0.3 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 cmd:rmdef -t network -o confignetworks_test1 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:rmdef -t network -o confignetworks_test4 @@ -761,11 +761,11 @@ cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip link del dev bond0.2" cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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 check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" @@ -781,8 +781,8 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -807,13 +807,13 @@ cmd:xdsh $$CN "ls /sys/class/net" check:output=~br0 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network-scripts/ifcfg-*br0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br0ip /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network-scripts/ifcfg-*br0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br0ip /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test1 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;xdsh $$CN "ip addr del $br0ip/16 dev br0" @@ -821,11 +821,11 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r ' cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" cmd:xdsh $$CN "ip link del dev br0" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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 "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" cmd:chtab -d node=$$CN nics @@ -839,8 +839,8 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 +cmd:if grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -860,9 +860,9 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip check:rc==0 cmd:updatenode $$CN -P confignetwork -t 1800 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br22 @@ -873,7 +873,7 @@ cmd:xdsh $$CN "ip addr show bond0.3" cmd:xdsh $$CN "ip addr show br33" cmd:rmdef -t network -o confignetworks_test1 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var2;xdsh $$CN "ip addr del $br22ip/16 dev br22" @@ -887,11 +887,11 @@ cmd:xdsh $$CN "ip link del dev bond0" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$SECONDNIC" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$THIRDNIC" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; 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 check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" @@ -906,8 +906,8 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 +cmd:if grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 @@ -924,25 +924,25 @@ cmd:chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bri check:rc==0 cmd:updatenode $$CN -P "confignetwork -s" check:rc==0 -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$installnic*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$installnic*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output=~BOOTPROTO=none|static cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:output=~30.5.106.8 check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:output=~40.5.106.8 check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br22 check:output=~br33 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi cmd:rmdef -t network -o 30_5_0_0-255_255_0_0 cmd:xdsh $$CN "ip addr del 30.5.106.8/16 dev br22" cmd:xdsh $$CN "ip link del dev br22" @@ -954,7 +954,7 @@ cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$THIRDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/";elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";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:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/";elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";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 check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi @@ -973,8 +973,8 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" 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 -E "Red Hat|CentOS" /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/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /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/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 check:rc==0 cmd:mkdef -t network -o 40_5_0_0-255_255_0_0 net=40.5.0.0 mask=255.255.0.0 @@ -994,7 +994,7 @@ cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /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:chtab -d node=$$CN nics end @@ -1006,7 +1006,7 @@ cmd:lsdef $$CN -z && lsdef -l $$CN -z >/tmp/CN.stanza check:rc==0 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 -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /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 "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" @@ -1018,7 +1018,7 @@ cmd:xdsh $$CN date check:rc==0 # Clean up cmd:test -e /tmp/CN.stanza && rmdef $$CN && mkdef -z /dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 7af0f0b10..7c1ea5a9a 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -18,8 +18,8 @@ check:output=~booted cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 -#Install additional packages on Red Hat -cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Red Hat and Rocky +cmd:if xdsh $$CN "grep \"Red Hat\|Rocky\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi @@ -62,8 +62,8 @@ check:output=~booted cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 -#Install additional packages on Red Hat -cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Red Hat and Rocky +cmd:if xdsh $$CN "grep \"Red Hat\|Rocky\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi @@ -106,8 +106,8 @@ check:output=~booted cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 -#Install additional packages on Red Hat -cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Red Hat and Rocky +cmd:if xdsh $$CN "grep \"Red Hat\|Rocky\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi @@ -160,8 +160,8 @@ check:output=~booted cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 -#Install additional packages on Red Hat -cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Red Hat and Rocky +cmd:if xdsh $$CN "grep \"Red Hat\|Rocky\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 5af708407..aba9739e0 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -24,7 +24,7 @@ check:rc==0 cmd:makedhcp -a check:rc==0 cmd:sleep 2 -cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$SN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$SN;fi +cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$SN;elif cat /etc/*release |grep "Red Hat\|Rocky" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$SN;fi check:output=~$$SN cmd:chdef -t node $$SN groups=service,all check:rc==0 diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 3b55e4a68..4393f7c32 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -23,7 +23,7 @@ cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc check:rc==0 cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;cp $pkglistfile $pkglistfile.bak -cmd:pkglistfile=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'); if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\nat\n" >> $pkglistfile; elif grep "Red Hat" /etc/*release;then echo -e "kexec-tools\ncrash\nat\n" >> $pkglistfile; elif grep "CentOS Linux" /etc/*release;then echo -e "kexec-tools\ncrash\nat\n" >> $pkglistfile;fi +cmd:pkglistfile=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'); if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\nat\n" >> $pkglistfile; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then echo -e "kexec-tools\ncrash\nat\n" >> $pkglistfile; fi check:rc==0 cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`;cp $exlistfile $exlistfile.bak @@ -31,7 +31,7 @@ cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc check:rc==0 cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;cp $postinstallfile $postinstallfile.bak -cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then sed -i "/\/tmp/ s/10/500/g" $postinstallfile; elif grep "Red Hat" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=500m 0 2" $postinstallfile;elif grep "CentOS Linux" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=500m 0 2" $postinstallfile;fi +cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then sed -i "/\/tmp/ s/10/500/g" $postinstallfile; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=500m 0 2" $postinstallfile;fi check:rc==0 cmd:if [ ! -d /opt/xcat/share/xcat/tools/autotest/kdumpdir ]; then mkdir -p /opt/xcat/share/xcat/tools/autotest/kdumpdir && chmod 777 /opt/xcat/share/xcat/tools/autotest/kdumpdir; fi diff --git a/xCAT-test/autotest/testcase/passwd/case0 b/xCAT-test/autotest/testcase/passwd/case0 index 1c26e5133..42a862d69 100644 --- a/xCAT-test/autotest/testcase/passwd/case0 +++ b/xCAT-test/autotest/testcase/passwd/case0 @@ -235,7 +235,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then if [ ! -e /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/initrd.gz ]; then copycds $$ISO;mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/;touch /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/initrd.gz;fi;fi cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 -cmd:if grep SUSE /etc/*release;then grep '\$1\$' /install/autoinst/$$CN | awk 'gsub(/^ *| *$/,"")'| awk -v head="" -v tail="" '{print substr($0, index($0,head)+length(head),index($0,tail)-index($0,head)-length(head))}' > /tmp/instcryptedpasswd; elif grep "Red Hat" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd; elif grep Ubuntu /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $4}' > /tmp/instcryptedpasswd;elif grep "CentOS Linux" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd;else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then grep '\$1\$' /install/autoinst/$$CN | awk 'gsub(/^ *| *$/,"")'| awk -v head="" -v tail="" '{print substr($0, index($0,head)+length(head),index($0,tail)-index($0,head)-length(head))}' > /tmp/instcryptedpasswd; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd; elif grep Ubuntu /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $4}' > /tmp/instcryptedpasswd;else echo "Sorry,this is not supported os"; fi #cmd:grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd check:rc==0 cmd:diff /tmp/tmpcryptedpasswd /tmp/instcryptedpasswd diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index 94b30dd59..be4f23080 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -1,13 +1,13 @@ start:restapi_setup_on_MN_CN description: Set up the REST API on MN and CN label:restapi -#Install the mod_ssl package on Red Hat -cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum install mod_ssl -y; rpm -qa | grep mod_ssl; fi +#Install the mod_ssl package on Red Hat and Rocky +cmd:if cat /etc/*release | grep "Red Hat\|Rocky" >/dev/null; then yum install mod_ssl -y; rpm -qa | grep mod_ssl; fi check:rc==0 -cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf; fi -cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf; fi +cmd:if cat /etc/*release | grep "Red Hat\|Rocky" >/dev/null; then sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf; fi +cmd:if cat /etc/*release | grep "Red Hat\|Rocky" >/dev/null; then sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf; fi check:rc==0 -cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then service httpd restart; fi +cmd:if cat /etc/*release | grep "Red Hat\|Rocky" >/dev/null; then service httpd restart; fi check:rc==0 #Configure the SLES environment cmd:if cat /etc/*release | grep "SLES" >/dev/null; then a2enmod ssl; a2enflag SSL; cp /etc/apache2/vhosts.d/vhost-ssl.template /etc/apache2/vhosts.d/vhost-ssl.conf; fi @@ -30,8 +30,8 @@ cmd:xdsh $$CN "rm /root/ca-cert.pem" check:rc==0 cmd:tabch -d key=xcat passwd check:rc==0 -#Remove the mod_ssl package on Red Hat -cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum remove mod_ssl -y; service httpd restart; fi +#Remove the mod_ssl package on Red Hat and Rocky +cmd:if cat /etc/*release | grep "Red Hat\|Rocky" >/dev/null; then yum remove mod_ssl -y; service httpd restart; fi check:rc==0 #Clean up the SLES environment cmd:if cat /etc/*release | grep "SLES" >/dev/null; then rm /etc/apache2/vhosts.d/vhost-ssl.conf; service apache2 restart; fi