From 14fdbe00e17d247066f069b867a370a18cd8f70b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 28 Jul 2021 16:25:54 -0400 Subject: [PATCH] tests: Set addresses before we use snmpd The test_simple_snmp.py test starts bgp, zebra and snmpd at the same time. Then zebra configuration is read in and interface addresses are applied. If snmp start slower than zebra the snmp process can properly get it's ip address to bind to if it is faster than zebra, it will fail. Ensure that the test has addresses before we start daemons. Signed-off-by: Donald Sharp --- tests/topotests/simple_snmp_test/test_simple_snmp.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/topotests/simple_snmp_test/test_simple_snmp.py b/tests/topotests/simple_snmp_test/test_simple_snmp.py index 5647e2b663..bdb44816b6 100755 --- a/tests/topotests/simple_snmp_test/test_simple_snmp.py +++ b/tests/topotests/simple_snmp_test/test_simple_snmp.py @@ -90,6 +90,16 @@ def setup_module(mod): r1 = tgen.gears["r1"] + r1.run("ip addr add 192.168.12.12/24 dev r1-eth0") + r1.run("ip -6 addr add 2000:1:1:12::12/64 dev r1-eth0") + r1.run("ip addr add 192.168.13.13/24 dev r1-eth1") + r1.run("ip -6 addr add 2000:1:1:13::13/64 dev r1-eth1") + r1.run("ip addr add 192.168.14.14/24 dev r1-eth2") + r1.run("ip -6 addr add 2000:1:1:14::14/64 dev r1-eth2") + r1.run("ip addr add 1.1.1.1/32 dev lo") + r1.run("ip -6 addr add 2000:1:1:1::1/128 dev lo") + r1.run("ip addr show") + router_list = tgen.routers() # For all registred routers, load the zebra configuration file