diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile index 5e318b40..c7ed1dba 100644 --- a/test/docker/Dockerfile +++ b/test/docker/Dockerfile @@ -23,6 +23,7 @@ RUN pacman -Sy RUN pacman --noconfirm -S rubygems ruby-rdoc pacutils expect aur RUN sudo -u aconfmgr gem install bashcov +ENV ACONFMGR_IN_CONTAINER=1 RUN /opt/aur/setup.sh RUN useradd billy diff --git a/test/docker/Dockerfile.arch b/test/docker/Dockerfile.arch index 44d22688..15e50e6c 100644 --- a/test/docker/Dockerfile.arch +++ b/test/docker/Dockerfile.arch @@ -8,8 +8,9 @@ FROM scratch COPY --from=rootfs /root.x86_64/ / -RUN pacman-key --init -RUN pacman-key --populate +# Signatures are not timestamped, therefore always +# become invalid after some time when the key expires +RUN sed -i "s/^SigLevel.*/SigLevel = Never/" /etc/pacman.conf ARG arch_date RUN echo 'Server=https://archive.archlinux.org/repos/'"${arch_date}"'/$repo/os/$arch' > /etc/pacman.d/mirrorlist diff --git a/test/docker/aur/PKGBUILD b/test/docker/aur/PKGBUILD index d8b7da63..a31dbb72 100644 --- a/test/docker/aur/PKGBUILD +++ b/test/docker/aur/PKGBUILD @@ -21,8 +21,8 @@ md5sums=('SKIP' '9cd425efe85356ca36f08e2dc773f31f' 'f0e1159864a04bad3b1f903bc7301d80' '718c816fdaedb644f5b4d0cd742dbc97' - '05f52abd3c84a79f4ef10681d9e5a133' - '12c4adba5530e989c8d9067972cbcbae') + '465c05c00d4127eca4ba49e9122ca492' + '5b0d438efd0d35ca3a1ee2331db0985c') _aur_uid=500 _aur_gid=500 diff --git a/test/docker/aur/setup.sh b/test/docker/aur/setup.sh index 305ba79f..3a3eba29 100644 --- a/test/docker/aur/setup.sh +++ b/test/docker/aur/setup.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eEuo pipefail -if [[ ! -f /.dockerenv ]] +if [[ ! -v ACONFMGR_IN_CONTAINER ]] then echo 'Refusing to run setup outside Docker.' exit 1 diff --git a/test/docker/aur/start.sh b/test/docker/aur/start.sh index 47bd5b5c..2a01937e 100644 --- a/test/docker/aur/start.sh +++ b/test/docker/aur/start.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eEuo pipefail -if [[ ! -f /.dockerenv ]] +if [[ ! -v ACONFMGR_IN_CONTAINER ]] then echo 'Refusing to start outside Docker.' exit 1 diff --git a/test/docker/build-aur.sh b/test/docker/build-aur.sh index 95926416..00486a36 100755 --- a/test/docker/build-aur.sh +++ b/test/docker/build-aur.sh @@ -19,6 +19,7 @@ pacman_opts+=(--noconfirm) mkdir /aconfmgr-packages chown -R nobody: aur +chmod +x /aconfmgr{,/test{,/docker{,/aur}}} env -i -C aur su -s /bin/bash nobody -c 'makepkg --printsrcinfo' > aur/.SRCINFO AconfMakePkgDir aur false false "$PWD"/aur diff --git a/test/t/lib-funcs-integ.bash b/test/t/lib-funcs-integ.bash index 96d32db2..4bdbbea9 100644 --- a/test/t/lib-funcs-integ.bash +++ b/test/t/lib-funcs-integ.bash @@ -374,8 +374,13 @@ function TestInitAUR() { LogEnter 'Initializing AUR support...\n' + if [[ ! -v ACONFMGR_IN_CONTAINER ]] + then + FatalError 'Refusing to start outside Docker.\n' + fi + LogEnter 'Starting AUR...\n' - command sudo /opt/aur/start.sh + command sudo env ACONFMGR_IN_CONTAINER=1 /opt/aur/start.sh LogLeave LogEnter 'Generating a SSH key...\n'