forked from kronosnet/ci-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci-tests-src
executable file
·131 lines (118 loc) · 3.69 KB
/
ci-tests-src
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/sh
set -e
cleanlibqb() {
# libqb test suite will leave craft behind in case of failures
# make sure to clean before and after the test run
# this code works because we do NOT allow multiple builds of libqb
# in parallel!
if [ "${project}" = libqb ]; then
if [ -d "/dev/shm" ]; then
find /dev/shm -name qb-\*-test\* | xargs rm -rf
fi
find /tmp -type d -name libqb\* | xargs rm -rf
fi
}
pacemakerextratests() {
# pacemaker extra tests
if [ "${project}" != pacemaker ]; then
return
fi
./cts/cts-regression -V
}
case $build in
rpm)
exit 0
;;
coverity)
echo "===== CURRENT COVERITY SCAN ERRORS ====="
cat cov.txt
echo "===== END CURRENT COVERITY SCAN ERRORS ====="
ret=0
# this will trigger only with build-after-merge
if [ "${install}" = 1 ] || [ "${covinstall}" = 1 ]; then
mkdir -p /srv/covscan/${project}/origin/${target}/$extraver/
mv cov.json cov.txt /srv/covscan/${project}/origin/${target}/$extraver/
else
if [ ! -d /srv/covscan/${project}/origin/${target} ]; then
echo "WARNING: target branch origin/${target} no available for compare. Skipping."
exit 0
fi
csdiff -xc --no-color /srv/covscan/${project}/origin/${target}/$extraver/cov.json cov.json > cov.diff
errors="$(cat cov.diff | grep ^Error: | wc -l)"
if [ "$errors" -ne "0" ]; then
echo "===== NEW COVERITY SCAN ERRORS FIXED ====="
cat cov.diff
echo "===== END NEW COVERITY SCAN ERRORS FIXED ====="
fi
csdiff -c --no-color /srv/covscan/${project}/origin/${target}/$extraver/cov.json cov.json > cov.diff
errors="$(cat cov.diff | grep ^Error: | wc -l)"
if [ "$errors" -ne "0" ]; then
echo "===== NEW COVERITY SCAN ERRORS DETECTED ====="
cat cov.diff
echo "===== END NEW COVERITY SCAN ERRORS DETECTED ====="
ret=1
mkdir cov.html/new
cat cov.diff | cshtml - > cov.html/new/index.html
fi
fi
exit $ret
;;
crosscompile)
if [ "$(find . -print -type f -exec file {} \; | grep ELF | grep $ARCH | wc -l)" = 0 ]; then
echo "Crosscompilation test failed. Unable to find any $ARCH binaries"
exit 1
fi
exit 0
;;
*)
;;
esac
if [ -n "$CHECKS" ] && [ "$CHECKS" = "nochecks" ]; then
exit 0
fi
# blacklist PARALLELMAKE as necessary
if [ -n "$PARALLELTEST" ] && [ "$PARALLELTEST" = "no" ]; then
echo "${project} does not support parallel test. disabling PARALLELMAKE"
export PARALLELMAKE=""
fi
case "${project}" in
pcs)
case "${NODE_NAME}" in
debian*|ubuntu*)
localbuild=""
;;
*)
localbuild=--enable-local-build
;;
esac
if [ -f .venv/bin/activate ]; then
. .venv/bin/activate
export PATH="$(pwd)/.venv"/bin/:$PATH
fi
$MAKE $PARALLELMAKE check
$MAKE $PARALLELMAKE distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-parallel-tests --enable-destructive-tests $localbuild $DISTROCONFOPTS PKG_CONFIG_PATH=$EXTERNAL_CONFIG_PATH"
exit 0
;;
booth)
extraopts="--with-ocfdir=\$$\{prefix\}/lib/ocf"
;;
kronosnet|corosync)
if [ -n "$RUSTBINDINGS" ] && [ "$RUSTBINDINGS" = yes ]; then
extraopts="--enable-rust-bindings"
fi
;;
esac
if [ -z "$CHECKS" ]; then
CHECKS="check distcheck $EXTRACHECKS"
fi
if [ -n "$TESTUSELDPATH" ] && [ "$TESTUSELDPATH" = yes ]; then
echo "export LD_LIBRARY_PATH=$EXTERNAL_LD_LIBRARY_PATH"
export LD_LIBRARY_PATH=$EXTERNAL_LD_LIBRARY_PATH
fi
for i in $CHECKS; do
cleanlibqb
echo "$MAKE $PARALLELMAKE $MAKETESTOPTS $i DISTCHECK_CONFIGURE_FLAGS="$extraopts $DISTROCONFOPTS" PKG_CONFIG_PATH=$EXTERNAL_CONFIG_PATH || (find . -name "*test*suite.log" -exec cat {} \; ; false)"
$MAKE $PARALLELMAKE $MAKETESTOPTS $i DISTCHECK_CONFIGURE_FLAGS="$extraopts $DISTROCONFOPTS" PKG_CONFIG_PATH=$EXTERNAL_CONFIG_PATH || (find . -name "*test*suite.log" -exec cat {} \; ; false)
done
cleanlibqb
pacemakerextratests