forked from dellelce/mkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtravis.sh
More file actions
executable file
·74 lines (53 loc) · 1.27 KB
/
travis.sh
File metadata and controls
executable file
·74 lines (53 loc) · 1.27 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
#!/bin/bash
#
# Building for travis
# This is only used by non-Docker build as a wrapper to mkit.sh to add testing
#
# File: travis.sh
# Created: 250718
#
### FUNCTIONS ###
test_file()
{
typeset f="$1"
typeset basef="$(basename $f)"
[ ! -f "$f" ] && { echo "File $f does not exist."; return 1; }
echo "${basef} exists."
ls -lt "$f"
# shared library test
[ "${basef%.so}" != "${basef}" ] && { ldd "$f" || return $?; }
return 0
}
### ENV ###
prefix="$1"; shift
python="$prefix/bin/python3.7"
### MAIN ###
mkdir $prefix && ./mkit.sh $prefix
rc=$?
echo "mkit rc: $rc"
fails=0
# even if rc != 0: we do some tests anyway
test_file $python
rc_python=$?
rc_sslversion=0
[ "$rc_python" -eq 0 ] &&
{
echo "Testing correct OpenSSL module is built:"
echo "import _ssl; print(_ssl.OPENSSL_VERSION);" | ${python}
rc_sslversion=$?
} ||
{
let fails="(( $fails + 1))"
}
[ "$rc_sslversion" -ne 0 ] && let fails="(( $fails + 1))"
# mod_wsgi checks
f="$prefix/modules/mod_wsgi.so"
test_file $f || let fails="(( $fails + 1 ))"
f="$prefix/modules/mod_proxy_uwsgi.so"
test_file $f || let fails="(( $fails + 1 ))"
#
echo
ls -lt "${prefix}/bin"
[ "$rc" -eq 0 -a "$fails" -ne 0 ] && { echo "Build succeeded but there were $fails test failures!"; exit 1; }
exit $rc
### EOF ###