#!/bin/bash
echo "========== Starting OVS ========================="
service openvswitch-switch start

ovs-vsctl show || exit 1

cd /faucet-src/tests

echo "========== Running faucet unit tests =========="
py.test ./test_check_config.py ./test_config.py ./test_valve.py --cov faucet --doctest-modules -v --cov-report term-missing

echo "============ Running pytype analyzer ============"
# TODO: pytype doesn't completely understand py3 yet.
ls -1 ../faucet/*py | parallel --bar pytype -d import-error || exit 1

echo "========== Running faucet system tests =========="
python2 ./faucet_mininet_test.py -c
time python2 ./faucet_mininet_test.py $FAUCET_TESTS || exit 1

#!/bin/bash
echo "========== Starting OVS ========================="
service openvswitch-switch start

ovs-vsctl show || exit 1

# enable fast reuse of ports.
sysctl -w net.netfilter.nf_conntrack_tcp_timeout_time_wait=5

cd /faucet-src/tests

echo "========== Running faucet unit tests =========="
py.test ./test_check_config.py ./test_config.py ./test_valve.py --cov faucet --doctest-modules -v --cov-report term-missing

echo "============ Running pytype analyzer ============"
# TODO: pytype doesn't completely understand py3 yet.
ls -1 ../faucet/*py | parallel --bar pytype -d import-error || exit 1

echo "========== Running faucet system tests =========="
python2 ./faucet_mininet_test.py -c
time python2 ./faucet_mininet_test.py $FAUCET_TESTS || exit 1

Enable fast reuse of ports (tests can flake because of port in TIME_WAIT state).
Enable fast reuse of ports (tests can flake because of port in TIME_WAIT state).
