[vs]: add teamd test on vs platform (#1720)

Signed-off-by: Guohan Lu <gulv@microsoft.com>
This commit is contained in:
lguohan 2018-05-17 11:12:59 -07:00 committed by GitHub
parent 174960cc22
commit eb9b86aca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 0 deletions

View File

@ -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()

View 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": {}
}
}

View 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