From 4b5f8f24aace5f127a6b0882f1c3b6e502966ca9 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Wed, 26 Jun 2019 18:27:37 -0700 Subject: [PATCH] [test]: Fix set interface in configuration database (#956) INTF_NAME entry is needed besides INTF_NAME|PREFIX This change is introduced in commit 185e9a184 #794 Signed-off-by: Shu0T1an ChenG --- tests/conftest.py | 2 +- tests/test_mirror_ipv6_combined.py | 2 ++ tests/test_mirror_ipv6_separate.py | 2 ++ tests/test_mirror_policer.py | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0ab67618f3bd..a4d8ecb9e3a1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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): diff --git a/tests/test_mirror_ipv6_combined.py b/tests/test_mirror_ipv6_combined.py index 988d41b76f65..b3187dda85c6 100644 --- a/tests/test_mirror_ipv6_combined.py +++ b/tests/test_mirror_ipv6_combined.py @@ -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) @@ -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): diff --git a/tests/test_mirror_ipv6_separate.py b/tests/test_mirror_ipv6_separate.py index 97bf4df8dd27..8b12d0fbecdd 100644 --- a/tests/test_mirror_ipv6_separate.py +++ b/tests/test_mirror_ipv6_separate.py @@ -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) @@ -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): diff --git a/tests/test_mirror_policer.py b/tests/test_mirror_policer.py index 3226fbb16611..e9c5c5baa6df 100644 --- a/tests/test_mirror_policer.py +++ b/tests/test_mirror_policer.py @@ -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):