Commit Graph
2060 Commits
Author SHA1 Message Date
lantz 1b4c7d706d Use /proc/self/fd for open fd list (#1182)
mnexec -c attempts to close all open files except for
standard in/out/error.

Previously we just closed every fd>2, but this seems to take
a long time on docker. So now we read /proc/self/fd to see which
file descriptors are actually in use.
2023-05-02 15:27:27 -07:00
lantz 5e909c6e4f 2.3.1b3 (#1181) 2023-05-02 13:05:56 -07:00
lantz 740acfb350 Unlimit cfs hosts for startup/shutdown config (#1178)
We defer cfs cgroup bandwidth limiting until
CPULimitedHost.configDefault(), and we change
Mininet.stop() to call a new host.unlimit()
method if available.
2023-04-28 18:48:35 -07:00
lantz a978ce9484 Disable udevd to speed up tests; reinstate slow tests (#1177)
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.
2023-04-28 14:44:52 -07:00
lantz 1e546cb73b Fix list of processes to kill in cleanup() (#1173)
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
2023-04-25 17:48:01 -07:00
lantz a2cb3e4051 2.3.1b2 (#1172)
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.
2023-04-24 19:20:25 -07:00
lantz 4cfe97ee49 Add ubuntu 22.04 to CI workflow (#1169)
- run-tests: test ubuntu 22.04 with python 3.x
- install.sh: add cgroupfs-mount to dependencies
2023-04-22 20:08:37 -07:00
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
Max Hausch bdd2f8d87f Transforms the ISSUE_TEMPLATE disclaimer into a comment (#1108) 2022-03-31 17:36:50 -07:00
AndreasAc 1a47699f21 Add support for Debian Bullseye to the setup script (#1118) 2022-03-31 15:13:57 -07:00
Max Hausch 270a6ba333 When eval-ing python expressions, return falsy but not-None values (#1111) 2022-02-24 11:27:34 -08:00
AndreasAc c3ba039a97 Remove unencrypted git protocol use (#1100)
Because Github removes support for unencrypted git protocol in March 2022, URLs in scripts are changed to use https.

See https://github.blog/2021-09-01-improving-git-protocol-security-github/ for details
2022-02-23 17:17:02 -08:00
Ramon Fontesandlantz 8a50d3867c get-pip (#1066)
The URL of get-pip.py has changed to https://bootstrap.pypa.io/pip/2.6/get-pip.py

Co-authored-by: lantz <rlantz@cs.stanford.edu>
2021-11-08 16:30:30 -08:00
SantiagoandSantiago Ruano Rincón d1b0b32c8c Call ping with LANG=C to avoid erros parsing localised ping output (#1090)
Fixes: #1063

Co-authored-by: Santiago Ruano Rincón <santiago.ruano-rincon@imt-atlantique.fr>
2021-10-14 17:58:36 -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
toblu302 bfb6b9f4c4 Fix python3 compability issues in miniedit (#1059) 2021-03-28 14:33:39 -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