/
ci_test
executable file
·102 lines (80 loc) · 3.35 KB
/
ci_test
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
#!/bin/bash
## Copyright (C) 2019 - 2023 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
## See the file COPYING for copying conditions.
set -x
set -e
true "$0: start"
MYDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
## travis.debian.net does not pass the CI environment variable to docker.
## build script reads CI variable.
CI=true
export CI
apt-get update
## Sanity tests.
apt-get --yes dist-upgrade
dpkg --configure -a
apt-get --yes install sudo virt-what lintian
## Debugging.
#systemd-detect-virt || true
virt-what || true
pwd_output="$(pwd)" || true
ls "$pwd_output" || true
ls /home || true
## The environment variables are not set here.
#true "$0: TRAVIS_DEBIAN_BUILD_DIR: $TRAVIS_DEBIAN_BUILD_DIR"
#true "$0: TRAVIS_DEBIAN_TARGET_DIR: $TRAVIS_DEBIAN_TARGET_DIR"
"${MYDIR}/build" --vm --debug --non-interactive
true "$0 INFO: ${MYDIR}/build success."
## TODO: do not hardcode hardened-vm-kernel
## Debugging.
find /var/lib/hardened-kernel/hardened-vm-kernel -type f -maxdepth 1
true "$0 INFO: OK."
## Move to /home/travis/build/ so travis.debian.net script can copy it out of
## the docker container.
## XXX: using find in for might not be safe but good enough for CI.
for file_name in $(find /var/lib/hardened-kernel/hardened-vm-kernel -type f -maxdepth 1) ; do
mv "$file_name" /home/travis/build/
done
## Debugging.
ls "/home/travis/build/" || true
lintian_suppress_tags=""
lintian_suppress_tags+="missing-tests-control,"
lintian_suppress_tags+="changed-by-address-is-root-user,"
lintian_suppress_tags+="changed-by-address-malformed,"
lintian_suppress_tags+="debian-control-has-obsolete-dbg-package,"
lintian_suppress_tags+="license-problem-gfdl-invariants-empty,"
lintian_suppress_tags+="source-contains-prebuilt-binary,"
lintian_suppress_tags+="package-does-not-install-examples,"
lintian_suppress_tags+="license-problem-gfdl-invariants,"
lintian_suppress_tags+="package-does-not-use-debhelper-or-cdbs,"
lintian_suppress_tags+="missing-debian-source-format,"
lintian_suppress_tags+="dbg-package-missing-depends,"
lintian_suppress_tags+="direct-changes-in-diff-but-no-patch-system,"
lintian_suppress_tags+="debian-rules-missing-required-target,"
lintian_suppress_tags+="debian-rules-missing-recommended-target,"
lintian_suppress_tags+="debian-rules-missing-recommended-target,"
lintian_suppress_tags+="no-dep5-copyright,"
lintian_suppress_tags+="no-standards-version-field,"
lintian_suppress_tags+="debian-watch-file-is-missing,"
lintian_suppress_tags+="spelling-error-in-binary,"
lintian_suppress_tags+="new-package-should-close-itp-bug,"
lintian_suppress_tags+="extended-description-is-probably-too-short,"
lintian_suppress_tags+="maintainer-address-is-root-user,"
lintian_suppress_tags+="maintainer-address-malformed,"
lintian_suppress_tags+="hardening-no-fortify-functions,"
lintian_suppress_tags+="hardening-no-bindnow,"
lintian_suppress_tags+="unstripped-binary-or-object,"
lintian_suppress_tags+="debian-changelog-file-contains-invalid-email-address,"
lintian_suppress_tags+="package-contains-vcs-control-file,"
lintian_suppress_tags+="package-contains-documentation-outside-usr-share-doc,"
## Try lintian newly built kernel.
lintian \
--suppress-tags "$lintian_suppress_tags" \
--quiet \
--pedantic \
--info \
--display-info \
"/home/travis/build/"*".changes" || true
## Try install newly built kernel.
dpkg -i "/home/travis/build/"*".deb"
true "$0 INFO: OK. End."