-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_test.sh
executable file
·63 lines (46 loc) · 1.32 KB
/
run_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
#!/bin/bash
set -euxo pipefail
project_dir="$(dirname "$(realpath "$0")")"
ControlPath=/tmp/openssh-mux-client-test.socket
stop_ssh_tester() {
exit_code=$?
"$project_dir"/testfiles/stop.sh
exit $exit_code
}
start_ssh_tester() {
"$project_dir"/testfiles/start_ssh.sh
ControlMasterPID="$("$project_dir"/testfiles/get_control_master_pid.sh)"
export ControlMasterPID
if [ -z "$ControlMasterPID" ]; then
echo Failed to start ssh
cat "$project_dir"/testfiles/*log
exit 1
fi
}
test_mux_client() {
cd "$project_dir"/crates/mux-client
start_ssh_tester
if [ $# -lt 1 ]; then
cargo test test_unordered -- --nocapture
cargo test test_request_stop_listening -- --nocapture
if [ -e $ControlPath ]; then
echo request_stop_listening does not work
exit 1
fi
start_ssh_tester
cargo test test_sync_request_stop_listening -- --nocapture
if [ -e $ControlPath ]; then
echo shutdown_mux_master does not work
exit 1
fi
else
cargo test "$@" -- --nocapture
fi
}
trap stop_ssh_tester 0
cd "$project_dir"/crates/non-zero-byte-slice
cargo +nightly miri test
"$project_dir"/testfiles/start.sh
test_mux_client "$@"
cd "$project_dir"/crates/proxy-client
cargo test "$@"