diff options
-rw-r--r-- | test/libremakepkg-test.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh index ef4ab6a..3609cb6 100644 --- a/test/libremakepkg-test.sh +++ b/test/libremakepkg-test.sh @@ -132,3 +132,25 @@ it_fails_if_a_hook_fails() { [[ $stat != 0 ]] tail -n1 $tmpdir/stderr | grep -qF '==> ERROR: Failure(s) in check_pkgbuild: check_pkgbuild_nonfree' } + +it_detects_distcc_files() { + require network sudo || return 0 + cp libremakepkg.d/PKGBUILD-hello "$tmpdir/PKGBUILD" + cd "$tmpdir" + + echo "CHROOTEXTRAPKG+=(distcc-nozeroconf socat)" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf + trap 'sed -i /CHROOTEXTRAPKGs+=/d "$XDG_CONFIG_HOME"/libretools/chroot.conf' RETURN + libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty + testsudo librechroot -l "$roundup_test_name" run pacman -S --noconfirm distcc-nozeroconf socat + + # first make sure that the engine works + testsudo libremakepkg -l "$roundup_test_name" + [[ -f $(echo libretools-hello-1.0-1-any.pkg.tar.?z) ]] + rm -f -- libretools-hello-1.0-1-any.pkg.tar.?z + # now throw a wrench in it + testsudo librechroot -l "$roundup_test_name" run touch /bin/distcc-tool + # and make sure that the engine broke + testsudo libremakepkg -l "$roundup_test_name" || stat=$? + [[ $stat != 0 ]] + not [[ -f $(echo libretools-hello-1.0-1-any.pkg.tar.?z) ]] +} |