-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtest.sh
executable file
·78 lines (73 loc) · 3.64 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
set -e
#we flush the ARP cache because outdated ARP entries may let tests fail
sudo ip -s -s neigh flush all
if [ $# -ge 1 ]; then
TASK=$1
else
TASK=all
fi
case $TASK in
test_rfs_ip)
export RUST_LOG="tcp_proxy=info,test_tcp_proxy=debug,e2d2=debug,netfcts=info"
export RUST_BACKTRACE=1
executable=`cargo test $2 $3 $4 --no-run --message-format=json --test test_tcp_proxy | jq -r 'select((.profile.test == true) and (.target.name == "test_tcp_proxy")) | .filenames[]'`
echo $executable
echo ./tests/test_rfs_ip.toml > tests/toml_file.txt
sudo -E env "PATH=$PATH" "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" $executable --nocapture
;;
test_rfs_ip.2)
export RUST_LOG="tcp_proxy=info,test_tcp_proxy=info,e2d2=info"
export RUST_BACKTRACE=1
executable=`cargo test $2 --no-run --message-format=json --test test_tcp_proxy | jq -r 'select((.profile.test == true) and (.target.name == "test_tcp_proxy")) | .filenames[]'`
echo $executable
echo ./tests/test_rfs_ip.2.toml > tests/toml_file.txt
sudo -E env "PATH=$PATH" $executable --nocapture
;;
test_rfs_port)
export RUST_LOG="tcp_proxy=info,test_tcp_proxy=info,e2d2=info,netfcts=info"
export RUST_BACKTRACE=1
executable=`cargo test $2 $3 $4 --no-run --message-format=json --test test_tcp_proxy | jq -r 'select((.profile.test == true) and (.target.name == "test_tcp_proxy")) | .filenames[]'`
echo $executable
echo ./tests/test_rfs_port.toml > tests/toml_file.txt
sudo -E env "PATH=$PATH" $executable --nocapture
;;
timeout)
export RUST_BACKTRACE=1
export RUST_LOG="tcp_proxy=debug,timeout=debug,e2d2=info"
executable=`cargo test $2 $3 $4 --no-run --message-format=json --test timeout | jq -r 'select((.profile.test == true) and (.target.name == "timeout")) | .filenames[]'`
echo $executable
echo ./tests/timeout.toml > tests/toml_file.txt
sudo -E env "PATH=$PATH" $executable --nocapture
;;
timeout.2)
export RUST_BACKTRACE=1
export RUST_LOG="tcp_proxy=info,timeout=info,e2d2=info"
executable=`cargo test $2 $3 $4 --no-run --message-format=json --test timeout | jq -r 'select((.profile.test == true) and (.target.name == "timeout")) | .filenames[]'`
echo $executable
echo ./tests/timeout.2.toml > tests/toml_file.txt
sudo -E env "PATH=$PATH" $executable --nocapture
;;
client_syn_fin)
export RUST_LOG="tcp_proxy=info,client_syn_fin=info,e2d2=info,netfcts=info"
export RUST_BACKTRACE=1
executable=`cargo test $2 $3 $4 --no-run --message-format=json --test client_syn_fin | jq -r 'select((.profile.test == true) and (.target.name == "client_syn_fin")) | .filenames[]'`
echo $executable
echo ./tests/client_syn_fin.toml > tests/toml_file.txt
sudo -E env "PATH=$PATH" $executable --nocapture
;;
client_syn_fin.2)
export RUST_LOG="tcp_proxy=info,client_syn_fin=info,e2d2=info"
executable=`cargo test $2 --no-run --message-format=json --test client_syn_fin | jq -r 'select((.profile.test == true) and (.target.name == "client_syn_fin")) | .filenames[]'`
echo $executable
echo ./tests/client_syn_fin.2.toml > tests/toml_file.txt
sudo -E env "PATH=$PATH" $executable --nocapture
;;
all)
./test.sh test_rfs_ip $2
./test.sh test_rfs_port $2
./test.sh client_syn_fin $2
#run timeout as last test, as it does not close all sockets, otherwise we need to wait until Linux times all sockets out
./test.sh timeout $2
;;
esac