Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test]: Update VS portchannel tests to remove static conf file #2219

Merged
merged 1 commit into from
Nov 3, 2018
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
14 changes: 0 additions & 14 deletions platform/vs/tests/teamd/files/po01.conf

This file was deleted.

37 changes: 18 additions & 19 deletions platform/vs/tests/teamd/test_portchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")