diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2024-02-01 14:56:07 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-01 14:56:07 -0500 |
| commit | e24f43e64e0c6d3ea236e526ce0bf4d82c36cad2 (patch) | |
| tree | 42a9ba087a7a0babcc8ef64413220772fba82c4f /tests | |
| parent | 62443d7f66ee52d7d71547b5941bf6bb91b3399b (diff) | |
| parent | 75219184544ab91b5425f27a125077cea9821b0b (diff) | |
Merge pull request #15272 from LabNConsulting/chopps/mgmtd-notif-test
tests: add mgmtd backend notification test
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/topotests/mgmt_notif/test_notif.py | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/tests/topotests/mgmt_notif/test_notif.py b/tests/topotests/mgmt_notif/test_notif.py index 873b82d999..2f923e398c 100644 --- a/tests/topotests/mgmt_notif/test_notif.py +++ b/tests/topotests/mgmt_notif/test_notif.py @@ -43,7 +43,7 @@ def tgen(request): tgen.stop_topology() -def test_oper_simple(tgen): +def test_frontend_notification(tgen): if tgen.routers_have_failure(): pytest.skip(tgen.errors) @@ -57,9 +57,46 @@ def test_oper_simple(tgen): if rc: pytest.skip("No protoc or present cannot run test") + # The first notifications is a frr-ripd:authentication-type-failure + # So we filter to avoid that, all the rest are frr-ripd:authentication-failure + # making our test deterministic + output = r1.cmd_raises( + fe_client_path + " --listen frr-ripd:authentication-failure" + ) + jsout = json.loads(output) + + expected = {"frr-ripd:authentication-failure": {"interface-name": "r1-eth0"}} + result = json_cmp(jsout, expected) + assert result is None + output = r1.cmd_raises(fe_client_path + " --listen") jsout = json.loads(output) - expected = {"frr-ripd:authentication-type-failure": {"interface-name": "r1-eth0"}} + expected = {"frr-ripd:authentication-failure": {"interface-name": "r1-eth0"}} + result = json_cmp(jsout, expected) + assert result is None + + +def test_backend_notification(tgen): + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + r1 = tgen.gears["r1"].net + + check_kernel_32(r1, "11.11.11.11", 1, "") + + be_client_path = "/usr/lib/frr/mgmtd_testc" + rc, _, _ = r1.cmd_status(be_client_path + " --help") + + if rc: + pytest.skip("No mgmtd_testc") + + output = r1.cmd_raises( + be_client_path + " --timeout 20 --log file:mgmt_testc.log --listen frr-ripd" + ) + + jsout = json.loads(output) + + expected = {"frr-ripd:authentication-failure": {"interface-name": "r1-eth0"}} result = json_cmp(jsout, expected) assert result is None |
