Skip to content

Commit

Permalink
[test]: Update VS portchannel tests to remove static conf file
Browse files Browse the repository at this point in the history
Currently, the teamd configuration is no longer used in SONiC. The
configuration is dynamically generated and stored in the configuration
database, which is picked up by the teammgrd.

To create new portchannels, and the members, the command:
config portchannel add
config portchannel member add
are used.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
  • Loading branch information
Shu0T1an ChenG committed Nov 1, 2018
1 parent 6ff5a88 commit 5a40909
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 33 deletions.
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")

0 comments on commit 5a40909

Please sign in to comment.