Run BCC test suite with github actions
With this commit, pushes to branches can trigger tests directly on
Github Actions.
Here it will be able to test against kernel 4.14 and 5.0.0, which correspond
to the latest Ubuntu LTS kernel releases.
Tests are run for both Debug and Release modes.
Tests run inside docker, in an ubuntu 19.04 container base.
For the github workflow:
- The test_libbcc suite is run first, to potentially fail fast on these faster
unit tests.
- The Python test suite is run
Some of these tests are allowed to fail, but the failure is still reported:
- In catch2 tests, using the [!mayfail] tag, where this will be displayed in
the test summary
- In Python unittests, using the `@mayFail("Reason")` decorator, which is
introduce for consistency with catch2. These will report the reason for the
failure, and log this to an artifact of the test.
diff --git a/examples/networking/simulation.py b/examples/networking/simulation.py
index b7b5ed2..794a4f8 100644
--- a/examples/networking/simulation.py
+++ b/examples/networking/simulation.py
@@ -40,7 +40,10 @@
"net.ipv6.conf.default.disable_ipv6=1"]
nsp = NSPopen(ns_ipdb.nl.netns, cmd1)
nsp.wait(); nsp.release()
- ns_ipdb.interfaces.lo.up().commit()
+ try:
+ ns_ipdb.interfaces.lo.up().commit()
+ except pyroute2.ipdb.exceptions.CommitException:
+ print("Warning, commit for lo failed, operstate may be unknown")
if in_ifc:
in_ifname = in_ifc.ifname
with in_ifc as v:
@@ -65,17 +68,19 @@
raise
if out_ifc: out_ifc.up().commit()
-
- # this is a workaround for fc31 and possible other disto's.
- # when interface 'lo' is already up, do another 'up().commit()'
- # has issues in fc31.
- # the workaround may become permanent if we upgrade pyroute2
- # in all machines.
- if 'state' in ns_ipdb.interfaces.lo.keys():
- if ns_ipdb.interfaces.lo['state'] != 'up':
+ try:
+ # this is a workaround for fc31 and possible other disto's.
+ # when interface 'lo' is already up, do another 'up().commit()'
+ # has issues in fc31.
+ # the workaround may become permanent if we upgrade pyroute2
+ # in all machines.
+ if 'state' in ns_ipdb.interfaces.lo.keys():
+ if ns_ipdb.interfaces.lo['state'] != 'up':
+ ns_ipdb.interfaces.lo.up().commit()
+ else:
ns_ipdb.interfaces.lo.up().commit()
- else:
- ns_ipdb.interfaces.lo.up().commit()
+ except pyroute2.ipdb.exceptions.CommitException:
+ print("Warning, commit for lo failed, operstate may be unknown")
ns_ipdb.initdb()
in_ifc = ns_ipdb.interfaces[in_ifname]
with in_ifc as v: