Update for python 2.x and 3.x builds (#988)
This commit is contained in:
@@ -1,35 +1,58 @@
|
||||
|
||||
name: mininet tests
|
||||
name: mininet-tests
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Mininet-tests
|
||||
name: Mininet Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-18.04, ubuntu-16.04]
|
||||
python-version: [3.x, 2.x]
|
||||
steps:
|
||||
- name: Checking out Mininet source
|
||||
- name: Check out Mininet source
|
||||
uses: actions/checkout@v2
|
||||
- name: Installing dependencies
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install Mininet and base dependencies
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -qq vlan
|
||||
PYTHON=`which python` util/install.sh -n
|
||||
pip install pexpect || pip3 install pexpect
|
||||
- name: Code Check
|
||||
# This seems too slow unfortunately:
|
||||
# sudo apt-get upgrade -y -qq
|
||||
PYTHON=`which python` util/install.sh -nv
|
||||
- name: Run code check (skipping for now)
|
||||
run: |
|
||||
bash -c "if [ `lsb_release -rs` == '14.04' ]; then make codecheck; fi"
|
||||
- name: Install
|
||||
- name: Sanity test
|
||||
run: |
|
||||
util/install.sh -fvw
|
||||
- name: Building and running tests
|
||||
export sudo="sudo env PATH=$PATH"
|
||||
# Verify major python-version number matches python and mininet
|
||||
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
|
||||
$sudo mn --switch ovs,protocols=OpenFlow13 --test pingall
|
||||
- name: Install test dependencies
|
||||
run: |
|
||||
alias sudo="sudo env PATH=$PATH"
|
||||
sudo apt-get install -qq vlan
|
||||
pip install pexpect
|
||||
util/install.sh -fw
|
||||
- name: Run tests (quick)
|
||||
run: |
|
||||
export sudo="sudo env PATH=$PATH"
|
||||
export PYTHON=`which python`
|
||||
echo 'px import sys; print(sys.version_info)' | sudo $PYTHON bin/mn -v output
|
||||
sudo $PYTHON bin/mn --test pingall
|
||||
sudo $PYTHON mininet/test/runner.py -v -quick
|
||||
sudo $PYTHON examples/test/runner.py -v -quick
|
||||
rm -f pexpect.out
|
||||
$sudo $PYTHON mininet/test/runner.py -v -quick || \
|
||||
(cat pexpect.out && exit 1)
|
||||
- name: Run examples tests (quick)
|
||||
run: |
|
||||
export sudo="sudo env PATH=$PATH"
|
||||
export PYTHON=`which python`
|
||||
rm -f pexpect.out
|
||||
$sudo $PYTHON examples/test/runner.py -v -quick || \
|
||||
(cat pexpect.out && exit 1)
|
||||
|
||||
Reference in New Issue
Block a user