- 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
pmonitor() is hard to get right, but this seems like
a reasonable improvement:
1. non-blocking I/O so we can drain buffer with impunity
2. drain buffer after poll
3. unregister fd on POLLHUP
Note we may have a unicode splitting problem since we're
decoding chunks of bytes, but that is a problem for another
day I think.
Changes for compatibility with Python 3.
The approach is to make as few changes as possible to maintain compatibility with both Python 2 and Python 3.
We use whatever python is installed, and also support a PYTHON environment variable for installing another version.
For simplicity, we provide mininet.util.pexpect which works out of the box with Python 3 utf-8 strings.
Thanks to @cuihantao for looking at this as well and also for changes to MiniEdit.
Closes#794