summaryrefslogtreecommitdiff
path: root/test/cases/librestage.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/cases/librestage.bats')
-rw-r--r--test/cases/librestage.bats25
1 files changed, 9 insertions, 16 deletions
diff --git a/test/cases/librestage.bats b/test/cases/librestage.bats
index 1bc5c25..000ea3e 100644
--- a/test/cases/librestage.bats
+++ b/test/cases/librestage.bats
@@ -1,5 +1,7 @@
load ../lib/common
+shopt -s extglob
+
@test "librestage displays usage text" {
rm -rf "$XDG_CONFIG_HOME"
LC_ALL=C librestage -h >$tmpdir/stdout 2>$tmpdir/stderr
@@ -24,27 +26,22 @@ load ../lib/common
not empty "$tmpdir/stderr"
}
+# bats test_tags=network,sudo
@test "librestage guesses the repo" {
- nochroot=false; require network sudo || nochroot=true
mkdir -p -- "$tmpdir/reponame/libretools-hello"
cp fixtures/librestage/PKGBUILD-hello "$tmpdir/reponame/libretools-hello/PKGBUILD"
cd "$tmpdir/reponame/libretools-hello"
- if $nochroot; then
- makepkg
- else
- testsudo libremakepkg -l "$BATS_TEST_NAME"
- fi
+ testsudo libremakepkg -l "$BATS_TEST_NAME"
librestage
find "$tmpdir" -not -type d -exec ls -ld -- {} +
- globfile $tmpdir/workdir/staging/reponame/libretools-hello-1.0-1-any.pkg.tar.?z
- $nochroot || globfile $tmpdir/workdir/staging/sources/parabola/libretools-hello-1.0-1-any.src.tar.?z
+ globfile $tmpdir/workdir/staging/reponame/libretools-hello-1.0-1-any.pkg.tar?(.!(sig|*.*))
+ globfile $tmpdir/workdir/staging/sources/parabola/libretools-hello-1.0-1-any.src.tar?(.!(sig|*.*))
}
+# bats test_tags=network,sudo
@test "librestage stages packages without PKGDEST" {
- nochroot=false; require network sudo || nochroot=true
-
cat >> "$XDG_CONFIG_HOME/pacman/makepkg.conf" <<-eot
PKGDEST=''
SRCPKGDEST=''
@@ -53,14 +50,10 @@ load ../lib/common
cp fixtures/librestage/PKGBUILD-hello "$tmpdir/PKGBUILD"
cd "$tmpdir"
- if $nochroot; then
- makepkg
- else
testsudo libremakepkg -l "$BATS_TEST_NAME"
- fi
librestage repo1
find "$tmpdir" -not -type d -exec ls -ld -- {} +
- globfile $tmpdir/workdir/staging/repo1/libretools-hello-1.0-1-any.pkg.tar.?z
- $nochroot || globfile $tmpdir/workdir/staging/sources/parabola/libretools-hello-1.0-1-any.src.tar.?z
+ globfile $tmpdir/workdir/staging/repo1/libretools-hello-1.0-1-any.pkg.tar?(.!(sig|*.*))
+ globfile $tmpdir/workdir/staging/sources/parabola/libretools-hello-1.0-1-any.src.tar?(.!(sig|*.*))
}