diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2018-08-03 00:45:00 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2018-08-03 03:34:58 -0400 |
commit | 74c6b30d7dcacb59d94a023f04ba45f19643a8f4 (patch) | |
tree | 23ec048928eaf59937179e235ede4a83874faf9c /test | |
parent | d496e81f54df00a11395d296d965a6f8b3b057d5 (diff) |
test: librechroot: Add failing test case for chcleanup [ci-skip]
https://labs.parabola.nu/issues/1311
Diffstat (limited to 'test')
-rw-r--r-- | test/librechroot-test.sh | 21 | ||||
-rw-r--r-- | test/librechroot.d/PKGBUILD | 22 |
2 files changed, 43 insertions, 0 deletions
diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index 26e89f8..6ccff6f 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -58,6 +58,27 @@ it_handles_CHROOTEXTRAPKG_correctly() { not testsudo librechroot -l "$roundup_test_name" run lsof } +it_obeys_depends_in_PKGBUILD() { + require network sudo || return 0 + libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty + + # Make sure it's not in the base install + not testsudo librechroot -l "$roundup_test_name" run lsof + # Make sure it removes it without the PKGBUILD + testsudo librechroot -l "$roundup_test_name" run pacman -S --noconfirm lsof + testsudo librechroot -l "$roundup_test_name" run lsof + testsudo librechroot -l "$roundup_test_name" clean-pkgs + not testsudo librechroot -l "$roundup_test_name" run lsof + # Make sure it leaves it with the PKGBUILD + testsudo librechroot -l "$roundup_test_name" run pacman -S --noconfirm lsof + testsudo librechroot -l "$roundup_test_name" run sh -c 'printf "%s\n" "$1" > /startdir/PKGBUILD' -- "$(cat librechroot.d/PKGBUILD)" + # uid=99 is 'nobody', but we say '99' because sometimes 'nobody' is uid=65534. + # https://bugs.archlinux.org/task/56828 + testsudo librechroot -l "$roundup_test_name" run chown -R 99:99 /startdir + testsudo librechroot -l "$roundup_test_name" clean-pkgs + testsudo librechroot -l "$roundup_test_name" run lsof +} + it_displays_help_as_normal_user() { rm -rf "$XDG_CONFIG_HOME" LC_ALL=C librechroot help >$tmpdir/stdout 2>$tmpdir/stderr diff --git a/test/librechroot.d/PKGBUILD b/test/librechroot.d/PKGBUILD new file mode 100644 index 0000000..6116ad9 --- /dev/null +++ b/test/librechroot.d/PKGBUILD @@ -0,0 +1,22 @@ +pkgname='libretools-hello' +pkgver=1.0 +license=('GPL') +url='https://parabola.nu' + +pkgrel=1 +arch=(i686 x86_64) +depends=(sh) +depends_i686=('lsof') +depends_x86_64=('lsof') + +build() { + cd "$srcdir" + echo '#!/bin/sh' > hello.sh + echo 'echo Hello, world!' >> hello.sh + echo 'lsof' >> hello.sh +} + +package() { + cd "$srcdir" + install -Dm755 hello.sh "$pkgdir"/usr/bin/libretools-hello +} |