-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun.sh
More file actions
102 lines (76 loc) · 2.33 KB
/
Copy pathrun.sh
File metadata and controls
102 lines (76 loc) · 2.33 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# generate resource files
"${RUN_DIR}"/mkcert.sh
# start docker compose services (nginx, httpbin, ftp-server, influxdb, graphite)
[ -d /tmp/vsftpd ] || mkdir -p /tmp/vsftpd
docker compose -f "${PROJECT_DIR}"/scripts/coverage/vey-proxy/docker-compose.yml up -d
sleep 2
CURL_TEST_H2=no
CURL_TEST_H3=no
for feature in $(curl --version | awk -F':' '$1 == "Features" { print $2 }')
do
case "${feature}" in
"HTTP2")
CURL_TEST_H2=yes
;;
"HTTP3")
CURL_TEST_H3=yes
;;
*)
;;
esac
done
# start vey-dcgen
"${PROJECT_DIR}"/target/debug/vey-dcgen -c "${RUN_DIR}"/vey-dcgen.yaml -G port2999 &
DCGEN_PID=$!
# start vey-iploc
"${PROJECT_DIR}"/target/debug/vey-iploc -c "${RUN_DIR}"/vey-iploc.yaml -G port2888 &
IPLOC_PID=$!
# start vey-statsd
[ -n "${INFLUXDB3_AUTH_TOKEN}" ] || INFLUXDB3_AUTH_TOKEN=$(curl -X POST http://127.0.0.1:8181/api/v3/configure/token/admin | jq ".token" -r)
export INFLUXDB3_AUTH_TOKEN
"${PROJECT_DIR}"/target/debug/vey-statsd -c "${RUN_DIR}"/vey-statsd.yaml -G ${TEST_NAME} &
STATSD_PID=$!
# run vey-proxy integration tests
export TEST_CA_CERT_FILE="${RUN_DIR}/rootCA.pem"
vey_proxy_ctl()
{
"${PROJECT_DIR}"/target/debug/vey-proxy-ctl -G ${TEST_NAME} -p $PROXY_PID "$@"
}
vey_proxy_ftp()
{
"${PROJECT_DIR}"/target/debug/vey-proxy-ftp "$@"
}
set -x
"${PROJECT_DIR}"/target/debug/vey-proxy -Vvv
for dir in $(ls "${PROJECT_DIR}"/vey-proxy/examples)
do
example_dir="${PROJECT_DIR}/vey-proxy/examples/${dir}"
[ -d "${example_dir}" ] || continue
"${PROJECT_DIR}"/target/debug/vey-proxy -c "${example_dir}" -t
done
for dir in $(find "${RUN_DIR}/" -type d | sort)
do
[ -f "${dir}/main.yaml" ] || continue
echo "=== ${dir}"
date
"${PROJECT_DIR}"/target/debug/vey-proxy -c "${dir}/main.yaml" -G ${TEST_NAME} &
PROXY_PID=$!
sleep 2
[ -f "${dir}/testcases.sh" ] || continue
TESTCASE_DIR=${dir}
. "${dir}/testcases.sh"
vey_proxy_ctl offline
wait $PROXY_PID
done
set +x
kill -INT $STATSD_PID
kill -INT $IPLOC_PID
kill -INT $DCGEN_PID
## vey-proxy-ftp
echo "==== vey-proxy-ftp"
vey_proxy_ftp -u ftpuser -p ftppass 127.0.0.1 list
vey_proxy_ftp -u ftpuser -p ftppass 127.0.0.1 put --file "${RUN_DIR}/README.md" README
vey_proxy_ftp -u ftpuser -p ftppass 127.0.0.1 get README
vey_proxy_ftp -u ftpuser -p ftppass 127.0.0.1 del README
# cleanup
docker compose -f "${PROJECT_DIR}"/scripts/coverage/vey-proxy/docker-compose.yml down