diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index d41b2772c..68ba386c5 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -903,10 +903,6 @@ cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicne check:rc==0 cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:chdef $$CN nicips.$$THIRDNIC=12.1.0.100 nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=12_1_0_0-255_255_0_0 -check:rc==0 -cmd:updatenode $$CN -P confignetwork -check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 @@ -921,6 +917,8 @@ cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{pr 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 check:output=~30.5.106.8 check:rc==0 @@ -930,8 +928,6 @@ check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br22 check:output=~br33 -cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" -check:output=~bond0 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:rmdef -t network -o 12_1_0_0-255_255_0_0 diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index d27cd5573..905b6f52c 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -27,6 +27,7 @@ brctl="brctl" uniq="uniq" xargs="xargs" modprobe="modprobe" +xcatcreatedcon='' if [ -n "$LOGLABEL" ]; then log_label=$LOGLABEL else @@ -2067,6 +2068,10 @@ function create_bridge_interface_nmcli { if [ $? -eq 0 ]; then $nmcli con delete $tmp_slave_con_name fi + if [ -n "$xcatcreatedcon" ]; then + $nmcli con up $xcatcreatedcon + log_info "$nmcli con up $xcatcreatedcon" + fi wait_for_ifstate $ifname UP 40 40 [ $? -ne 0 ] && rc=1 $ip address show dev $ifname| $sed -e 's/^/[bridge] >> /g' | log_lines info @@ -2187,6 +2192,7 @@ function create_bond_interface_nmcli { else cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts method none ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix $_mtu connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0" fi + xcatcreatedcon=$xcat_con_name log_info $cmd $cmd if [ $? -ne 0 ]; then