File tree Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 64
64
export SDE=`pwd`
65
65
export SDE_INSTALL="`pwd`/install"
66
66
67
- sudo ${SDE_INSTALL}/bin/veth_setup.sh 128
68
- ./run_tofino_model.sh -p tna_counter --arch tofino -q |& sed 's/^/model: /' &
69
- ./run_switchd.sh -p tna_counter --arch tofino |& sed 's/^/switchd: /' &
70
- timeout 10800 ./run_p4_tests.sh -p tna_counter --arch tofino |& sed 's/^/tests: /'
67
+ # Exit on error and ensure pipelines fail on any command failure
68
+ ./ci/run-test.sh tna_counter
71
69
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ THIS_DIR=$( cd -- " $( dirname -- " ${0} " ) " & > /dev/null && pwd )
4
+ ROOT_DIR=$( readlink -f ${THIS_DIR} /..)
5
+
6
+ set -e # Exit on any command failure.
7
+ set -o pipefail # Ensure failure in pipes propagates.
8
+
9
+ if [ $# -ne 1 ]; then
10
+ echo " Usage: $0 <P4_PROGRAM>"
11
+ exit 1
12
+ fi
13
+
14
+ P4_PROGRAM=" $1 "
15
+
16
+ sudo " ${SDE_INSTALL} /bin/veth_setup.sh" 128
17
+ $ROOT_DIR /run_tofino_model.sh -p " $P4_PROGRAM " --arch tofino -q | & sed ' s/^/model: /' &
18
+ MODEL_PID=$!
19
+ $ROOT_DIR /run_switchd.sh -p " $P4_PROGRAM " --arch tofino | & sed ' s/^/switchd: /' &
20
+ SWITCHD_PID=$!
21
+ timeout 10800 $ROOT_DIR /run_p4_tests.sh -p " $P4_PROGRAM " --arch tofino | & sed ' s/^/tests: /'
22
+ TESTS_EXIT_CODE=$?
23
+
24
+ echo " Stopping tofino model and switchd..."
25
+ kill $MODEL_PID $SWITCHD_PID || true
26
+ wait $MODEL_PID 2> /dev/null || true
27
+ wait $SWITCHD_PID 2> /dev/null || true
28
+ exit $TESTS_EXIT_CODE
You can’t perform that action at this time.
0 commit comments