From: Lou Berger Date: Mon, 12 Mar 2018 21:17:54 +0000 (-0400) Subject: bgp_vrf_netns: attempt cleanup of previous test abnormal exit. skip test if setup... X-Git-Tag: frr-7.1-dev~151^2~111 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4072a153239485bd851c78f20b5f1e4376547457;p=mirror%2Ffrr.git bgp_vrf_netns: attempt cleanup of previous test abnormal exit. skip test if setup fails Signed-off-by: Lou Berger --- diff --git a/tests/topotests/bgp_vrf_netns/test_bgp_vrf_netns_topo.py b/tests/topotests/bgp_vrf_netns/test_bgp_vrf_netns_topo.py index 58e0857546..780a62e2e9 100755 --- a/tests/topotests/bgp_vrf_netns/test_bgp_vrf_netns_topo.py +++ b/tests/topotests/bgp_vrf_netns/test_bgp_vrf_netns_topo.py @@ -103,13 +103,17 @@ def setup_module(module): # create VRF r1-cust1 # move r1-eth0 to VRF r1-cust1 - cmds = ['ip netns add {0}-cust1', + cmds = ['if [ -e /var/run/netns/{0}-cust1 ] ; then ip netns del {0}-cust1 ; fi', + 'ip netns add {0}-cust1', 'ip link set dev {0}-eth0 netns {0}-cust1', 'ip netns exec {0}-cust1 ifconfig {0}-eth0 up'] for cmd in cmds: + cmd = cmd.format('r1') + logger.info('cmd: '+cmd); output = router.run(cmd.format('r1')) if output != None and len(output) > 0: - logger.info('unexpected output: cmd="{}" output=\n{}'.format(cmd, output)) + logger.info('Aborting due to unexpected output: cmd="{}" output=\n{}'.format(cmd, output)) + return pytest.skip('Skipping BGP VRF NETNS Test. Unexpected output to command: '+cmd) #run daemons router.load_config( TopoRouter.RD_ZEBRA,