From e82e64deeeaf555c902650c2f30c7aff6a9e8402 Mon Sep 17 00:00:00 2001 From: Brad Cowie Date: Thu, 23 Aug 2018 19:35:39 +1200 Subject: [PATCH] Set locale to keep python read() happy. --- docker/runtests.sh | 2 +- travis/run-integration-tests.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100755 travis/run-integration-tests.sh diff --git a/docker/runtests.sh b/docker/runtests.sh index f2a64b755f..8b7e397780 100755 --- a/docker/runtests.sh +++ b/docker/runtests.sh @@ -57,7 +57,7 @@ locale-gen en_US.UTF-8 || exit 1 if [ "$UNITTESTS" == 1 ] ; then echo "========== Running faucet unit tests ==========" cd /faucet-src/tests - ./run_unit_tests.sh || exit 1 + LANG=en_US.UTF-8 LANGUAGE=en_US.en LC_ALL=en_US.UTF-8 ./run_unit_tests.sh || exit 1 fi if [ "$DEPCHECK" == 1 ] ; then diff --git a/travis/run-integration-tests.sh b/travis/run-integration-tests.sh new file mode 100755 index 0000000000..fe9d61fdd7 --- /dev/null +++ b/travis/run-integration-tests.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +if [ "${MATRIX_SHARD}" = "sanity" ] ; then + FAUCET_TESTS="-u FaucetSanityTest" + ./tests/run_unit_tests.sh || exit 1 + codecov || true +else + ALLTESTFILES="tests/integration/mininet_tests.py clib/clib_mininet_tests.py" + ALLTESTS=`grep -E -o "^class (Faucet[a-zA-Z0-9]+Test)" ${ALLTESTFILES}|cut -f2 -d" "|sort` + declare -A sharded + + function shard { + work=$1 + workers=$2 + i=0 + for shard in $work ; do + i=$(expr $i % $workers) + sharded[$i]="${sharded[$i]} $shard" + i=$(expr $i + 1) + done + } + + shard "$ALLTESTS" ${MATRIX_SHARDS} + FAUCET_TESTS="-i ${sharded[${MATRIX_SHARD}]}" +fi + +echo Shard $MATRIX_SHARD: $FAUCETTESTS +sudo docker run --privileged --sysctl net.ipv6.conf.all.disable_ipv6=0 \ + -v $HOME/.cache/pip:/var/tmp/pip-cache \ + -e FAUCET_TESTS="${FAUCET_TESTS}" \ + -t ${FAUCET_TEST_IMG} || exit 1 +exit 0