mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-09 16:20:32 +00:00
Merge pull request #15059 from donaldsharp/generate_support_bundle_on_test_failure
Generate support bundle on test failure
This commit is contained in:
commit
eba1c1e23b
@ -58,7 +58,6 @@ from lib.common_config import (
|
|||||||
step,
|
step,
|
||||||
write_test_header,
|
write_test_header,
|
||||||
write_test_footer,
|
write_test_footer,
|
||||||
generate_support_bundle,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Required to instantiate the topology builder class.
|
# Required to instantiate the topology builder class.
|
||||||
@ -277,8 +276,6 @@ def test_evpn_gateway_ip_basic_topo(request):
|
|||||||
|
|
||||||
result, assertmsg = evpn_gateway_ip_show_op_check("base")
|
result, assertmsg = evpn_gateway_ip_show_op_check("base")
|
||||||
|
|
||||||
if result is not None:
|
|
||||||
generate_support_bundle()
|
|
||||||
assert result is None, assertmsg
|
assert result is None, assertmsg
|
||||||
|
|
||||||
write_test_footer(tc_name)
|
write_test_footer(tc_name)
|
||||||
@ -319,8 +316,6 @@ def test_evpn_gateway_ip_flap_rt5(request):
|
|||||||
)
|
)
|
||||||
|
|
||||||
result, assertmsg = evpn_gateway_ip_show_op_check("no_rt5")
|
result, assertmsg = evpn_gateway_ip_show_op_check("no_rt5")
|
||||||
if result is not None:
|
|
||||||
generate_support_bundle()
|
|
||||||
assert result is None, assertmsg
|
assert result is None, assertmsg
|
||||||
|
|
||||||
step("Advertise type-5 routes again")
|
step("Advertise type-5 routes again")
|
||||||
@ -339,8 +334,6 @@ def test_evpn_gateway_ip_flap_rt5(request):
|
|||||||
)
|
)
|
||||||
|
|
||||||
result, assertmsg = evpn_gateway_ip_show_op_check("base")
|
result, assertmsg = evpn_gateway_ip_show_op_check("base")
|
||||||
if result is not None:
|
|
||||||
generate_support_bundle()
|
|
||||||
|
|
||||||
assert result is None, assertmsg
|
assert result is None, assertmsg
|
||||||
|
|
||||||
@ -371,8 +364,6 @@ def test_evpn_gateway_ip_flap_rt2(request):
|
|||||||
pe1.cmd_raises("ip link set dev vxlan100 down")
|
pe1.cmd_raises("ip link set dev vxlan100 down")
|
||||||
|
|
||||||
result, assertmsg = evpn_gateway_ip_show_op_check("no_rt2")
|
result, assertmsg = evpn_gateway_ip_show_op_check("no_rt2")
|
||||||
if result is not None:
|
|
||||||
generate_support_bundle()
|
|
||||||
assert result is None, assertmsg
|
assert result is None, assertmsg
|
||||||
|
|
||||||
step("Bring up VxLAN interface at PE1 and advertise type-2 routes again")
|
step("Bring up VxLAN interface at PE1 and advertise type-2 routes again")
|
||||||
@ -380,8 +371,6 @@ def test_evpn_gateway_ip_flap_rt2(request):
|
|||||||
pe1.cmd_raises("ip link set dev vxlan100 up")
|
pe1.cmd_raises("ip link set dev vxlan100 up")
|
||||||
|
|
||||||
result, assertmsg = evpn_gateway_ip_show_op_check("base")
|
result, assertmsg = evpn_gateway_ip_show_op_check("base")
|
||||||
if result is not None:
|
|
||||||
generate_support_bundle()
|
|
||||||
assert result is None, assertmsg
|
assert result is None, assertmsg
|
||||||
|
|
||||||
write_test_footer(tc_name)
|
write_test_footer(tc_name)
|
||||||
|
@ -51,7 +51,6 @@ sys.path.append(os.path.join(CWD, "../"))
|
|||||||
from lib import topotest
|
from lib import topotest
|
||||||
from lib.topogen import Topogen, TopoRouter, get_topogen
|
from lib.topogen import Topogen, TopoRouter, get_topogen
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
from lib.common_config import generate_support_bundle
|
|
||||||
|
|
||||||
# Required to instantiate the topology builder class.
|
# Required to instantiate the topology builder class.
|
||||||
|
|
||||||
@ -140,10 +139,7 @@ def test_bgp_convergence():
|
|||||||
)
|
)
|
||||||
_, res = topotest.run_and_expect(test_func, None, count=210, wait=1)
|
_, res = topotest.run_and_expect(test_func, None, count=210, wait=1)
|
||||||
assertmsg = "BGP router network did not converge"
|
assertmsg = "BGP router network did not converge"
|
||||||
if res is not None:
|
|
||||||
generate_support_bundle()
|
|
||||||
assert res is None, assertmsg
|
assert res is None, assertmsg
|
||||||
generate_support_bundle()
|
|
||||||
|
|
||||||
|
|
||||||
def test_bgp_flowspec():
|
def test_bgp_flowspec():
|
||||||
|
@ -26,7 +26,7 @@ from munet.base import Commander, proc_error
|
|||||||
from munet.cleanup import cleanup_current, cleanup_previous
|
from munet.cleanup import cleanup_current, cleanup_previous
|
||||||
from munet.config import ConfigOptionsProxy
|
from munet.config import ConfigOptionsProxy
|
||||||
from munet.testing.util import pause_test
|
from munet.testing.util import pause_test
|
||||||
|
from lib.common_config import generate_support_bundle
|
||||||
from lib import topolog, topotest
|
from lib import topolog, topotest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -600,6 +600,10 @@ def pytest_runtest_setup(item):
|
|||||||
os.environ["PYTEST_TOPOTEST_SCRIPTDIR"] = script_dir
|
os.environ["PYTEST_TOPOTEST_SCRIPTDIR"] = script_dir
|
||||||
|
|
||||||
|
|
||||||
|
def pytest_exception_interact(node, call, report):
|
||||||
|
generate_support_bundle()
|
||||||
|
|
||||||
|
|
||||||
def pytest_runtest_makereport(item, call):
|
def pytest_runtest_makereport(item, call):
|
||||||
"Log all assert messages to default logger with error level"
|
"Log all assert messages to default logger with error level"
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ class SnmpTester(object):
|
|||||||
notif = re.sub(":", "", notif)
|
notif = re.sub(":", "", notif)
|
||||||
notif = re.sub('"([0-9]{2}) ([0-9]{2}) "', r"\1\2", notif)
|
notif = re.sub('"([0-9]{2}) ([0-9]{2}) "', r"\1\2", notif)
|
||||||
notif = re.sub('"([0-9]{2}) "', r"\1", notif)
|
notif = re.sub('"([0-9]{2}) "', r"\1", notif)
|
||||||
elems = re.findall("([0-9,\.]+) = ([0-9,\.]+)", notif)
|
elems = re.findall(r"([0-9,\.]+) = ([0-9,\.]+)", notif)
|
||||||
|
|
||||||
# remove common part
|
# remove common part
|
||||||
elems = elems[1:]
|
elems = elems[1:]
|
||||||
@ -222,7 +222,7 @@ class SnmpTester(object):
|
|||||||
# don't consider additional application messages
|
# don't consider additional application messages
|
||||||
notifs = [elem for index, elem in enumerate(notifs_first) if index % 2 != 0]
|
notifs = [elem for index, elem in enumerate(notifs_first) if index % 2 != 0]
|
||||||
|
|
||||||
oid_v4 = "1\.3\.6\.1\.2\.1\.15"
|
oid_v4 = r"1\.3\.6\.1\.2\.1\.15"
|
||||||
for one_notif in notifs:
|
for one_notif in notifs:
|
||||||
is_ipv4_notif = re.search(oid_v4, one_notif)
|
is_ipv4_notif = re.search(oid_v4, one_notif)
|
||||||
if is_ipv4_notif != None:
|
if is_ipv4_notif != None:
|
||||||
@ -241,7 +241,7 @@ class SnmpTester(object):
|
|||||||
# don't consider additional application messages
|
# don't consider additional application messages
|
||||||
notifs = [elem for index, elem in enumerate(results) if index % 2 != 0]
|
notifs = [elem for index, elem in enumerate(results) if index % 2 != 0]
|
||||||
|
|
||||||
oid_v6 = "1\.3\.6\.1\.3\.5\.1"
|
oid_v6 = r"1\.3\.6\.1\.3\.5\.1"
|
||||||
for one_notif in notifs:
|
for one_notif in notifs:
|
||||||
is_ipv6_notif = re.search(oid_v6, one_notif)
|
is_ipv6_notif = re.search(oid_v6, one_notif)
|
||||||
if is_ipv6_notif != None:
|
if is_ipv6_notif != None:
|
||||||
|
@ -34,6 +34,8 @@ show bgp nexthop
|
|||||||
show bgp vrf all summary
|
show bgp vrf all summary
|
||||||
show bgp vrf all ipv4
|
show bgp vrf all ipv4
|
||||||
show bgp vrf all ipv6
|
show bgp vrf all ipv6
|
||||||
|
show bgp vrf all ipv4 vpn
|
||||||
|
show bgp vrf all ipv6 vpn
|
||||||
show bgp vrf all neighbors
|
show bgp vrf all neighbors
|
||||||
|
|
||||||
show bgp evpn route
|
show bgp evpn route
|
||||||
|
Loading…
Reference in New Issue
Block a user