forked from Kong/docker-kong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path04-executables.test.sh
executable file
·62 lines (52 loc) · 1.62 KB
/
04-executables.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
#!/usr/bin/env bash
function run_test {
# the suite name below will only be used when rtunning this file directly, when
# running through "test.sh" it must be provided using the "--suite" option.
tinitialize "Docker-Kong test suite" "${BASH_SOURCE[0]}"
tchapter "makes executables available"
ttest "resty is in the system path"
docker run -ti --rm "kong-$BASE" resty -V
if [ $? -eq 0 ]; then
tsuccess
else
tmessage "resty wasn't found in the system path"
tfailure
fi
ttest "luajit is in the system path"
docker run -ti --rm "kong-$BASE" luajit -v
if [ $? -eq 0 ]; then
tsuccess
else
tmessage "luajit wasn't found in the system path"
tfailure
fi
ttest "lua is in the system path"
docker run -ti --rm "kong-$BASE" lua -v
if [ $? -eq 0 ]; then
tsuccess
else
tmessage "lua wasn't found in the system path"
tfailure
fi
ttest "nginx is in the system path"
docker run -ti --rm "kong-$BASE" nginx -v
if [ $? -eq 0 ]; then
tsuccess
else
tmessage "nginx wasn't found in the system path"
tfailure
fi
ttest "luarocks is in the system path"
docker run -ti --rm "kong-$BASE" luarocks --version
if [ $? -eq 0 ]; then
tsuccess
else
tmessage "luarocks wasn't found in the system path"
tfailure
fi
tfinish
}
# No need to modify anything below this comment
# shellcheck disable=SC1090 # do not follow source
[[ "$T_PROJECT_NAME" == "" ]] && set -e && if [[ -f "${1:-$(dirname "$(realpath "$0")")/test.sh}" ]]; then source "${1:-$(dirname "$(realpath "$0")")/test.sh}"; else source "${1:-$(dirname "$(realpath "$0")")/run.sh}"; fi && set +e
run_test