Script to test installation of generated package
This commit is contained in:
parent
342ba9cb99
commit
c828e5b0b2
|
@ -1 +1,2 @@
|
|||
.github.eza.upgrade
|
||||
.docker*
|
||||
|
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue