From 3dd9a5f0de096ae9b7ba47c4907d38ca4c087326 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 3 May 2017 02:07:21 -0400 Subject: bugfix [1/2]: libremakepkg: Check for detecting if distcc hook files exist --- test/libremakepkg-test.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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) ]] +} -- cgit v1.2.3-54-g00ecf