1
0
Fork 0

Script to test installation of generated package

This commit is contained in:
gardouille 2023-09-20 15:45:24 +02:00
parent 342ba9cb99
commit c828e5b0b2
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
3 changed files with 69 additions and 0 deletions

1
test/.gitignore vendored
View File

@ -1 +1,2 @@
.github.eza.upgrade
.docker*

View File

@ -0,0 +1,34 @@
#!/bin/bash
set -eu
PWD="$(dirname "${0}")"
REPO="$(echo "${PWD}/.." | xargs realpath)"
IMAGE="debian:bookworm"
echo "PWD: ${PWD}"
echo "REPO: ${REPO}"
while getopts "v:i:h" opt
do
case "$opt" in
i)
IMAGE="$OPTARG"
;;
h)
echo "Usage: $0 [-i image]"
exit 0
;;
*)
exit 1
;;
esac
done
docker run --rm \
--name eza-test-$$ \
-v "$REPO:/repo" \
-w /repo \
--user root \
"$IMAGE" \
sh ./test/test-deb.package.sh

34
test/test-deb.package.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
set -xeu
DEBIAN_FRONTEND=noninteractive
TARGET="$PWD"
export DEBIAN_FRONTEND
install_package() {
echo "Install package from current directory"
dpkg --install -- target/eza_*_amd64.deb || exit 1
}
version_package() {
echo "Try to display the version of the new installed package"
eza -v || exit 11
eza -v > ./test/.docker.test.version || exit 12
}
test_package() {
echo "Try to display the content of root with package command"
eza -lh / || exit 21
eza -lh / > ./test/.docker.test.result || exit 22
}
main() {
install_package
version_package
test_package
exit 0
}
main