Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions platform/vs/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def copy_file(self, path, filename):
tar = tarfile.open(fileobj=tarstr, mode="w")
tar.add(filename, os.path.basename(filename))
tar.close()
self.ctn.exec_run("mkdir -p %s" % path)
self.ctn.put_archive(path, tarstr.getvalue())
tarstr.close()

Expand Down
14 changes: 14 additions & 0 deletions platform/vs/tests/teamd/files/po01.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"device": "PortChannel0001",
"hwaddr": "ec:f4:bb:fe:80:90",
"runner": {
"name": "loadbalance",
"tx_hash": ["eth", "ipv4", "ipv6"]
},
"link_watch": {
"name": "ethtool"
},
"ports": {
"Ethernet112": {}
}
}
37 changes: 37 additions & 0 deletions platform/vs/tests/teamd/test_portchannel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from swsscommon import swsscommon
import time
import re
import json

def test_PortChannel(dvs):

dvs.copy_file("/etc/teamd/", "teamd/files/po01.conf")
dvs.runcmd("teamd -f /etc/teamd/po01.conf -d")
dvs.runcmd("ifconfig PortChannel0001 up")

time.sleep(1)

# test lag table in app db
appdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)

tbl = swsscommon.Table(appdb, "LAG_TABLE")

(status, fvs) = tbl.get("PortChannel0001")

assert status == True

# test lag member table in app db
tbl = swsscommon.Table(appdb, "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")

(status, fvs) = tbl.get("PortChannel0001")

assert status == True