diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2021-10-06 06:40:36 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-06 06:40:36 -0400 | 
| commit | 11ed589224c8086903dcc1dbd28de4b98dcb7516 (patch) | |
| tree | d75430a98dd4f45fb05f7352442b04c34b46b4f5 | |
| parent | 3f220bc814abeb11a17fad80f14c7ba79af67429 (diff) | |
| parent | 2d28cbe66137397dcd3416b97edc99f982f1b988 (diff) | |
Merge pull request #9745 from opensourcerouting/bfd-ospf-topo-improv
topotests: improve bfd_ospf_topo1 test
| -rw-r--r-- | tests/topotests/bfd_ospf_topo1/rt1/ospf6d.conf | 4 | ||||
| -rw-r--r-- | tests/topotests/bfd_ospf_topo1/rt1/ospfd.conf | 6 | ||||
| -rw-r--r-- | tests/topotests/bfd_ospf_topo1/rt2/ospf6d.conf | 4 | ||||
| -rw-r--r-- | tests/topotests/bfd_ospf_topo1/rt2/ospfd.conf | 6 | ||||
| -rw-r--r-- | tests/topotests/bfd_ospf_topo1/rt3/ospf6d.conf | 4 | ||||
| -rw-r--r-- | tests/topotests/bfd_ospf_topo1/rt3/ospfd.conf | 6 | ||||
| -rw-r--r-- | tests/topotests/bfd_ospf_topo1/rt4/ospf6d.conf | 4 | ||||
| -rw-r--r-- | tests/topotests/bfd_ospf_topo1/rt4/ospfd.conf | 6 | ||||
| -rw-r--r-- | tests/topotests/bfd_ospf_topo1/rt5/ospf6d.conf | 4 | ||||
| -rw-r--r-- | tests/topotests/bfd_ospf_topo1/rt5/ospfd.conf | 6 | ||||
| -rwxr-xr-x | tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py | 11 | 
11 files changed, 55 insertions, 6 deletions
diff --git a/tests/topotests/bfd_ospf_topo1/rt1/ospf6d.conf b/tests/topotests/bfd_ospf_topo1/rt1/ospf6d.conf index 18def599b4..98da8c2619 100644 --- a/tests/topotests/bfd_ospf_topo1/rt1/ospf6d.conf +++ b/tests/topotests/bfd_ospf_topo1/rt1/ospf6d.conf @@ -6,10 +6,14 @@ hostname rt1  password 1  !  interface eth-rt2 + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 8   ipv6 ospf6 network broadcast   ipv6 ospf6 bfd  !  interface eth-rt3 + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 8   ipv6 ospf6 network broadcast   ipv6 ospf6 bfd  ! diff --git a/tests/topotests/bfd_ospf_topo1/rt1/ospfd.conf b/tests/topotests/bfd_ospf_topo1/rt1/ospfd.conf index 07b42f9885..9da8765005 100644 --- a/tests/topotests/bfd_ospf_topo1/rt1/ospfd.conf +++ b/tests/topotests/bfd_ospf_topo1/rt1/ospfd.conf @@ -10,13 +10,19 @@ debug ospf zebra  !  interface lo   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  interface eth-rt2   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8   ip ospf bfd  !  interface eth-rt3   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8   ip ospf bfd  !  router ospf diff --git a/tests/topotests/bfd_ospf_topo1/rt2/ospf6d.conf b/tests/topotests/bfd_ospf_topo1/rt2/ospf6d.conf index 2f35099564..34b0902094 100644 --- a/tests/topotests/bfd_ospf_topo1/rt2/ospf6d.conf +++ b/tests/topotests/bfd_ospf_topo1/rt2/ospf6d.conf @@ -5,10 +5,14 @@ hostname rt2  password 1  !  interface eth-rt1 + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 8   ipv6 ospf6 network broadcast   ipv6 ospf6 bfd  !  interface eth-rt5 + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 8   ipv6 ospf6 network broadcast  !  router ospf6 diff --git a/tests/topotests/bfd_ospf_topo1/rt2/ospfd.conf b/tests/topotests/bfd_ospf_topo1/rt2/ospfd.conf index a05d8b58c8..11be6a14b2 100644 --- a/tests/topotests/bfd_ospf_topo1/rt2/ospfd.conf +++ b/tests/topotests/bfd_ospf_topo1/rt2/ospfd.conf @@ -9,13 +9,19 @@ debug ospf zebra  !  interface lo   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  interface eth-rt1   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8   ip ospf bfd  !  interface eth-rt5   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  router ospf   ospf router-id 2.2.2.2 diff --git a/tests/topotests/bfd_ospf_topo1/rt3/ospf6d.conf b/tests/topotests/bfd_ospf_topo1/rt3/ospf6d.conf index 3e8777019e..8ab4eee1d3 100644 --- a/tests/topotests/bfd_ospf_topo1/rt3/ospf6d.conf +++ b/tests/topotests/bfd_ospf_topo1/rt3/ospf6d.conf @@ -5,10 +5,14 @@ hostname rt3  password 1  !  interface eth-rt1 + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 8   ipv6 ospf6 network broadcast   ipv6 ospf6 bfd  !  interface eth-rt4 + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 8   ipv6 ospf6 network broadcast  !  router ospf6 diff --git a/tests/topotests/bfd_ospf_topo1/rt3/ospfd.conf b/tests/topotests/bfd_ospf_topo1/rt3/ospfd.conf index 1196e6d189..acc54b3866 100644 --- a/tests/topotests/bfd_ospf_topo1/rt3/ospfd.conf +++ b/tests/topotests/bfd_ospf_topo1/rt3/ospfd.conf @@ -9,13 +9,19 @@ debug ospf zebra  !  interface lo   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  interface eth-rt1   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8   ip ospf bfd  !  interface eth-rt4   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  router ospf   ospf router-id 3.3.3.3 diff --git a/tests/topotests/bfd_ospf_topo1/rt4/ospf6d.conf b/tests/topotests/bfd_ospf_topo1/rt4/ospf6d.conf index bccd1e75bd..138b688140 100644 --- a/tests/topotests/bfd_ospf_topo1/rt4/ospf6d.conf +++ b/tests/topotests/bfd_ospf_topo1/rt4/ospf6d.conf @@ -5,9 +5,13 @@ hostname rt4  password 1  !  interface eth-rt3 + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 8   ipv6 ospf6 network broadcast  !  interface eth-rt5 + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 8   ipv6 ospf6 network broadcast  !  router ospf6 diff --git a/tests/topotests/bfd_ospf_topo1/rt4/ospfd.conf b/tests/topotests/bfd_ospf_topo1/rt4/ospfd.conf index 3a2568b4ab..670e56ccc8 100644 --- a/tests/topotests/bfd_ospf_topo1/rt4/ospfd.conf +++ b/tests/topotests/bfd_ospf_topo1/rt4/ospfd.conf @@ -9,12 +9,18 @@ debug ospf zebra  !  interface lo   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  interface eth-rt3   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  interface eth-rt5   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  router ospf   ospf router-id 4.4.4.4 diff --git a/tests/topotests/bfd_ospf_topo1/rt5/ospf6d.conf b/tests/topotests/bfd_ospf_topo1/rt5/ospf6d.conf index 766862276c..6eb4fe59a8 100644 --- a/tests/topotests/bfd_ospf_topo1/rt5/ospf6d.conf +++ b/tests/topotests/bfd_ospf_topo1/rt5/ospf6d.conf @@ -6,9 +6,13 @@ password 1  !  interface eth-rt2   ipv6 ospf6 network broadcast + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 8  !  interface eth-rt4   ipv6 ospf6 network broadcast + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 8  !  router ospf6   ospf6 router-id 5.5.5.5 diff --git a/tests/topotests/bfd_ospf_topo1/rt5/ospfd.conf b/tests/topotests/bfd_ospf_topo1/rt5/ospfd.conf index a35de5f45f..286de51288 100644 --- a/tests/topotests/bfd_ospf_topo1/rt5/ospfd.conf +++ b/tests/topotests/bfd_ospf_topo1/rt5/ospfd.conf @@ -9,12 +9,18 @@ debug ospf zebra  !  interface lo   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  interface eth-rt2   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  interface eth-rt4   ip ospf area 0.0.0.0 + ip ospf hello-interval 2 + ip ospf dead-interval 8  !  router ospf   ospf router-id 5.5.5.5 diff --git a/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py b/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py index 09b8631740..bef2c3f162 100755 --- a/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py +++ b/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py @@ -132,7 +132,7 @@ def print_cmd_result(rname, command):      print(get_topogen().gears[rname].vtysh_cmd(command, isjson=False)) -def router_compare_json_output(rname, command, reference, count=120, wait=0.5): +def router_compare_json_output(rname, command, reference, count=40, wait=2):      "Compare router JSON output"      logger.info('Comparing router "%s" "%s" output', rname, command) @@ -141,7 +141,7 @@ def router_compare_json_output(rname, command, reference, count=120, wait=0.5):      filename = "{}/{}/{}".format(CWD, rname, reference)      expected = json.loads(open(filename).read()) -    # Run test function until we get an result. Wait at most 60 seconds. +    # Run test function until we get an result. Wait at most 80 seconds.      test_func = partial(topotest.router_json_cmp, tgen.gears[rname], command, expected)      _, diff = topotest.run_and_expect(test_func, None, count=count, wait=wait)      assertmsg = '"{}" JSON output mismatches the expected result'.format(rname) @@ -195,8 +195,8 @@ def test_bfd_ospf_interface_failure_rt2_step3():      # By default BFD provides a recovery time of 900ms plus jitter, so let's wait      # initial 2 seconds to let the CI not suffer. -    # TODO: add check for array size -    sleep(2) +    topotest.sleep(2, 'Wait for BFD down notification') +      router_compare_json_output(          "rt1", "show ip route ospf json", "step3/show_ip_route_rt2_down.ref", 1, 0      ) @@ -234,8 +234,7 @@ def test_bfd_ospf_interface_failure_rt3_step3():      # By default BFD provides a recovery time of 900ms plus jitter, so let's wait      # initial 2 seconds to let the CI not suffer. -    # TODO: add check for array size -    sleep(2) +    topotest.sleep(2, 'Wait for BFD down notification')      router_compare_json_output(          "rt1", "show ip route ospf json", "step3/show_ip_route_rt3_down.ref", 1, 0      )  | 
