diff --git a/platform/vs/tests/teamd/files/po01.conf b/platform/vs/tests/teamd/files/po01.conf deleted file mode 100644 index c2a1a4652aa2..000000000000 --- a/platform/vs/tests/teamd/files/po01.conf +++ /dev/null @@ -1,14 +0,0 @@ -{ - "device": "PortChannel0001", - "hwaddr": "ec:f4:bb:fe:80:90", - "runner": { - "name": "loadbalance", - "tx_hash": ["eth", "ipv4", "ipv6"] - }, - "link_watch": { - "name": "ethtool" - }, - "ports": { - "Ethernet112": {} - } -} diff --git a/platform/vs/tests/teamd/test_portchannel.py b/platform/vs/tests/teamd/test_portchannel.py index 820651c1be65..7ce7fc6c41bb 100644 --- a/platform/vs/tests/teamd/test_portchannel.py +++ b/platform/vs/tests/teamd/test_portchannel.py @@ -4,34 +4,33 @@ import json def test_PortChannel(dvs): + appldb = swsscommon.DBConnector(0, dvs.redis_sock, 0) + statdb = swsscommon.DBConnector(6, dvs.redis_sock, 0) - dvs.copy_file("/etc/teamd/", "teamd/files/po01.conf") - dvs.runcmd("teamd -f /etc/teamd/po01.conf -d") - dvs.runcmd("ifconfig PortChannel0001 up") - + # create the lag + dvs.runcmd("config portchannel add PortChannel0001") time.sleep(1) - # test lag table in app db - appdb = swsscommon.DBConnector(0, dvs.redis_sock, 0) - - tbl = swsscommon.Table(appdb, "LAG_TABLE") - + # test lag table in appl db + tbl = swsscommon.Table(appldb, "LAG_TABLE") (status, fvs) = tbl.get("PortChannel0001") + assert status == True + # test lag table in state db + tbl = swsscommon.Table(statdb, "LAG_TABLE") + (status, fvs) = tbl.get("PortChannel0001") assert status == True - # test lag member table in app db - tbl = swsscommon.Table(appdb, "LAG_MEMBER_TABLE") + # create the lag member + dvs.runcmd("config portchannel member add PortChannel0001 Ethernet112") + # test lag member table in appl db + tbl = swsscommon.Table(appldb, "LAG_MEMBER_TABLE") (status, fvs) = tbl.get("PortChannel0001:Ethernet112") - assert status == True - # test lag table in state db - confdb = swsscommon.DBConnector(6, dvs.redis_sock, 0) - - tbl = swsscommon.Table(confdb, "LAG_TABLE") + # remove the lag member + dvs.runcmd("config portchannel member del PortChannel0001 Ethernet112") - (status, fvs) = tbl.get("PortChannel0001") - - assert status == True + # remove the lag + dvs.runcmd("config portchannel del PortChannel0001")