Commit Graph
100 Commits
Author SHA1 Message Date
lantz b762d0bf96 Add cgroup2 support (#1166)
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
2023-04-22 15:31:40 -07:00
lantz 4840bc20c5 remove unused _iperfVals parameter (#1170) 2023-04-22 09:22:08 -07:00
lantz 30a5fd0df4 Use iperf CSV output in Mininet.iperf() (#1165)
+ 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
2023-04-21 20:07:50 -07:00
lantz 4707e90028 Fix comparison error in testWalkthrough.testHostCommands (#1168) 2023-04-21 18:07:53 -07:00
lantz cf5675876c update CI workflows: update/fix codecheck; remove Ubuntu 18.04 (#1167)
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
2023-04-21 17:37:09 -07:00
lantz 1169982c0a Update node.py 2022-11-22 16:43:54 -08:00
lantz 32a7126d2b Update README.md 2022-11-22 16:43:05 -08:00
lantz 678add6202 Update README.md
closes #1143
2022-11-22 16:41:27 -08:00
lantz 936d303f5d Update INSTALL
closes #1144
2022-11-22 16:36:30 -08:00
lantz c5413a74f5 Update miniedit.py
closes #1147
2022-11-22 16:33:52 -08:00
lantz 3f5503d773 Update LICENSE to standard BSD 3-clause license text (#1141)
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.
2022-07-10 19:45:38 -07:00
lantz aa0176fce6 2.3.1b1 (#1124) 2022-03-31 17:58:42 -07:00
lantz 71d3e58d8c Remove ubuntu-16.04 from run-tests.yaml (#1091)
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.
2021-10-14 17:09:34 -07:00
lantz 9edbb3b4a3 Iterate over tuple() when deleting items (#1062)
Fixes #1061
2021-10-07 15:49:03 -07:00
lantz 57294d013e Add symlink from bin/mn to mininet/__main__.py (#1056)
Should allow `python -m mininet` to work.

Closes #1047
2021-03-28 15:54:33 -07:00
lantz 1b55f09c4e Fix mnexec -v (#1053)
We were discarding the version number sent to stderr

fixes #1052
2021-03-13 11:08:02 -08:00
lantz d7f399d7a1 2.3.0 (#1043)
- 2.3.0rc2 -> 2.3.0
- update copyright date in LICENSE
2021-02-10 12:30:36 -08:00
lantz 1c42632978 2.3.0rc2 (#1042) 2021-02-09 11:44:42 -08:00
lantz 5ef6e1dedc fix --twait (#1040)
- pass timeout correctly to waitConnected()
- handle surprising behavior that 1 == True in Python
- mn --test none does not call waitConnected()
2021-02-09 11:26:39 -08:00
lantz f8e54cad47 add pip uninstall -y (#1041)
This avoids hanging in scripts if pip uninstall decides
to ask for confirmation
2021-02-09 10:55:45 -08:00
lantz fc3152d724 Update INSTALL 2021-02-09 00:47:32 -08:00
lantz 9a3a3edf75 2.3.0rc1 (#1037) 2021-02-09 00:44:22 -08:00
lantz 377a4b5af5 Add net-tools dependency for fedora (#1039) 2021-02-09 00:17:34 -08:00
lantz 4a1dbac09b Basic fixes for install.sh -fnv for Fedora 33 (#1038)
Closes #1003
2021-02-08 23:33:40 -08:00
lantz 92fe3cc120 Make mn -w wait indefinitely and add --twait option (#1036)
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.
2021-02-08 23:22:36 -08:00
lantz 39ed456de2 Fixes for cluster.py (#1035)
- 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
2021-02-08 22:28:12 -08:00
lantz 5d4ec1ab9e catch IOError when writing .mininet_history (#1031)
write_history seems to raise a spurious IOError,
so we catch it.
2021-02-07 19:12:38 -08:00
lantz 6b90434b9c Allow reinstall with make install (#1033) 2021-02-07 18:42:29 -08:00
lantz c2fb4d2e8c Fix ryu (#1032)
* 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.
2021-02-07 16:08:45 -08:00
lantz 7b240ce5b8 Minor fixes for miniedit (#1028)
- avoid deleting from collection we're iterating over
- fix variable name misspelling
2021-02-06 23:23:09 -08:00
lantz c7de350a4e update make doc for current doxygen/doxypy (#1027) 2021-02-06 19:42:15 -08:00
lantz 06dae1adc1 fix bootAndRun() (#1024)
* 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()
2021-02-06 15:55:40 -08:00
lantz f0c726a42f Use /usr/bin/env python for virtualenv (#1025)
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.
2021-02-05 07:42:50 -08:00
lantz a882d68a5f Update README.md 2021-01-30 16:42:03 -08:00
lantz 9b69c99f4e Update INSTALL 2021-01-30 16:40:40 -08:00
lantz 904796436d Update README.md 2021-01-30 16:38:36 -08:00
lantz ec2d93d482 2.3.0b2 (#1022)
+ text file updates
2021-01-30 15:41:20 -08:00
lantz dffddc338f Install python3 mn last in install-mininet-vm.sh (#1021)
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
2021-01-29 22:39:19 -08:00
lantz b6ad3a1619 Mininet 2.3.0b1 (#1019)
Also tweak README.md, INSTALL, and CONTRIBUTORS
2021-01-29 16:15:39 -08:00
lantz 96ac94a985 fix session typo
thanks to Vintas Avinash
closes #1011
2021-01-29 15:47:47 -08:00
lantz 715db45b9d more logging fixes (#1018)
- call getLogger( "mininet" ) to set lg properly
- support warning() as well as (deprecated) warn()
- rearrange initialization slightly
2021-01-28 18:48:45 -08:00
lantz e07a29b4e6 fix make develop: --no-binary :all: (#1017) 2021-01-28 16:04:39 -08:00
lantz 2255bc7da3 Fix/clean up setLogLevel (#1016)
Sometimes we got no output with python 3 on ubuntu 20
This simplifies setLogLevel slightly and should work
on python 2 and python 3.
2021-01-27 18:27:22 -08:00
lantz 12f4d5b8ae Fetch older version of get-pip.py for python 2 (#1015)
fixes #1014
2021-01-26 00:18:54 -08:00
lantz f9d5ef3461 remove .travis.yml and travis badge from README.md (#1013)
Thanks to travis.org for the CI support for many years.
2021-01-25 14:56:05 -08:00
lantz dad451bf8f Pass code check with pylint=2.4.4 (#1012) 2021-01-25 14:00:53 -08:00
lantz 77938e0a85 Increase timeout for emulated build (#1009) 2021-01-16 19:21:00 -08:00
lantz e4003290e0 Try to install python2 and python3 mininet (#1008) 2021-01-13 23:24:06 -08:00
lantz 9517f6c197 Build script for 20.04 (#1004)
Should be able to build 16.04, 18.04 and 20.04,
as well as branch builds.
2021-01-13 19:36:18 -08:00
lantz d8c30910cb ubuntu 14 code check fixes so travis can pass (#1006) 2021-01-09 21:15:27 -08:00
lantz 53975940de Test fixes and debugging (#1005)
test_controlnet: log to stdout for now
test_walkthrough: wait for http server connection
2021-01-09 18:53:50 -08:00
lantz 77c473687e Wait for exit to avoid leftover dp0 (#1002)
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.
2021-01-05 17:01:35 -08:00
lantz 0847991030 Install pip for debian/ubuntu (#1001) 2021-01-04 22:14:10 -08:00
lantz 462929b3af Run full core test suite (#1000)
also remove unneeded rm -f pexpect.out since we are not
generating that at the moment
2021-01-04 19:12:43 -08:00
lantz 26c7c70024 use pip for make {install,develop} (#999) 2021-01-04 18:51:54 -08:00
lantz 942745e91f Fix tree1024.py (#995) 2021-01-04 18:35:42 -08:00
lantz dcc39a7b25 Loosen test_intfoptions tolerance to 25% for CI (#998)
Adjusting the tolerance for this test to compensate
for apparent performance variation when running as
part of github actions CI builds/tests.
2021-01-04 18:25:35 -08:00
lantz 6def304585 Remove long tests from travis (#993) 2021-01-04 13:53:30 -08:00
lantz e02e338e3c intfoptions and test adjustments (#992)
* 2.3.0a1

* intfoptions and test_intfoptions tweaks

also added cleanup() to test_walkthrough fixture
2021-01-03 22:24:28 -08:00
lantz b7c412073a CI matrix build + 20.04 fixes (#990)
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 ;-(
2021-01-03 20:00:33 -08:00
lantz afdf9fd571 Update for python 2.x and 3.x builds (#988) 2020-12-19 18:06:52 -08:00
lantz 336b01ae34 Add matrix build for ubuntu-16.04 and ubuntu-18.04 (#987) 2020-12-13 19:14:26 -08:00
lantz cab8970b0a Update run-tests.yaml 2020-12-13 18:13:27 -08:00
lantz 3625149356 Update run-tests.yaml 2020-12-13 18:00:44 -08:00
lantz fd9e011277 Merge pull request #986 from lantz/github-actions
Initial support for github actions CI builds
2020-12-13 17:57:48 -08:00
Bob Lantz 591a961762 Initial support for github actions CI builds 2020-12-13 17:15:11 -08:00
lantz bfc42f6d02 Merge pull request #921 from timgates42/bugfix/typo_updates
Fix simple typo: udpates -> updates
2020-04-15 18:22:28 -07:00
lantz 458d20e3fd Merge pull request #928 from JuFil/master
Fix install.sh on Ubuntu 19.10: substitute cgroup-bin with cgroup-too…
2020-04-15 18:18:06 -07:00
lantz 73b2ecc5fe Merge pull request #934 from ssikdar1/flake8-octal-number-positions
change to use 0o for octal numbers w/ file permissons for python2/3 compatibility
2020-04-15 18:17:19 -07:00
lantz 6a5adb48d2 Merge pull request #938 from JuFil/fix-poll
Fix usage of poll in mininet.utils.errRun
2020-04-15 18:13:39 -07:00
lantz fa9fd770ca Merge pull request #932 from ssikdar1/flake8-F632
change to fix flake8 F632 issues
2020-04-03 19:34:45 -07:00
lantz 2b8d254cc0 Merge pull request #873 from raingloom/patch-1
make it easier to set the compiler
2019-12-01 15:36:48 -08:00
lantz 8fc867b1f4 Merge pull request #897 from jadinm/fix-cli-stdin
Fix CLI constructor: stdin parameter was replaced
2019-12-01 15:34:08 -08:00
lantz c0582b9c5e Merge pull request #895 from jadinm/fix-topo-addLink
Return the new link key in Topo.addLink()
2019-11-29 16:00:38 -08:00
lantz 023c53aec6 Merge pull request #912 from lantz/fix-1604-install
Check for non-functional 'python'
2019-11-29 15:59:55 -08:00
lantz 6c17e1ade7 Update ISSUE_TEMPLATE 2019-11-24 18:11:28 -08:00
Bob Lantz e56f6839f1 Improve Python version detection
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.
2019-11-22 17:14:10 -08:00
Bob Lantz e0436642ae 2.3.0d6 2019-07-11 17:16:46 -07:00
lantz c5f626ce27 Merge pull request #891 from benfrankel/master
Use incremental utf-8 decoder for buffered reading
2019-07-11 17:15:37 -07:00
lantz de28f67a97 Merge pull request #882 from stephanreiter/master
Don't pass 'loss 0' to tc as it will cause an error on newer versions
2019-06-09 15:52:33 -07:00
lantz e203808a20 Merge pull request #872 from dsaucez/patch-2
change isShellBuiltin
2019-04-25 20:16:31 -07:00
lantz c5f23b9f82 Merge pull request #815 from teto/fix_controller
fix "which" calls always returning true
2019-04-16 13:28:47 -07:00
Bob Lantz cfb0a6d3f0 Silence warning for failing to stop ovs-testcontroller 2019-04-09 12:17:35 -07:00
Bob Lantz 664ba39383 NAT warning if IPv4 loopback address in /etc/resolv.conf 2019-04-04 16:40:04 -07:00
Bob Lantz 598d694058 2.3.0d5 2019-03-13 21:56:32 -07:00
Bob Lantz f92e3d3432 2018 -> 2019 2019-03-13 21:52:13 -07:00
lantz ce4f1e0c92 Merge pull request #863 from mininet/devel/fix-tclink
Change Link/TCLink to accept universal parameters
2019-03-06 16:17:31 -08:00
Bob Lantz 31f44e1856 Change Link/TCLink to accept universal parameters
This also enables us to specify IP addresses for both sides
of a TCLink, which enables LinuxRouter to work with TCLink.

fixes #854
fixes #634
2019-03-06 15:01:27 -08:00
lantz 36d2b21187 Merge pull request #852 from gabay/patch/rename_init_to_build
Replaced example topologies __init__ with build
2019-02-06 13:22:44 -08:00
lantz cf6da391fa Merge pull request #847 from yousong/poll-eintr
cli: ignore EINTR caused by SIGWINCH when calling poll()
2018-12-20 11:36:42 -08:00
Bob Lantz fd96de6485 Add iproute back in for older dists 2018-12-07 17:08:41 -08:00
lantz 73f530b569 Merge pull request #841 from gabay/master
replaces isinstance(str) with isinstance(BaseString)
(note we define BaseString as str for python 3)
2018-11-15 06:40:28 -08:00
Bob Lantz b7a6b8137f Fix undefined variable and code check. 2018-10-19 13:38:06 -07:00
lantz d072e531c2 Merge pull request #837 from theojepsen/master
intf.rename() also renames the intf name in the host
2018-10-11 15:51:48 -07:00
Bob Lantz 8139d7d1b4 Better IP address selection for controllers
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
2018-10-11 15:46:57 -07:00
Bob Lantz bfda33544a code check 2018-08-28 18:48:50 -07:00
Bob Lantz 1f4525ed0a Test for Node()/Host() pty leakage 2018-08-28 18:48:45 -07:00
Bob Lantz 1969669f51 pass code check 2018-08-23 13:06:16 -07:00
Bob Lantz c639f342e5 2.3.0d4 2018-08-23 11:43:45 -07:00
Bob Lantz 6e887d0788 Close pty to avoid leak 2018-08-23 11:43:43 -07:00