diff options
Diffstat (limited to 'test/cases/libremakepkg.bats')
-rw-r--r-- | test/cases/libremakepkg.bats | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/test/cases/libremakepkg.bats b/test/cases/libremakepkg.bats index d511c38..9ddfd2e 100644 --- a/test/cases/libremakepkg.bats +++ b/test/cases/libremakepkg.bats @@ -8,6 +8,16 @@ setup() { eot } +teardown() { + local file + for file in "$tmpdir"/*.pid; do + [[ -f $file ]] || continue + xargs -a "$file" kill -- + done + + common_teardown +} + @test "libremakepkg builds a trivial package" { require network sudo || skip cp fixtures/libremakepkg/PKGBUILD-hello "$tmpdir/PKGBUILD" @@ -152,18 +162,27 @@ setup() { not globfile libretools-hello-1.0-1-any.pkg.tar.?z } -@test "libremakepkg allows distcc on long chrootpaths" { +@test "libremakepkg forwards distcc ports" { + require network sudo || skip + # The maximum AF_UNIX socket path is 108 bytes; so let's have - # a chroot name that's guaranteed to be >110 characters. + # a chroot name that's guaranteed to be >110 characters, to + # make sure we handle that. local chrootname=$BATS_TEST_NAME.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - require network sudo || skip - cp fixtures/libremakepkg/PKGBUILD-distcc "$tmpdir/PKGBUILD" - cd "$tmpdir" + local distcc_port + distcc_port=$(./lib/runserver "$tmpdir/distcc.pid" \ + echo 'Hello, I am a distcc server') cat >> "$XDG_CONFIG_HOME/libretools/chroot.conf" <<-eot CHROOTEXTRAPKG+=(distcc-nozeroconf socat) eot + cat >> "$XDG_CONFIG_HOME/pacman/makepkg.conf" <<-eot + DISTCC_HOSTS=127.0.0.1:${distcc_port@Q} + eot + + cp fixtures/libremakepkg/PKGBUILD-distcc "$tmpdir/PKGBUILD" + cd "$tmpdir" testsudo librechroot -l "$chrootname" install-name distcc-nozeroconf socat testsudo libremakepkg -l "$chrootname" globfile libretools-distcc-1.0-1-any.pkg.tar.?z |