Skip to content
Snippets Groups Projects
Commit e4e14ee4 authored by Simon McVittie's avatar Simon McVittie
Browse files

t: Add a test for the relocatable install

parent f88c4dec
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,7 @@ pipeline {
checkoutCollaboraGitlab('steam/pressure-vessel', 'master', 'src')
dir('src') {
sh '''
set -eu
./build-aux/git-version-gen .tarball-version > .tarball-version_
mv .tarball-version_ .tarball-version
'''
......@@ -62,9 +63,20 @@ pipeline {
sh '''
set -eu
make -C src PYTHON=python3.5
make -C src check PYTHON=python3.5
'''
}
}
/* Check for self-containedness by repeating relocatable-install.sh
* in a somewhat minimal container. */
docker.image('debian:buster-slim').inside() {
sh '''
set -eu
cd src
./t/relocatable-install.sh
'''
}
}
archiveArtifacts 'src/pressure-vessel-*-bin.tar.gz'
......
#!/bin/sh
set -eu
n=0
failed=
EXES="
bwrap
"
MULTIARCH="
capsule-capture-libs
capsule-symbols
"
SCRIPTS="
pressure-vessel-wrap
pressure-vessel-unruntime
"
if ! [ -e relocatable-install ]; then
echo "1..0 # SKIP relocatable-install not built"
exit 0
fi
for exe in $EXES; do
n=$(( n + 1 ))
if "relocatable-install/bin/$exe" --help >&2; then
echo "ok $n - $exe --help"
else
echo "not ok $n - $exe --help"
failed=yes
fi
done
for basename in $MULTIARCH; do
for pair in \
x86_64-linux-gnu:/lib64/ld-linux-x86-64.so.2 \
i386-linux-gnu:/lib/ld-linux.so.2 \
; do
ld_so="${pair#*:}"
multiarch="${pair%:*}"
exe="${multiarch}-${basename}"
n=$(( n + 1 ))
if [ -x "relocatable-install/bin/$exe" ]; then
echo "ok $n - $exe exists and is executable"
else
echo "not ok $n - $exe not executable"
failed=yes
fi
n=$(( n + 1 ))
if ! [ -x "$ld_so" ]; then
echo "ok $n - $exe # SKIP: $ld_so not found"
elif [ "$basename" = "capsule-symbols" ]; then
echo "ok $n - $exe # SKIP: capsule-symbols has no --help yet"
elif "relocatable-install/bin/$exe" --help >&2; then
echo "ok $n - $exe --help"
else
echo "not ok $n - $exe --help"
failed=yes
fi
done
done
for exe in $SCRIPTS; do
n=$(( n + 1 ))
if ! [ -x /bin/bash ]; then
echo "ok $n - $exe # SKIP Cannot run a bash script without bash"
elif "relocatable-install/bin/$exe" --help >&2; then
echo "ok $n - $exe --help"
else
echo "not ok $n - $exe --help"
failed=yes
fi
done
echo "1..$n"
if [ -n "$failed" ]; then
exit 1
fi
# vim:set sw=4 sts=4 et:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment