aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Béreš <daniel.beres@pantheon.tech>2021-11-03 08:55:04 +0000
committerDamjan Marion <dmarion@me.com>2021-11-09 09:54:34 +0000
commit90c397c505d35498b59756020e2d465f1b45e871 (patch)
tree54e39e758ed0e0764856806548e56aa9671d8cd0 /test
parentf7b1f8a8911b51e01f7ecd79d25eb8d89da74884 (diff)
memif: memif linkstate can't become up
Admin down implies Link down but nothing came with admin up. Ticket: VPP-1959 Type: fix Change-Id: I43725329ae7918659c73d703280c25de5f0b1d14 Signed-off-by: Daniel Béreš <daniel.beres@pantheon.tech>
Diffstat (limited to 'test')
-rw-r--r--test/test_memif.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/test_memif.py b/test/test_memif.py
index fc7cf9b2e7e..bf1c10a0a8a 100644
--- a/test/test_memif.py
+++ b/test/test_memif.py
@@ -303,6 +303,46 @@ class TestMemif(VppTestCase):
route.remove_vpp_config()
+ def test_memif_admin_up_down_up(self):
+ """ Memif admin up/down/up """
+ memif = VppMemif(
+ self,
+ VppEnum.vl_api_memif_role_t.MEMIF_ROLE_API_SLAVE,
+ VppEnum.vl_api_memif_mode_t.MEMIF_MODE_API_ETHERNET,
+ ring_size=1024,
+ buffer_size=2048,
+ secret="abc")
+
+ remote_socket = VppSocketFilename(self.remote_test, 1,
+ "%s/memif.sock" % self.tempdir)
+ remote_socket.add_vpp_config()
+
+ remote_memif = VppMemif(
+ self.remote_test,
+ VppEnum.vl_api_memif_role_t.MEMIF_ROLE_API_MASTER,
+ VppEnum.vl_api_memif_mode_t.MEMIF_MODE_API_ETHERNET,
+ socket_id=1,
+ ring_size=1024,
+ buffer_size=2048,
+ secret="abc")
+
+ memif.add_vpp_config()
+ remote_memif.add_vpp_config()
+
+ memif.admin_up()
+ remote_memif.admin_up()
+ memif.admin_down()
+ remote_memif.admin_down()
+ memif.admin_up()
+ remote_memif.admin_up()
+
+ self._connect_test_one_interface(memif)
+ self._connect_test_one_interface(remote_memif)
+
+ memif.remove_vpp_config()
+ remote_memif.remove_vpp_config()
+ remote_socket.remove_vpp_config()
+
if __name__ == '__main__':
unittest.main(testRunner=VppTestRunner)