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]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Mininet-tests
|
name: Mininet Tests
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04, ubuntu-16.04]
|
os: [ubuntu-18.04, ubuntu-16.04]
|
||||||
|
python-version: [3.x, 2.x]
|
||||||
steps:
|
steps:
|
||||||
- name: Checking out Mininet source
|
- name: Check out Mininet source
|
||||||
uses: actions/checkout@v2
|
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: |
|
run: |
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install -qq vlan
|
# This seems too slow unfortunately:
|
||||||
PYTHON=`which python` util/install.sh -n
|
# sudo apt-get upgrade -y -qq
|
||||||
pip install pexpect || pip3 install pexpect
|
PYTHON=`which python` util/install.sh -nv
|
||||||
- name: Code Check
|
- name: Run code check (skipping for now)
|
||||||
run: |
|
run: |
|
||||||
bash -c "if [ `lsb_release -rs` == '14.04' ]; then make codecheck; fi"
|
bash -c "if [ `lsb_release -rs` == '14.04' ]; then make codecheck; fi"
|
||||||
- name: Install
|
- name: Sanity test
|
||||||
run: |
|
run: |
|
||||||
util/install.sh -fvw
|
export sudo="sudo env PATH=$PATH"
|
||||||
- name: Building and running tests
|
# 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: |
|
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`
|
export PYTHON=`which python`
|
||||||
echo 'px import sys; print(sys.version_info)' | sudo $PYTHON bin/mn -v output
|
rm -f pexpect.out
|
||||||
sudo $PYTHON bin/mn --test pingall
|
$sudo $PYTHON mininet/test/runner.py -v -quick || \
|
||||||
sudo $PYTHON mininet/test/runner.py -v -quick
|
(cat pexpect.out && exit 1)
|
||||||
sudo $PYTHON examples/test/runner.py -v -quick
|
- 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