-
Notifications
You must be signed in to change notification settings - Fork 5
/
rpmpkg-test.sh
executable file
·42 lines (33 loc) · 1021 Bytes
/
rpmpkg-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
#!/bin/bash
set -x -e -o pipefail
# contains information about this centos release
. /etc/os-release
export CODENAME=${ID}_${VERSION_ID}
yum install -y epel-release
# why does centos7 not have shunit2 packages?
yum install -y https://kojipkgs.fedoraproject.org/packages/shunit2/2.1.6/16.fc30/noarch/shunit2-2.1.6-16.fc30.noarch.rpm
yum install -y packages/${DIRNAME}/amplet2-client-*.rpm
# TODO is there something smarter we can use like autopkgtest in debian?
# run all the tests in the test directory
set +x
summary=""
failed=0
for t in tests/test_*sh; do
if [ "$t" = "tests/test_helper.sh" ]; then
continue
fi
if "$t"; then
result="$t\t\tPASS"
summary="$summary\n$result"
echo -e "$result"
else
failed=$(($failed + 1))
result="$t\t\tFAIL"
summary="$summary\n$result"
echo -e "$result"
fi
done
# print a summary that looks vaguely like autopkgtest
echo "@@@@@@@@@@@@@@@@@@@@ summary"
echo -e $summary | column -t
exit $failed