systemd-udevd appears to drastically increase
Mininet startup time.
With systemd-udevd disabled,
mn --topo single,100 --test none
takes 8s rather than 40s (31s with NM_UNMANAGED) on
my test VM.
We need a way of disabling it globally and always for
Mininet interfaces, but this is a start for github
actions at least.
For now, we execute this command before running the CI tests:
systemctl stop systemd-udevd systemd-udevd-kernel.socket \
systemd-udevd-control.socket
We also restore the "slow" examples tests, including
test_tree1024.
The list is specified as a string, but when it was
split across lines spaces were not properly added.
Probably it should actually be a list to make it more
robust to adding additional process names.
For now we are adding spaces to all of the lines, so
hopefully anyone who updates it will follow the pattern.
This should fix the problem of ovs-testcontroller processes
not being killed.
Thanks to Rwitick Ghosh.
Closes#1164
Support for Ubuntu 22.04 and 20.04.
- Update Mininet version
- Install pexpect with pip to support python 3 and 2
- Update code-check workflow
- refactor to enable testing python 2 on ubuntu 22.04
- update to actions/checkout@v3 (@v2 is deprecated)
errata:
mountCgroups has not actually been renamed, but has been
changed to use cgroupfs-mount and to return the cgroups version.
util.py: replace mountCgroups with checkCgroups, which
returns the cgroup version (cgroup, cgroup2)
node.py: handle cpu.max='quota period' for cgroup2
vs. cpu.{cfs_quota_us,cfs_period_us} for cgroup
net.py: make _iperfVals more robust in the case of a missing
UDP ACK
examples/cpu.py: user _iperfVals to handle new iperf behavior
of no output from telnet
+ identify client and server (different on Ubuntu 20 vs. 22)
+ add util.{unitScale,fmtBps} to help with output format
- internal function _parseIperfOutput has been removed
1. update/fix codecheck
Run workflow with pylint 2.15.7
Add a bunch of fiddly and mostly cosmetic changes to
make pylint (and make codecheck) happy.
Also try to run pyflakes3 vs. pyflakes
2. remove Ubuntu 18.04
Ubuntu 18.04 has been removed from github actions, so
we remove it from our workflow as well
Approved by the copyright holders.
The historical "OpenFlow" license was adopted for harmony
with the OpenFlow project and associated software. Mininet
has always been BSD-licensed, but we're adopting the standard
license text that is recommended/approved by OSI and
automatically recognized by github.
GitHub seems to have pulled the plug on 16.04 VMs for
Actions, and this is breaking our integration.
Ideally we should come up with another test method
for 16.04 (notably the 16.04 kernel) as well as
other distros that Actions doesn't support
directly such as Debian.
Background: In Mininet 2.2, waitConnected() waits forever
by default. We are going to preserve this behavior for 2.3.
Therefore, the --wait/-w option will wait forever. This is used
in the tests to make sure that all switches have connected to
their controllers.
A new --twait/-t <int> option has been added for timed waits.
The API for Mininet(....waitConnected=False/True) is preserved,
but you can now pass in an integer wait time. False means
do not wait at all. True means wait forever. I have elected
for now to preserve None also meaning wait forever as it was
in 2.2, but note that you should probably use the boolean
True/False instead.
- use decode() for python 3 compatibility
- try to identify non-loopback interface for controllers
-- avoid hardwired 'eth0'
- use remoteServer consistently in tests
- pass tests on ubuntu 20/python 3
- pass hybrid test with hybrid python 2 and python 3 mininet
* Force reinstall on 'make install'
This allows you to install a modified version with 'make install'.
* Simplify RyuController and update for current Ryu
Notes:
The Ryu() constructor has changed slightly. We still add
`--ofp-tcp-listen-port %s` to the end of `cargs` to make
Controller() happy.
`command` is now `ryu run` so it includes the `run` command
but can be specified explicitly as needed.
You should be able to run Ryu's simple_switch by using:
mn --controller ryu
and pass alternate modules such as simple_switch_13:
mn --controller ryu,ryu.app.simple_switch_13
Unfortunately simple_switch_stp seems like it may be broken
for Python 3.8, which is too bad because we'd like to test
the Torus topo with it.
* rc.local: /usr/bin/bash -> /bin/bash
bash is (and should be) located in /bin
this may have caused ubuntu 18.04 to not execute
/etc/rc.local and regenerate ssh keys
* fix bootAndRun()
This helps with virtualenv although it can open
up another security hole if you end up using an
unexpected python interpreter.
Overall it seems to make sense to err on the side
of usability but it's good to be aware of security.
However, for the remaining utility scripts that require
python 2, we explicitly note this with #!/usr/bin/python2.
This means that 'mn' will run be default in python3.
For python2, run
sudo python2 `which mn`
Also:
- change mn execution line to /usr/bin/python
(install seems to change it to python2 or python3)
- don't install python-is-python3 package
In certain cases, dp0 and its interfaces were not
being cleaned up, probably due to scratchnet.py being
killed before it terminated. This in turn caused the
natnet test to fail.
Ubuntu 20.04 fixes:
- fixes sshd test
- speeds up examples/{treeping64,tree1024}.py
- debugging hacks/output for testLinkChange
- removes cfs from examples/popen.py
- improves nat in nodelib (netplan fixes?)
- makes some tests executable
- waits for switches to connect in tests to
avoid race conditions
-- adds mn -w option and wait CLI command
Changes:
- REMOVES default "-v" argument for Controller()
and adds verbose(=False) option; avoiding logging
makes it faster
- CHANGES waitConnected to wait for 5 seconds
as documented; we may wish to implement an argument
to -w to set this timeout
Issues?
- There may still be an issue with the ovs-netplan-clean
service causing the boot to hang ;-(
Ubuntu 16.04 no longer includes a 'python' executable.
If none of {$PYTHON,python,python2,python3} are usable, we advise
the user to either set PYTHON or install a usable python.
Previously we looked for 'eth0', but linux has renamed interfaces.
Instead of looking by name, we now look for an interface which
is the appropriate gateway to a remote server address.
fixes#831