diff --git a/tests/test_crm.py b/tests/test_crm.py index f99c3cf69f27..9d52550af155 100644 --- a/tests/test_crm.py +++ b/tests/test_crm.py @@ -138,7 +138,7 @@ def test_CrmIpv4Route(self, dvs, testlog): fvs = swsscommon.FieldValuePairs([("NULL","NULL")]) intf_tbl.set("Ethernet0", fvs) intf_tbl.set("Ethernet0|10.0.0.0/31", fvs) - dvs.runcmd("ifconfig Ethernet0 up") + dvs.runcmd("config interface startup Ethernet0") dvs.runcmd("crm config polling interval 1") @@ -205,7 +205,7 @@ def test_CrmIpv6Route(self, dvs, testlog): fvs = swsscommon.FieldValuePairs([("NULL","NULL")]) intf_tbl.set("Ethernet0", fvs) intf_tbl.set("Ethernet0|fc00::1/126", fvs) - dvs.runcmd("ifconfig Ethernet0 up") + dvs.runcmd("config interface startup Ethernet0") dvs.servers[0].runcmd("ifconfig eth0 inet6 add fc00::2/126") dvs.servers[0].runcmd("ip -6 route add default via fc00::1") @@ -271,7 +271,7 @@ def test_CrmIpv4Nexthop(self, dvs, testlog): fvs = swsscommon.FieldValuePairs([("NULL","NULL")]) intf_tbl.set("Ethernet0|10.0.0.0/31", fvs) intf_tbl.set("Ethernet0", fvs) - dvs.runcmd("ifconfig Ethernet0 up") + dvs.runcmd("config interface startup Ethernet0") dvs.runcmd("crm config polling interval 1") @@ -330,7 +330,7 @@ def test_CrmIpv6Nexthop(self, dvs, testlog): fvs = swsscommon.FieldValuePairs([("NULL","NULL")]) intf_tbl.set("Ethernet0", fvs) intf_tbl.set("Ethernet0|fc00::1/126", fvs) - dvs.runcmd("ifconfig Ethernet0 up") + dvs.runcmd("config interface startup Ethernet0") dvs.runcmd("crm config polling interval 1") @@ -385,7 +385,7 @@ def test_CrmIpv4Neighbor(self, dvs, testlog): fvs = swsscommon.FieldValuePairs([("NULL","NULL")]) intf_tbl.set("Ethernet0", fvs) intf_tbl.set("Ethernet0|10.0.0.0/31", fvs) - dvs.runcmd("ifconfig Ethernet0 up") + dvs.runcmd("config interface startup Ethernet0") dvs.runcmd("crm config polling interval 1") @@ -444,7 +444,7 @@ def test_CrmIpv6Neighbor(self, dvs, testlog): fvs = swsscommon.FieldValuePairs([("NULL","NULL")]) intf_tbl.set("Ethernet0", fvs) intf_tbl.set("Ethernet0|fc00::1/126", fvs) - dvs.runcmd("ifconfig Ethernet0 up") + dvs.runcmd("config interface startup Ethernet0") dvs.runcmd("crm config polling interval 1") @@ -501,8 +501,8 @@ def test_CrmNexthopGroup(self, dvs, testlog): intf_tbl.set("Ethernet4", fvs) intf_tbl.set("Ethernet0|10.0.0.0/31", fvs) intf_tbl.set("Ethernet4|10.0.0.2/31", fvs) - dvs.runcmd("ifconfig Ethernet0 up") - dvs.runcmd("ifconfig Ethernet4 up") + dvs.runcmd("config interface startup Ethernet0") + dvs.runcmd("config interface startup Ethernet4") dvs.runcmd("crm config polling interval 1") @@ -576,8 +576,8 @@ def test_CrmNexthopGroupMember(self, dvs, testlog): intf_tbl.set("Ethernet4", fvs) intf_tbl.set("Ethernet0|10.0.0.0/31", fvs) intf_tbl.set("Ethernet4|10.0.0.2/31", fvs) - dvs.runcmd("ifconfig Ethernet0 up") - dvs.runcmd("ifconfig Ethernet4 up") + dvs.runcmd("config interface startup Ethernet0") + dvs.runcmd("config interface startup Ethernet4") dvs.runcmd("crm config polling interval 1") diff --git a/tests/test_fdb.py b/tests/test_fdb.py index f883acb1bdf5..15a386f4d71f 100644 --- a/tests/test_fdb.py +++ b/tests/test_fdb.py @@ -382,4 +382,3 @@ def test_FdbAddedAfterMemberCreated(self, dvs, testlog): dvs.runcmd("sonic-clear fdb all") dvs.remove_vlan_member("2", "Ethernet0") dvs.remove_vlan("2") - diff --git a/tests/test_nat.py b/tests/test_nat.py index f93025025e59..0f60a2aa0054 100644 --- a/tests/test_nat.py +++ b/tests/test_nat.py @@ -12,8 +12,8 @@ def set_interfaces(self, dvs): self.config_db.create_entry("INTERFACE", "Ethernet4|18.18.18.1/24", fvs) self.config_db.create_entry("INTERFACE", "Ethernet0", fvs) self.config_db.create_entry("INTERFACE", "Ethernet4", fvs) - dvs.runcmd("ifconfig Ethernet0 up") - dvs.runcmd("ifconfig Ethernet4 up") + dvs.runcmd("config interface startup Ethernet0") + dvs.runcmd("config interface startup Ethernet4") dvs.servers[0].runcmd("ip link set down dev eth0") dvs.servers[0].runcmd("ip link set up dev eth0") diff --git a/tests/test_nhg.py b/tests/test_nhg.py index 56f3bdb0b6b2..ac26b5107f20 100644 --- a/tests/test_nhg.py +++ b/tests/test_nhg.py @@ -18,9 +18,9 @@ def test_route_nhg(self, dvs, testlog): intf_tbl.set("Ethernet0|10.0.0.0/31", fvs) intf_tbl.set("Ethernet4|10.0.0.2/31", fvs) intf_tbl.set("Ethernet8|10.0.0.4/31", fvs) - dvs.runcmd("ifconfig Ethernet0 up") - dvs.runcmd("ifconfig Ethernet4 up") - dvs.runcmd("ifconfig Ethernet8 up") + dvs.runcmd("config interface startup Ethernet0") + dvs.runcmd("config interface startup Ethernet4") + dvs.runcmd("config interface startup Ethernet8") dvs.runcmd("arp -s 10.0.0.1 00:00:00:00:00:01") dvs.runcmd("arp -s 10.0.0.3 00:00:00:00:00:02") diff --git a/tests/test_port.py b/tests/test_port.py index d57031077f50..c2878d4df52f 100644 --- a/tests/test_port.py +++ b/tests/test_port.py @@ -26,9 +26,11 @@ def test_PortMtu(self, dvs, testlog): assert fv[1] == "9100" def test_PortNotification(self, dvs, testlog): + dvs.runcmd("config interface startup Ethernet0") + dvs.runcmd("config interface ip add Ethernet0 10.0.0.0/31") - dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") == 0 - dvs.runcmd("ifconfig Ethernet4 10.0.0.2/31 up") == 0 + dvs.runcmd("config interface startup Ethernet4") + dvs.runcmd("config interface ip add Ethernet4 10.0.0.2/31") dvs.servers[0].runcmd("ip link set down dev eth0") == 0 @@ -69,9 +71,11 @@ def test_PortNotification(self, dvs, testlog): assert oper_status == "up" def test_PortFec(self, dvs, testlog): + dvs.runcmd("config interface startup Ethernet0") + dvs.runcmd("config interface ip add Ethernet0 10.0.0.0/31") - dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") == 0 - dvs.runcmd("ifconfig Ethernet4 10.0.0.2/31 up") == 0 + dvs.runcmd("config interface startup Ethernet4") + dvs.runcmd("config interface ip add Ethernet4 10.0.0.2/31") dvs.servers[0].runcmd("ip link set down dev eth0") == 0 diff --git a/tests/test_warm_reboot.py b/tests/test_warm_reboot.py index 6427453a1fe1..bfce08fda38d 100644 --- a/tests/test_warm_reboot.py +++ b/tests/test_warm_reboot.py @@ -244,8 +244,8 @@ def test_PortSyncdWarmRestart(self, dvs, testlog): dvs.runcmd("config warm_restart enable swss") - dvs.runcmd("ifconfig Ethernet16 up") - dvs.runcmd("ifconfig Ethernet20 up") + dvs.runcmd("config interface startup Ethernet16") + dvs.runcmd("config interface startup Ethernet20") time.sleep(1) @@ -256,8 +256,8 @@ def test_PortSyncdWarmRestart(self, dvs, testlog): intf_tbl.set("Ethernet20|11.0.0.9/29", fvs) intf_tbl.set("Ethernet16", fvs) intf_tbl.set("Ethernet20", fvs) - dvs.runcmd("ifconfig Ethernet16 up") - dvs.runcmd("ifconfig Ethernet20 up") + dvs.runcmd("config interface startup Ethernet16") + dvs.runcmd("config interface startup Ethernet20") dvs.servers[4].runcmd("ip link set down dev eth0") == 0 dvs.servers[4].runcmd("ip link set up dev eth0") == 0 @@ -315,7 +315,7 @@ def test_PortSyncdWarmRestart(self, dvs, testlog): check_port_oper_status(appl_db, "Ethernet16", "up") check_port_oper_status(appl_db, "Ethernet20", "up") - check_port_oper_status(appl_db, "Ethernet24", "up") + check_port_oper_status(appl_db, "Ethernet24", "down") swss_app_check_RestoreCount_single(state_db, restore_count, "portsyncd") @@ -336,8 +336,8 @@ def test_VlanMgrdWarmRestart(self, dvs, testlog): dvs.runcmd("ifconfig Ethernet16 0") dvs.runcmd("ifconfig Ethernet20 0") - dvs.runcmd("ifconfig Ethernet16 up") - dvs.runcmd("ifconfig Ethernet20 up") + dvs.runcmd("config interface startup Ethernet16 ") + dvs.runcmd("config interface startup Ethernet20 ") time.sleep(1) @@ -384,8 +384,8 @@ def test_VlanMgrdWarmRestart(self, dvs, testlog): intf_tbl.set("Vlan20|11.0.0.9/29", fvs) intf_tbl.set("Vlan16", fvs) intf_tbl.set("Vlan20", fvs) - dvs.runcmd("ifconfig Vlan16 up") - dvs.runcmd("ifconfig Vlan20 up") + dvs.runcmd("config interface startup Vlan16") + dvs.runcmd("config interface startup Vlan20") dvs.servers[4].runcmd("ifconfig eth0 11.0.0.2/29") dvs.servers[4].runcmd("ip route add default via 11.0.0.1") @@ -478,8 +478,8 @@ def test_swss_neighbor_syncup(self, dvs, testlog): intf_tbl.set("{}".format(intfs[1]), fvs) intf_tbl.set("{}".format(intfs[0]), fvs) intf_tbl.set("{}".format(intfs[1]), fvs) - dvs.runcmd("ifconfig {} up".format(intfs[0])) - dvs.runcmd("ifconfig {} up".format(intfs[1])) + dvs.runcmd("config interface startup {}".format(intfs[0])) + dvs.runcmd("config interface startup {}".format(intfs[1])) ips = ["24.0.0.2", "24.0.0.3", "28.0.0.2", "28.0.0.3"] v6ips = ["2400::2", "2400::3", "2800::2", "2800::3"] @@ -831,8 +831,8 @@ def test_OrchagentWarmRestartReadyCheck(self, dvs, testlog): intf_tbl.set("Ethernet4|10.0.0.2/31", fvs) intf_tbl.set("Ethernet0", fvs) intf_tbl.set("Ethernet4", fvs) - dvs.runcmd("ifconfig Ethernet0 up") - dvs.runcmd("ifconfig Ethernet4 up") + dvs.runcmd("config interface startup Ethernet0") + dvs.runcmd("config interface startup Ethernet4") dvs.servers[0].runcmd("ifconfig eth0 10.0.0.1/31") dvs.servers[0].runcmd("ip route add default via 10.0.0.0") @@ -904,9 +904,9 @@ def test_swss_port_state_syncup(self, dvs, testlog): intf_tbl.set("Ethernet0", fvs) intf_tbl.set("Ethernet4", fvs) intf_tbl.set("Ethernet8", fvs) - dvs.runcmd("ifconfig Ethernet0 up") - dvs.runcmd("ifconfig Ethernet4 up") - dvs.runcmd("ifconfig Ethernet8 up") + dvs.runcmd("config interface startup Ethernet0") + dvs.runcmd("config interface startup Ethernet4") + dvs.runcmd("config interface startup Ethernet8") dvs.runcmd("arp -s 10.0.0.1 00:00:00:00:00:01") dvs.runcmd("arp -s 10.0.0.3 00:00:00:00:00:02") @@ -1075,9 +1075,9 @@ def test_routing_WarmRestart(self, dvs, testlog): intf_tbl.set("{}".format(intfs[1]), fvs) intf_tbl.set("{}".format(intfs[2]), fvs) intf_tbl.set("{}".format(intfs[2]), fvs) - dvs.runcmd("ip link set {} up".format(intfs[0])) - dvs.runcmd("ip link set {} up".format(intfs[1])) - dvs.runcmd("ip link set {} up".format(intfs[2])) + dvs.runcmd("config interface startup {}".format(intfs[0])) + dvs.runcmd("config interface startup {}".format(intfs[1])) + dvs.runcmd("config interface startup {}".format(intfs[2])) time.sleep(1) @@ -1835,7 +1835,7 @@ def test_system_warmreboot_neighbor_syncup(self, dvs, testlog): intf_tbl.set("Ethernet{}|{}00::1/64".format(i*4, i*4), fvs) intf_tbl.set("Ethernet{}".format(i*4, i*4), fvs) intf_tbl.set("Ethernet{}".format(i*4, i*4), fvs) - dvs.runcmd("ip link set Ethernet{} up".format(i*4, i*4)) + dvs.runcmd("config interface startup Ethernet{}".format(i*4, i*4)) dvs.servers[i].runcmd("ip link set up dev eth0") dvs.servers[i].runcmd("ip addr flush dev eth0") #result = dvs.servers[i].runcmd_output("ifconfig eth0 | grep HWaddr | awk '{print $NF}'") @@ -2082,8 +2082,8 @@ def test_VrfMgrdWarmRestart(self, dvs, testlog): dvs.runcmd("config warm_restart enable swss") # bring up interface - dvs.runcmd("ifconfig Ethernet0 up") - dvs.runcmd("ifconfig Ethernet4 up") + dvs.runcmd("config interface startup Ethernet0 ") + dvs.runcmd("config interface startup Ethernet4 ") # create vrf create_entry_tbl(conf_db, "VRF", "Vrf_1", [('empty', 'empty')])