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.
This commit is contained in:
lantz
2023-04-24 19:20:25 -07:00
committed by GitHub
parent 4cfe97ee49
commit a2cb3e4051
5 changed files with 24 additions and 31 deletions
+11 -21
View File
@@ -9,48 +9,38 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
include: os: [ubuntu-22.04, ubuntu-20.04]
- os: ubuntu-22.04 py: [python3, python2]
python-version: 3.x
- os: ubuntu-20.04
python-version: 3.x
- os: ubuntu-20.04
python-version: 2.x
steps: steps:
- name: Check out Mininet source - name: Check out Mininet source
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} - name: Install Python ${{ matrix.py }}
uses: actions/setup-python@v2 run: sudo apt install ${{ matrix.py }}
with:
python-version: ${{ matrix.python-version }}
- name: Install Mininet and base dependencies - name: Install Mininet and base dependencies
run: | run: |
sudo apt-get update -qq sudo apt-get update -qq
# This seems too slow unfortunately: # This seems too slow unfortunately:
# sudo apt-get upgrade -y -qq # sudo apt-get upgrade -y -qq
PYTHON=`which python` util/install.sh -nv PYTHON=${{ matrix.py }} util/install.sh -nv
- name: Sanity test - name: Sanity test
run: | run: |
export sudo="sudo env PATH=$PATH" export sudo="sudo env PATH=$PATH"
# Verify major python-version number matches python and mininet export PYTHON=${{ matrix.py }}
export PYVER=`echo ${{ matrix.python-version }} | cut -d . -f 1`
export CHKVER='px import platform; print(platform.python_version())'
python --version |& grep " $PYVER\."
echo $CHKVER | $sudo mn -v output | grep " $PYVER\."
# Newer OvS tries OpenFlow15 which crashes ovsc on ubuntu-20.04 # Newer OvS tries OpenFlow15 which crashes ovsc on ubuntu-20.04
$sudo mn --switch ovs,protocols=OpenFlow13 --test pingall $sudo mn --switch ovs,protocols=OpenFlow13 --test pingall
- name: Install test dependencies - name: Install test dependencies
run: | run: |
sudo apt-get install -qq vlan sudo apt-get install -qq vlan
pip install pexpect export PYTHON=${{ matrix.py }}
sudo $PYTHON -m pip install pexpect
util/install.sh -fw util/install.sh -fw
- name: Run core tests - name: Run core tests
run: | run: |
export sudo="sudo env PATH=$PATH" export sudo="sudo env PATH=$PATH"
export PYTHON=`which python` export PYTHON=${{ matrix.py }}
$sudo $PYTHON mininet/test/runner.py -v $sudo $PYTHON mininet/test/runner.py -v
- name: Run examples tests (quick) - name: Run examples tests (quick)
run: | run: |
export sudo="sudo env PATH=$PATH" export sudo="sudo env PATH=$PATH"
export PYTHON=`which python` export PYTHON=${{ matrix.py }}
$sudo $PYTHON examples/test/runner.py -v -quick $sudo $PYTHON examples/test/runner.py -v -quick
+1 -1
View File
@@ -2,7 +2,7 @@
Mininet Installation/Configuration Notes Mininet Installation/Configuration Notes
---------------------------------------- ----------------------------------------
Mininet 2.3.1b1 Mininet 2.3.1b2
--- ---
The supported installation methods for Mininet are 1) using a The supported installation methods for Mininet are 1) using a
+5 -3
View File
@@ -2,7 +2,7 @@ Mininet: Rapid Prototyping for Software Defined Networks
======================================================== ========================================================
*The best way to emulate almost any network on your laptop!* *The best way to emulate almost any network on your laptop!*
Mininet 2.3.1b1 Mininet 2.3.1b2
[![Build Status][1]](https://github.com/mininet/mininet/actions) [![Build Status][1]](https://github.com/mininet/mininet/actions)
@@ -70,7 +70,7 @@ Mininet includes:
### Python 3 Support ### Python 3 Support
- Mininet 2.3.1b1 supports Python 3 and Python 2! - Mininet 2.3.1b2 supports Python 3 and Python 2
- You can install both the Python 3 and Python 2 versions of - You can install both the Python 3 and Python 2 versions of
Mininet side by side, but the most recent installation will Mininet side by side, but the most recent installation will
@@ -87,10 +87,12 @@ determine which Python version is used by default by `mn`.
### Other Enhancements and Information ### Other Enhancements and Information
- Support for Ubuntu 20.04 LTS (and 18.04) - Support for Ubuntu 22.04 LTS (and 20.04)
- More reliable testing and CI via github actions - More reliable testing and CI via github actions
- Preliminary support for cgroups v2 (and v1)
- Minor bug fixes (2.3.1) - Minor bug fixes (2.3.1)
- Additional information about this release and previous releases - Additional information about this release and previous releases
+1 -1
View File
@@ -109,7 +109,7 @@ from mininet.util import ( quietRun, fixLimits, numCores, ensureRoot,
from mininet.term import cleanUpScreens, makeTerms from mininet.term import cleanUpScreens, makeTerms
# Mininet version: should be consistent with README and LICENSE # Mininet version: should be consistent with README and LICENSE
VERSION = "2.3.1b1" VERSION = "2.3.1b2"
class Mininet( object ): class Mininet( object ):
"Network emulation with hosts spawned in network namespaces." "Network emulation with hosts spawned in network namespaces."
+6 -5
View File
@@ -165,7 +165,7 @@ function mn_deps {
$install gcc make socat psmisc xterm openssh-clients iperf \ $install gcc make socat psmisc xterm openssh-clients iperf \
iproute telnet python-setuptools libcgroup-tools \ iproute telnet python-setuptools libcgroup-tools \
ethtool help2man net-tools ethtool help2man net-tools
$install ${PYPKG}-pyflakes pylint ${PYPKG}-pep8-naming \ $install ${PYPKG}-pyflakes pylint ${PYPKG}-pep8-naming
${PYPKG}-pexpect ${PYPKG}-pexpect
elif [ "$DIST" = "SUSE LINUX" ]; then elif [ "$DIST" = "SUSE LINUX" ]; then
$install gcc make socat psmisc xterm openssh iperf \ $install gcc make socat psmisc xterm openssh iperf \
@@ -190,19 +190,20 @@ function mn_deps {
$install gcc make socat psmisc xterm ssh iperf telnet \ $install gcc make socat psmisc xterm ssh iperf telnet \
ethtool help2man $pf pylint $pep8 \ ethtool help2man $pf pylint $pep8 \
net-tools \ net-tools ${PYPKG}-tk
${PYPKG}-pexpect ${PYPKG}-tk
# Install pip # Install pip
$install ${PYPKG}-pip || $install ${PYPKG}-pip-whl $install ${PYPKG}-pip || $install ${PYPKG}-pip-whl
if ! ${PYTHON} -m pip -V; then if ! ${PYTHON} -m pip -V; then
if [ $PYTHON_VERSION == 2 ]; then if [ $PYTHON_VERSION == 2 ]; then
wget https://bootstrap.pypa.io/pip/2.6/get-pip.py wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
else else
wget https://bootstrap.pypa.io/get-pip.py wget https://bootstrap.pypa.io/get-pip.py
fi fi
sudo ${PYTHON} get-pip.py sudo ${PYTHON} get-pip.py
rm get-pip.py rm get-pip.py
fi fi
${python} -m pip install pexpect
$install iproute2 || $install iproute $install iproute2 || $install iproute
$install cgroup-tools || $install cgroup-bin $install cgroup-tools || $install cgroup-bin
$install cgroupfs-mount $install cgroupfs-mount
@@ -221,7 +222,7 @@ function mn_doc {
if ! $install doxygen-latex; then if ! $install doxygen-latex; then
echo "doxygen-latex not needed" echo "doxygen-latex not needed"
fi fi
sudo pip install doxypy sudo pip2 install doxypy
} }
# The following will cause a full OF install, covering: # The following will cause a full OF install, covering: