]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgp_rfapi_basic_sanity: added close check
authorLou Berger <lberger@labn.net>
Tue, 28 Aug 2018 18:10:05 +0000 (18:10 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:14 +0000 (20:22 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py [new file with mode: 0644]
tests/topotests/bgp_rfapi_basic_sanity/test_bgp_rfapi_basic_sanity.py

diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py
new file mode 100644 (file)
index 0000000..c168ed5
--- /dev/null
@@ -0,0 +1,12 @@
+from lutil import luCommand
+luCommand('r1','vtysh -c "debug rfapi-dev open vn 20.0.0.1 un 1.1.1.21"','rfapi_set_response_cb: status 0', 'pass', 'Opened RFAPI')
+luCommand('r1','vtysh -c "debug rfapi-dev register vn 20.0.0.1 un 1.1.1.21 prefix 111.111.111.0/24 lifetime 5"','', 'none', 'Prefix registered')
+luCommand('r1','vtysh -c "show vnc registrations local"','111.111.111.0/24','wait','Local registration',1)
+luCommand('r1','vtysh -c "show vnc registrations"','.','none')
+luCommand('r3','vtysh -c "show vnc registrations"','111.111.111.0/24','wait','See registration')
+luCommand('r4','vtysh -c "show vnc registrations"','111.111.111.0/24','wait','See registration')
+luCommand('r1','vtysh -c "debug rfapi-dev close vn 20.0.0.1 un 1.1.1.21"','status 0', 'pass', 'Closed RFAPI')
+luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active:  1 .* Remotely: *Active:  2','wait','See cleanup')
+luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active:  1 .* Remotely: *Active:  2','wait','See cleanup')
+luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active:  1 .* Remotely: *Active:  2','wait','See cleanup')
+
index f710c84c3709c95aa52371e67abfc812480784a3..fa58d007560366b2871ce316a65bd9b7ea523e8b 100755 (executable)
@@ -56,6 +56,15 @@ def test_check_routes():
     #CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True)'
     ltemplateTest('scripts/check_routes.py', False, CliOnFail, CheckFunc)
 
+def test_check_close():
+    CliOnFail = None
+    # For debugging, uncomment the next line
+    #CliOnFail = 'tgen.mininet_cli'
+    CheckFunc = 'ltemplateVersionCheck(\'3.1\')'
+    #uncomment next line to start cli *before* script is run
+    #CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True)'
+    ltemplateTest('scripts/check_close.py', False, CliOnFail, CheckFunc)
+
 def test_cleanup_all():
     CliOnFail = None
     # For debugging, uncomment the next line