Skip to content

Commit

Permalink
[test]: Fix set interface in configuration database (sonic-net#956)
Browse files Browse the repository at this point in the history
INTF_NAME entry is needed besides INTF_NAME|PREFIX
This change is introduced in commit 185e9a1 sonic-net#794

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
  • Loading branch information
stcheng authored Jun 27, 2019
1 parent 6bdf7f2 commit 4b5f8f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,8 @@ def add_ip_address(self, interface, ip):
tbl_name = "INTERFACE"
tbl = swsscommon.Table(self.cdb, tbl_name)
fvs = swsscommon.FieldValuePairs([("NULL", "NULL")])
tbl.set(interface + "|" + ip, fvs)
tbl.set(interface, fvs)
tbl.set(interface + "|" + ip, fvs)
time.sleep(1)

def remove_ip_address(self, interface, ip):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_mirror_ipv6_combined.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def add_ip_address(self, interface, ip):
tbl_name = "INTERFACE"
tbl = swsscommon.Table(self.cdb, tbl_name)
fvs = swsscommon.FieldValuePairs([("NULL", "NULL")])
tbl.set(interface, fvs)
tbl.set(interface + "|" + ip, fvs)
time.sleep(1)

Expand All @@ -56,6 +57,7 @@ def remove_ip_address(self, interface, ip):
tbl_name = "INTERFACE"
tbl = swsscommon.Table(self.cdb, tbl_name)
tbl._del(interface + "|" + ip)
tbl._del(interface)
time.sleep(1)

def add_neighbor(self, interface, ip, mac):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_mirror_ipv6_separate.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def add_ip_address(self, interface, ip):
tbl_name = "INTERFACE"
tbl = swsscommon.Table(self.cdb, tbl_name)
fvs = swsscommon.FieldValuePairs([("NULL", "NULL")])
tbl.set(interface, fvs)
tbl.set(interface + "|" + ip, fvs)
time.sleep(1)

Expand All @@ -50,6 +51,7 @@ def remove_ip_address(self, interface, ip):
tbl_name = "INTERFACE"
tbl = swsscommon.Table(self.cdb, tbl_name)
tbl._del(interface + "|" + ip)
tbl._del(interface)
time.sleep(1)

def add_neighbor(self, interface, ip, mac):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_mirror_policer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ def set_port_status(self, port, admin_status):
def add_ip_address(self, interface, ip):
tbl = swsscommon.Table(self.cdb, "INTERFACE")
fvs = swsscommon.FieldValuePairs([("NULL", "NULL")])
tbl.set(interface, fvs)
tbl.set(interface + "|" + ip, fvs)
time.sleep(1)

def remove_ip_address(self, interface, ip):
tbl = swsscommon.Table(self.cdb, "INTERFACE")
tbl._del(interface + "|" + ip)
tbl._del(interface)
time.sleep(1)

def add_neighbor(self, interface, ip, mac):
Expand Down

0 comments on commit 4b5f8f2

Please sign in to comment.