summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-05-03 02:07:21 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-05-04 03:28:40 -0400
commit3dd9a5f0de096ae9b7ba47c4907d38ca4c087326 (patch)
tree5e67d1571f9434b6e57c78e3b1976937c8ad3995 /test
parent3dd2ec1a3315105b73735a2f9683f4a887df5df3 (diff)
bugfix [1/2]: libremakepkg: Check for detecting if distcc hook files exist
Diffstat (limited to 'test')
-rw-r--r--test/libremakepkg-test.sh22
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) ]]
+}