[vs]: add teamd test on vs platform (#1720)
Signed-off-by: Guohan Lu <gulv@microsoft.com>
This commit is contained in:
parent
174960cc22
commit
eb9b86aca4
@ -220,6 +220,7 @@ class DockerVirtualSwitch(object):
|
||||
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()
|
||||
|
||||
|
14
platform/vs/tests/teamd/files/po01.conf
Normal file
14
platform/vs/tests/teamd/files/po01.conf
Normal file
@ -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
platform/vs/tests/teamd/test_portchannel.py
Normal file
37
platform/vs/tests/teamd/test_portchannel.py
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user