Skip to content
Snippets Groups Projects
Commit b91cdd1f authored by Anh Nguyen-Tuong's avatar Anh Nguyen-Tuong
Browse files

Run both orig and xformed binary from the same path

Former-commit-id: 99b2dbf7378c3d20943516317147fe4361becad1
parent 9ec52a09
No related branches found
No related tags found
No related merge requests found
......@@ -31,22 +31,29 @@ if [[ ! -z "$IGNORE_RESULTS" ]]; then
echo "TEST SCRIPT COVERAGE RUN: running test script ignoring results."
fi
TEST_PROG=$1
BENCH=$2
TEST_PROG=$(realpath $1)
BENCH=$(realpath $2)
DUMMY_NAME=DUMMY
TEST_BASE=`basename $TEST_PROG`
BENCH_BASE=`basename $BENCH`
SCRATCH_DIR="$(dirname $BENCH)"
TEST_PROG_ORIG=$SCRATCH_DIR/$TEST_BASE.orig
BENCH_ORIG=$SCRATCH_DIR/$BENCH_BASE.xform
CANONICAL=$SCRATCH_DIR/$TEST_BASE
cp $TEST_PROG $TEST_PROG_ORIG
cp $BENCH $BENCH_ORIG
if [ ! -z "$TEST_VERBOSE" ]; then
echo
echo "Original program: $TEST_PROG"
ls -lt $TEST_PROG
echo "Test program: $BENCH"
ls -lt $BENCH
echo "Original program: $TEST_PROG --> $TEST_PROG_ORIG"
echo "Test program: $BENCH --> $BENCH_ORIG"
echo "Canonical program: $CANONICAL"
echo
fi
DUMMY_NAME=DUMMY
BENCH_BASE=`basename $BENCH`
TEST_BASE=`basename $TEST_PROG`
NAME_REGEX=`echo "($BENCH_BASE\|$TEST_BASE\|$ORIG_NAME\|.peasoup\|.ncexe\|.stratafied)" | sed 's/\./\\\./'`
......@@ -125,14 +132,12 @@ log_results()
run_test_prog_only()
{
echo
echo "=== RUN TRANSFORMED PROGRAM ==="
set -x
ls -lt *out *error
TIMEOUT=$1
shift
cp $TEST_PROG_ORIG $CANONICAL
TEST_PROG=$CANONICAL
cmd_args="$@"
if [[ "$TEST_PROG" == "" ]]; then
......@@ -225,11 +230,8 @@ run_server_test_prog_only()
run_bench_prog_only()
{
echo
echo "=== RUN ORIGINAL PROGRAM ==="
set -x
ls -lt *out *error
cp $BENCH_ORIG $CANONICAL
BENCH=$CANONICAL
TIMEOUT=$1
shift
......
#!/bin/bash
set -x
TEST_DIR=$PEASOUP_HOME/tests/tcpdump
TEST_LIB="$TEST_DIR/../manual_test_lib.sh"
echo "TEST_DIR: $TEST_DIR"
TEST_LIB="$(realpath "$TEST_DIR/../manual_test_lib.sh")"
#used for filtering program names from output.
ORIG_NAME=tcpdump
ls -lt $TEST_DIR | grep tcpd_tests
pwd
whoami
sudo chmod -R og+rwx "$TEST_DIR/tcpd_tests"
ls -lt $TEST_DIR
ls -lt $TEST_DIR/tcpd_tests
ls -lt "$TEST_DIR/tcpd_tests/*.pcap"
#must import the library here, as it depends on some of the above variables
. $TEST_LIB
DELETE_FILTER="stonesoup|gcc|lib|DUMMY|exec|python|tcpdump"
# debugging
echo
echo "STRACE $1"
strace $1 -n -r $TEST_DIR/tcpd_tests/bgp_vpn_attrset.pcap -t -v
if [ ! $? -eq 0 ]; then
report_failure
fi
echo
echo "STRACE $2"
strace $2 -n -r $TEST_DIR/tcpd_tests/bgp_vpn_attrset.pcap -t -v
if [ ! $? -eq 0 ]; then
tail -n 30 /var/log/syslog
report_failure
fi
run_basic_test 20 -n -r $TEST_DIR/tcpd_tests/bgp_vpn_attrset.pcap -t -v
run_basic_test 20 -h
run_basic_test 20 -n -r $TEST_DIR/tcpd_tests/bgp_vpn_attrset.pcap -t -v
run_basic_test 20 -$i -s0 -nr $TEST_DIR/tcpd_tests/print-flags.pcap
run_basic_test 20 -n -r $TEST_DIR/tcpd_tests/mpbgp-linklocal-nexthop.pcap -t -v
run_basic_test 20 -n -r $TEST_DIR/tcpd_tests/eapon1.pcap -t
......
......@@ -162,6 +162,15 @@ do_tests()
orig)
cp $progpath $protected
;;
fail)
set -x
base_prog=$(basename $progpath)
if [ $base_prog = "ls" ]; then
cp $(which diff) $protected
else
cp $(which ls) $protected
fi
;;
*)
echo "Unknown configuration requested"
continue
......@@ -226,6 +235,8 @@ usage()
echo
echo "config:"
echo " rida (default configuration)"
echo " orig test against self"
echo " fail deliberately induce failure"
echo " p1 P1 transform"
echo " mgx move globals"
echo " mgx_p1 move globals, followed by P1"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment