summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/guix-archive.sh8
-rw-r--r--tests/guix-build-branch.sh4
-rw-r--r--tests/guix-build.sh22
-rw-r--r--tests/guix-daemon.sh2
-rw-r--r--tests/guix-download.sh10
-rw-r--r--tests/guix-environment-container.sh7
-rw-r--r--tests/guix-environment.sh6
-rw-r--r--tests/guix-gc.sh18
-rw-r--r--tests/guix-git-authenticate.sh8
-rw-r--r--tests/guix-graph.sh6
-rw-r--r--tests/guix-hash.sh11
-rw-r--r--tests/guix-home.sh14
-rw-r--r--tests/guix-pack-relocatable.sh2
-rw-r--r--tests/guix-pack.sh4
-rw-r--r--tests/guix-package-aliases.sh12
-rw-r--r--tests/guix-package-net.sh22
-rw-r--r--tests/guix-package.sh46
-rw-r--r--tests/guix-refresh.sh6
-rw-r--r--tests/guix-shell.sh10
-rw-r--r--tests/guix-style.sh6
-rw-r--r--tests/guix-system.sh2
21 files changed, 117 insertions, 109 deletions
diff --git a/tests/guix-archive.sh b/tests/guix-archive.sh
index 00b87ff0ac3..0866b5a4d84 100644
--- a/tests/guix-archive.sh
+++ b/tests/guix-archive.sh
@@ -44,7 +44,7 @@ cmp "$archive" "$archive_alt"
44# Check the exit value upon import. 44# Check the exit value upon import.
45guix archive --import < "$archive" 45guix archive --import < "$archive"
46 46
47! guix archive something-that-does-not-exist 47guix archive --export something-that-does-not-exist && false
48 48
49# This one must not be listed as missing. 49# This one must not be listed as missing.
50guix build guile-bootstrap > "$archive" 50guix build guile-bootstrap > "$archive"
@@ -61,7 +61,7 @@ cmp "$archive" "$archive_alt"
61 61
62# This is not a valid store file name, so an error. 62# This is not a valid store file name, so an error.
63echo something invalid > "$archive" 63echo something invalid > "$archive"
64! guix archive --missing < "$archive" 64guix archive --missing < "$archive" && false
65 65
66# Check '--extract'. 66# Check '--extract'.
67guile -c "(use-modules (guix serialization)) 67guile -c "(use-modules (guix serialization))
@@ -77,4 +77,6 @@ guix archive -t < "$archive" | grep "^D /share/guile"
77guix archive -t < "$archive" | grep "^x /bin/guile" 77guix archive -t < "$archive" | grep "^x /bin/guile"
78guix archive -t < "$archive" | grep "^r /share/guile.*/boot-9\.scm" 78guix archive -t < "$archive" | grep "^r /share/guile.*/boot-9\.scm"
79 79
80! echo foo | guix archive --authorize 80echo foo | guix archive --authorize && false
81
82exit 0
diff --git a/tests/guix-build-branch.sh b/tests/guix-build-branch.sh
index 7bf6a318ca1..2d3b115e789 100644
--- a/tests/guix-build-branch.sh
+++ b/tests/guix-build-branch.sh
@@ -58,4 +58,6 @@ guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-9e3eacd
58test "$v0_1_0_drv" != "$latest_drv" 58test "$v0_1_0_drv" != "$latest_drv"
59test "$v0_1_0_drv" != "$orig_drv" 59test "$v0_1_0_drv" != "$orig_drv"
60 60
61! guix build guix --with-commit=guile-gcrypt=000 -d 61guix build guix --with-commit=guile-gcrypt=000 -d && false
62
63exit 0
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index 9cbf8fe26d8..2c59177c865 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -25,7 +25,7 @@
25guix build --version 25guix build --version
26 26
27# Should fail. 27# Should fail.
28! guix build -e + 28guix build -e + && false
29 29
30# Source-less packages are accepted; they just return nothing. 30# Source-less packages are accepted; they just return nothing.
31guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S 31guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S
@@ -92,7 +92,7 @@ cat > "$module_dir/foo.scm" <<EOF
92(use-modules (guix)) 92(use-modules (guix))
93) ;extra closing paren 93) ;extra closing paren
94EOF 94EOF
95! guix build -f "$module_dir/foo.scm" 2> "$module_dir/stderr" 95guix build -f "$module_dir/foo.scm" 2> "$module_dir/stderr" && false
96grep "read error" "$module_dir/stderr" 96grep "read error" "$module_dir/stderr"
97rm "$module_dir/stderr" "$module_dir/foo.scm" 97rm "$module_dir/stderr" "$module_dir/foo.scm"
98 98
@@ -199,7 +199,7 @@ cat > "$module_dir/foo.scm" <<EOF
199 (inputs (quasiquote (("sed" ,sed)))))) ;unbound variable 199 (inputs (quasiquote (("sed" ,sed)))))) ;unbound variable
200EOF 200EOF
201 201
202! guix build package-with-something-wrong -n 202guix build package-with-something-wrong -n && false
203guix build package-with-something-wrong -n 2> "$module_dir/err" || true 203guix build package-with-something-wrong -n 2> "$module_dir/err" || true
204grep "unbound" "$module_dir/err" # actual error 204grep "unbound" "$module_dir/err" # actual error
205grep "forget.*(gnu packages base)" "$module_dir/err" # hint 205grep "forget.*(gnu packages base)" "$module_dir/err" # hint
@@ -240,7 +240,7 @@ cat > "$module_dir/cc-user.scm" <<EOF
240(define-module (cc-user)) 240(define-module (cc-user))
241(make-thing 42) 241(make-thing 42)
242EOF 242EOF
243! guix build -f "$module_dir/cc-user.scm" -n 2> "$module_dir/err" 243guix build -f "$module_dir/cc-user.scm" -n 2> "$module_dir/err" && false
244cat "$module_dir/err" 244cat "$module_dir/err"
245grep "make-thing.*unbound" "$module_dir/err" # actual error 245grep "make-thing.*unbound" "$module_dir/err" # actual error
246grep "forget.*(bb-public)" "$module_dir/err" # hint 246grep "forget.*(bb-public)" "$module_dir/err" # hint
@@ -270,7 +270,7 @@ test "`guix build --log-file guile-bootstrap`" = "$log"
270test "`guix build --log-file $out`" = "$log" 270test "`guix build --log-file $out`" = "$log"
271 271
272# Should fail because the name/version combination could not be found. 272# Should fail because the name/version combination could not be found.
273! guix build hello-0.0.1 -n 273guix build hello-0.0.1 -n && false
274 274
275# Keep a symlink to the result, registered as a root. 275# Keep a symlink to the result, registered as a root.
276result="t-result-$$" 276result="t-result-$$"
@@ -279,7 +279,7 @@ guix build -r "$result" \
279test -x "$result/bin/guile" 279test -x "$result/bin/guile"
280 280
281# Should fail, because $result already exists. 281# Should fail, because $result already exists.
282! guix build -r "$result" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' 282guix build -r "$result" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' && false
283 283
284rm -f "$result" 284rm -f "$result"
285 285
@@ -323,7 +323,7 @@ drv2=`guix build hello -d --with-input=gcc=gcc-toolchain`
323test "$drv1" != "$drv2" 323test "$drv1" != "$drv2"
324guix gc -R "$drv2" | grep `guix build -d gcc-toolchain` 324guix gc -R "$drv2" | grep `guix build -d gcc-toolchain`
325 325
326! guix build guile --with-input=libunistring=something-really-silly 326guix build guile --with-input=libunistring=something-really-silly && false
327 327
328# Deprecated/superseded packages. 328# Deprecated/superseded packages.
329test "`guix build superseded -d`" = "`guix build bar -d`" 329test "`guix build superseded -d`" = "`guix build bar -d`"
@@ -331,8 +331,8 @@ test "`guix build superseded -d`" = "`guix build bar -d`"
331# Parsing package names and versions. 331# Parsing package names and versions.
332guix build -n time # PASS 332guix build -n time # PASS
333guix build -n time@1.9 # PASS, version found 333guix build -n time@1.9 # PASS, version found
334! guix build -n time@3.2 # FAIL, version not found 334guix build -n time@3.2 && false # FAIL, version not found
335! guix build -n something-that-will-never-exist # FAIL 335guix build -n something-that-will-never-exist && false # FAIL
336 336
337# Invoking a monadic procedure. 337# Invoking a monadic procedure.
338guix build -e "(begin 338guix build -e "(begin
@@ -404,4 +404,6 @@ export GUIX_BUILD_OPTIONS
404guix build emacs 404guix build emacs
405 405
406GUIX_BUILD_OPTIONS="--something-completely-crazy" 406GUIX_BUILD_OPTIONS="--something-completely-crazy"
407! guix build emacs 407guix build emacs && false
408
409exit 0
diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh
index 4b09c8c1622..d85727c9554 100644
--- a/tests/guix-daemon.sh
+++ b/tests/guix-daemon.sh
@@ -224,7 +224,7 @@ daemon_pid=$!
224GUIX_DAEMON_SOCKET="guix://$tcp_socket" 224GUIX_DAEMON_SOCKET="guix://$tcp_socket"
225export GUIX_DAEMON_SOCKET 225export GUIX_DAEMON_SOCKET
226 226
227! guix gc 227guix gc && false
228 228
229unset GUIX_DAEMON_SOCKET 229unset GUIX_DAEMON_SOCKET
230kill "$daemon_pid" 230kill "$daemon_pid"
diff --git a/tests/guix-download.sh b/tests/guix-download.sh
index 5475d43e606..f4cb335eef6 100644
--- a/tests/guix-download.sh
+++ b/tests/guix-download.sh
@@ -23,11 +23,11 @@
23guix download --version 23guix download --version
24 24
25# Make sure it fails here. 25# Make sure it fails here.
26! guix download http://does.not/exist 26guix download http://does.not/exist && false
27 27
28! guix download unknown://some/where; 28guix download unknown://some/where && false
29 29
30! guix download /does-not-exist 30guix download /does-not-exist && false
31 31
32# This one should succeed. 32# This one should succeed.
33guix download "file://$abs_top_srcdir/README" 33guix download "file://$abs_top_srcdir/README"
@@ -43,4 +43,6 @@ GUIX_DAEMON_SOCKET="/nowhere" guix download -o "$output" \
43cmp "$output" "$abs_top_srcdir/README" 43cmp "$output" "$abs_top_srcdir/README"
44 44
45# This one should fail. 45# This one should fail.
46! guix download "file:///does-not-exist" "file://$abs_top_srcdir/README" 46guix download "file:///does-not-exist" "file://$abs_top_srcdir/README" && false
47
48exit 0
diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh
index a30d6b7fb2b..a3bc1ab572d 100644
--- a/tests/guix-environment-container.sh
+++ b/tests/guix-environment-container.sh
@@ -260,16 +260,15 @@ guix shell --bootstrap guile-bootstrap --container \
260 /usr/bin/guile --version 260 /usr/bin/guile --version
261 261
262# A dangling symlink causes the command to fail. 262# A dangling symlink causes the command to fail.
263! guix shell --bootstrap -CS /usr/bin/python=bin/python guile-bootstrap -- exit 263guix shell --bootstrap -CS /usr/bin/python=bin/python guile-bootstrap -- exit && false
264 264
265# An invalid symlink spec causes the command to fail. 265# An invalid symlink spec causes the command to fail.
266! guix shell --bootstrap -CS bin/guile=/usr/bin/guile guile-bootstrap -- exit 266guix shell --bootstrap -CS bin/guile=/usr/bin/guile guile-bootstrap -- exit && false
267 267
268# Check whether '--nesting' works. 268# Check whether '--nesting' works.
269guix build hello -d 269guix build hello -d
270env="$(type -P pre-inst-env)" 270env="$(type -P pre-inst-env)"
271if guix shell -C -D guix -- "$env" guix build hello -d # cannot work 271guix shell -C -D guix -- "$env" guix build hello -d && false # cannot work
272then false; else true; fi
273hello_drv="$(guix build hello -d)" 272hello_drv="$(guix build hello -d)"
274hello_drv_nested="$(cd "$(dirname env)" && guix shell --bootstrap -CW -D guix -- "$env" guix build hello -d)" 273hello_drv_nested="$(cd "$(dirname env)" && guix shell --bootstrap -CW -D guix -- "$env" guix build hello -d)"
275test "$hello_drv" = "$hello_drv_nested" 274test "$hello_drv" = "$hello_drv_nested"
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh
index 95fe95b4371..1424ea9a880 100644
--- a/tests/guix-environment.sh
+++ b/tests/guix-environment.sh
@@ -60,7 +60,7 @@ guix environment --bootstrap --ad-hoc guile-bootstrap --pure \
60grep '^PATH=' "$tmpdir/a" 60grep '^PATH=' "$tmpdir/a"
61grep '^GUIX_TEST_ABC=' "$tmpdir/a" 61grep '^GUIX_TEST_ABC=' "$tmpdir/a"
62grep '^GUIX_TEST_DEF=' "$tmpdir/a" 62grep '^GUIX_TEST_DEF=' "$tmpdir/a"
63! grep '^GUIX_TEST_XYZ=' "$tmpdir/a" 63grep '^GUIX_TEST_XYZ=' "$tmpdir/a" && false
64 64
65# Make sure the exit value is preserved. 65# Make sure the exit value is preserved.
66if guix environment --bootstrap --ad-hoc guile-bootstrap --pure \ 66if guix environment --bootstrap --ad-hoc guile-bootstrap --pure \
@@ -207,7 +207,7 @@ then
207 done 207 done
208 208
209 # 'make-boot0' itself must not be listed. 209 # 'make-boot0' itself must not be listed.
210 ! guix gc --references "$profile" | grep make-boot0 210 guix gc --references "$profile" | grep make-boot0 && false
211 211
212 # Make sure that the shell spawned with '--exec' sees the same environment 212 # Make sure that the shell spawned with '--exec' sees the same environment
213 # as returned by '--search-paths'. 213 # as returned by '--search-paths'.
@@ -224,7 +224,7 @@ then
224 test "x$make_boot0_debug" != "x" 224 test "x$make_boot0_debug" != "x"
225 225
226 # Make sure the "debug" output is not listed. 226 # Make sure the "debug" output is not listed.
227 ! guix gc --references "$profile" | grep "$make_boot0_debug" 227 guix gc --references "$profile" | grep "$make_boot0_debug" && false
228 228
229 # Compute the build environment for the initial GNU Make, but add in the 229 # Compute the build environment for the initial GNU Make, but add in the
230 # bootstrap Guile as an ad-hoc addition. 230 # bootstrap Guile as an ad-hoc addition.
diff --git a/tests/guix-gc.sh b/tests/guix-gc.sh
index f40619876d4..675a13115d9 100644
--- a/tests/guix-gc.sh
+++ b/tests/guix-gc.sh
@@ -36,11 +36,11 @@ unset out
36# For some operations, passing extra arguments is an error. 36# For some operations, passing extra arguments is an error.
37for option in "" "-C 500M" "--verify" "--optimize" "--list-roots" 37for option in "" "-C 500M" "--verify" "--optimize" "--list-roots"
38do 38do
39 ! guix gc $option whatever 39 guix gc $option whatever && false
40done 40done
41 41
42# This should fail. 42# This should fail.
43! guix gc --verify=foo 43guix gc --verify=foo && false
44 44
45# Check the references of a .drv. 45# Check the references of a .drv.
46drv="`guix build guile-bootstrap -d`" 46drv="`guix build guile-bootstrap -d`"
@@ -51,7 +51,7 @@ guix gc --references "$drv" | grep -e -bash
51guix gc --references "$out" 51guix gc --references "$out"
52guix gc --references "$out/bin/guile" 52guix gc --references "$out/bin/guile"
53 53
54! guix gc --references /dev/null; 54guix gc --references /dev/null && false
55 55
56# Check derivers. 56# Check derivers.
57guix gc --derivers "$out" | grep "$drv" 57guix gc --derivers "$out" | grep "$drv"
@@ -62,7 +62,7 @@ test -f "$drv"
62 62
63guix gc --list-dead | grep "$drv" 63guix gc --list-dead | grep "$drv"
64guix gc --delete "$drv" 64guix gc --delete "$drv"
65! test -f "$drv" 65test ! -f "$drv"
66 66
67# Add a .drv, register it as a root. 67# Add a .drv, register it as a root.
68drv="`guix build --root=guix-gc-root lsh -d`" 68drv="`guix build --root=guix-gc-root lsh -d`"
@@ -71,18 +71,18 @@ test -f "$drv" && test -L guix-gc-root
71guix gc --list-roots | grep "$PWD/guix-gc-root" 71guix gc --list-roots | grep "$PWD/guix-gc-root"
72 72
73guix gc --list-live | grep "$drv" 73guix gc --list-live | grep "$drv"
74! guix gc --delete "$drv"; 74guix gc --delete "$drv" && false
75 75
76rm guix-gc-root 76rm guix-gc-root
77guix gc --list-dead | grep "$drv" 77guix gc --list-dead | grep "$drv"
78guix gc --delete "$drv" 78guix gc --delete "$drv"
79! test -f "$drv" 79test ! -f "$drv"
80 80
81# Try a random collection. 81# Try a random collection.
82guix gc -C 1KiB 82guix gc -C 1KiB
83 83
84# Check trivial error cases. 84# Check trivial error cases.
85! guix gc --delete /dev/null; 85guix gc --delete /dev/null && false
86 86
87# Bug #19757 87# Bug #19757
88out="`guix build guile-bootstrap`" 88out="`guix build guile-bootstrap`"
@@ -90,14 +90,14 @@ test -d "$out"
90 90
91guix gc --delete "$out" 91guix gc --delete "$out"
92 92
93! test -d "$out" 93test ! -d "$out"
94 94
95out="`guix build guile-bootstrap`" 95out="`guix build guile-bootstrap`"
96test -d "$out" 96test -d "$out"
97 97
98guix gc --delete "$out/" 98guix gc --delete "$out/"
99 99
100! test -d "$out" 100test ! -d "$out"
101 101
102out="`guix build guile-bootstrap`" 102out="`guix build guile-bootstrap`"
103test -d "$out" 103test -d "$out"
diff --git a/tests/guix-git-authenticate.sh b/tests/guix-git-authenticate.sh
index 2b90d8a4afe..ec89f941e63 100644
--- a/tests/guix-git-authenticate.sh
+++ b/tests/guix-git-authenticate.sh
@@ -35,9 +35,9 @@ intro_signer="BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"
35cache_key="test-$$" 35cache_key="test-$$"
36 36
37# This must fail because the end commit is not a descendant of $intro_commit. 37# This must fail because the end commit is not a descendant of $intro_commit.
38! guix git authenticate "$intro_commit" "$intro_signer" \ 38guix git authenticate "$intro_commit" "$intro_signer" \
39 --cache-key="$cache_key" --stats \ 39 --cache-key="$cache_key" --stats \
40 --end=9549f0283a78fe36f2d4ff2a04ef8ad6b0c02604 40 --end=9549f0283a78fe36f2d4ff2a04ef8ad6b0c02604 && false
41 41
42# The v1.2.0 commit is a descendant of $intro_commit and it satisfies the 42# The v1.2.0 commit is a descendant of $intro_commit and it satisfies the
43# authorization invariant. 43# authorization invariant.
@@ -59,8 +59,8 @@ guix git authenticate "$intro_commit" "$intro_signer" \
59 --end="$v1_0_0_commit" 59 --end="$v1_0_0_commit"
60 60
61# This should fail because these commits lack '.guix-authorizations'. 61# This should fail because these commits lack '.guix-authorizations'.
62! guix git authenticate "$v1_0_0_commit" "$v1_0_0_signer" \ 62guix git authenticate "$v1_0_0_commit" "$v1_0_0_signer" \
63 --cache-key="$cache_key" --end="$v1_0_1_commit" 63 --cache-key="$cache_key" --end="$v1_0_1_commit" && false
64 64
65# This should work thanks to '--historical-authorizations'. 65# This should work thanks to '--historical-authorizations'.
66guix git authenticate "$v1_0_0_commit" "$v1_0_0_signer" \ 66guix git authenticate "$v1_0_0_commit" "$v1_0_0_signer" \
diff --git a/tests/guix-graph.sh b/tests/guix-graph.sh
index e813e01c318..9824c6a65a4 100644
--- a/tests/guix-graph.sh
+++ b/tests/guix-graph.sh
@@ -59,7 +59,7 @@ guix graph -t references guile-bootstrap | grep guile-bootstrap
59guix graph -e '(@ (gnu packages bootstrap) %bootstrap-guile)' \ 59guix graph -e '(@ (gnu packages bootstrap) %bootstrap-guile)' \
60 | grep guile-bootstrap 60 | grep guile-bootstrap
61 61
62! guix graph -e + 62guix graph -e + && false
63 63
64# Try passing store file names. 64# Try passing store file names.
65 65
@@ -76,13 +76,13 @@ cmp "$tmpfile1" "$tmpfile2"
76# Try package transformation options. 76# Try package transformation options.
77guix graph git | grep 'label = "openssl' 77guix graph git | grep 'label = "openssl'
78guix graph git --with-input=openssl=libressl | grep 'label = "libressl' 78guix graph git --with-input=openssl=libressl | grep 'label = "libressl'
79! guix graph git --with-input=openssl=libressl | grep 'label = "openssl' 79guix graph git --with-input=openssl=libressl | grep 'label = "openssl' && false
80 80
81# Try --load-path 81# Try --load-path
82guix graph -L $module_dir dummy | grep 'label = "dummy' 82guix graph -L $module_dir dummy | grep 'label = "dummy'
83 83
84# Displaying shortest paths (or lack thereof). 84# Displaying shortest paths (or lack thereof).
85! guix graph --path emacs vim 85guix graph --path emacs vim && false
86 86
87path="\ 87path="\
88emacs 88emacs
diff --git a/tests/guix-hash.sh b/tests/guix-hash.sh
index 8b03c7985da..e260396fd81 100644
--- a/tests/guix-hash.sh
+++ b/tests/guix-hash.sh
@@ -38,12 +38,12 @@ test `guix hash -H sha1 -f base64 /dev/null` = "2jmj7l5rSw0yVb/vlWAYkK/YBwk="
38test "`guix hash /dev/null "$abs_top_srcdir/README"`" = "`guix hash /dev/null ; guix hash "$abs_top_srcdir/README"`" 38test "`guix hash /dev/null "$abs_top_srcdir/README"`" = "`guix hash /dev/null ; guix hash "$abs_top_srcdir/README"`"
39 39
40# Zero files. 40# Zero files.
41! guix hash 41guix hash && false
42 42
43# idem as `cat /dev/null | git hash-object --stdin` 43# idem as `cat /dev/null | git hash-object --stdin`
44test `guix hash -S git -H sha1 -f hex /dev/null` = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 44test `guix hash -S git -H sha1 -f hex /dev/null` = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
45 45
46! guix hash -H abcd1234 /dev/null 46guix hash -H abcd1234 /dev/null && false
47 47
48mkdir "$tmpdir" 48mkdir "$tmpdir"
49echo -n executable > "$tmpdir/exe" 49echo -n executable > "$tmpdir/exe"
@@ -61,11 +61,11 @@ test `guix hash -r "$tmpdir" 2>/dev/null` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslin
61test `guix hash -r "$tmpdir" -H sha512 2>/dev/null` = 301ra58c2vahczzxiyfin41mpyb0ljh4dh9zn3ijvwviaw1j40sfzw5skh9x945da88n3785ggifzig7acd6k72h0mpsc20m1f66m9n 61test `guix hash -r "$tmpdir" -H sha512 2>/dev/null` = 301ra58c2vahczzxiyfin41mpyb0ljh4dh9zn3ijvwviaw1j40sfzw5skh9x945da88n3785ggifzig7acd6k72h0mpsc20m1f66m9n
62 62
63# Without '-r', this should fail. 63# Without '-r', this should fail.
64! guix hash "$tmpdir" 64guix hash "$tmpdir" && false
65 65
66# This should fail because /dev/null is a character device, which 66# This should fail because /dev/null is a character device, which
67# the archive format doesn't support. 67# the archive format doesn't support.
68! guix hash -S nar /dev/null 68guix hash -S nar /dev/null && false
69 69
70# Adding a .git directory 70# Adding a .git directory
71mkdir "$tmpdir/.git" 71mkdir "$tmpdir/.git"
@@ -80,5 +80,6 @@ test `guix hash -S nar $tmpdir -x` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppi
80test `guix hash -S git $tmpdir -x` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk 80test `guix hash -S git $tmpdir -x` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk
81 81
82# Without '-r', this should fail. 82# Without '-r', this should fail.
83! guix hash "$tmpdir" 83guix hash "$tmpdir" && false
84 84
85exit 0
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
index 11b068ca437..e9ef76c8627 100644
--- a/tests/guix-home.sh
+++ b/tests/guix-home.sh
@@ -109,7 +109,7 @@ EOF
109 guix home extension-graph "home.scm" | grep 'label = "home"' 109 guix home extension-graph "home.scm" | grep 'label = "home"'
110 110
111 # There are no Shepherd services so the one below must fail. 111 # There are no Shepherd services so the one below must fail.
112 ! guix home shepherd-graph "home.scm" 112 guix home shepherd-graph "home.scm" && false
113 113
114 if container_supported 114 if container_supported
115 then 115 then
@@ -118,17 +118,17 @@ EOF
118 # TODO: Make container independent from external environment variables. 118 # TODO: Make container independent from external environment variables.
119 SHELL=bash 119 SHELL=bash
120 guix home container home.scm -- true 120 guix home container home.scm -- true
121 ! guix home container home.scm -- false 121 guix home container home.scm -- false && false
122 test "$(guix home container home.scm -- echo '$HOME')" = "$HOME" 122 test "$(guix home container home.scm -- echo '$HOME')" = "$HOME"
123 guix home container home.scm -- cat '~/.config/test.conf' | \ 123 guix home container home.scm -- cat '~/.config/test.conf' | \
124 grep "the content of" 124 grep "the content of"
125 guix home container home.scm -- test -h '~/.bashrc' 125 guix home container home.scm -- test -h '~/.bashrc'
126 test "$(guix home container home.scm -- id -u)" = 1000 126 test "$(guix home container home.scm -- id -u)" = 1000
127 ! guix home container home.scm -- test -f '$HOME/sample/home.scm' 127 guix home container home.scm -- test -f '$HOME/sample/home.scm' && false
128 guix home container home.scm --expose="$PWD=$HOME/sample" -- \ 128 guix home container home.scm --expose="$PWD=$HOME/sample" -- \
129 test -f '$HOME/sample/home.scm' 129 test -f '$HOME/sample/home.scm'
130 ! guix home container home.scm --expose="$PWD=$HOME/sample" -- \ 130 guix home container home.scm --expose="$PWD=$HOME/sample" -- \
131 rm -v '$HOME/sample/home.scm' 131 rm -v '$HOME/sample/home.scm' && false
132 else 132 else
133 echo "'guix home container' test SKIPPED" >&2 133 echo "'guix home container' test SKIPPED" >&2
134 fi 134 fi
@@ -206,8 +206,8 @@ EOF
206# the NEW content of bashrc-test-config.sh" 206# the NEW content of bashrc-test-config.sh"
207 207
208 # This file must have been removed and not backed up. 208 # This file must have been removed and not backed up.
209 ! test -e "$HOME/.config/test.conf" 209 test ! -e "$HOME/.config/test.conf"
210 ! test -e "$HOME"/*guix-home*backup/.config/test.conf 210 test ! -e "$HOME"/*guix-home*backup/.config/test.conf
211 211
212 test "$(cat "$(configuration_file)")" == "$(cat home.scm)" 212 test "$(cat "$(configuration_file)")" == "$(cat home.scm)"
213 test "$(canonical_file_name)" == "$(readlink "${HOME}/.guix-home")" 213 test "$(canonical_file_name)" == "$(readlink "${HOME}/.guix-home")"
diff --git a/tests/guix-pack-relocatable.sh b/tests/guix-pack-relocatable.sh
index 46120c9ee64..2fc9fde0bd9 100644
--- a/tests/guix-pack-relocatable.sh
+++ b/tests/guix-pack-relocatable.sh
@@ -92,7 +92,7 @@ then
92 grep 'GNU sed' "$test_directory/output" 92 grep 'GNU sed' "$test_directory/output"
93 93
94 # Check whether the exit code is preserved. 94 # Check whether the exit code is preserved.
95 ! run_without_store "$test_directory/Bin/sed" --does-not-exist 95 run_without_store "$test_directory/Bin/sed" --does-not-exist && false
96 96
97 chmod -Rf +w "$test_directory"; rm -rf "$test_directory"/* 97 chmod -Rf +w "$test_directory"; rm -rf "$test_directory"/*
98else 98else
diff --git a/tests/guix-pack.sh b/tests/guix-pack.sh
index a13e0ededf0..4042e54aeb5 100644
--- a/tests/guix-pack.sh
+++ b/tests/guix-pack.sh
@@ -37,7 +37,7 @@ test_directory="`mktemp -d`"
37trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT 37trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT
38 38
39# Reject unsuppoted packages. 39# Reject unsuppoted packages.
40! guix pack intelmetool -s armhf-linux -n 40guix pack intelmetool -s armhf-linux -n && false
41 41
42# Compute the derivation of a pack. 42# Compute the derivation of a pack.
43drv="`guix pack coreutils -d --no-grafts`" 43drv="`guix pack coreutils -d --no-grafts`"
@@ -48,7 +48,7 @@ guix gc -R "$drv" | grep "`guix build coreutils -d --no-grafts`"
48drv="`guix pack idutils -d --no-grafts --target=arm-linux-gnueabihf`" 48drv="`guix pack idutils -d --no-grafts --target=arm-linux-gnueabihf`"
49guix gc -R "$drv" | \ 49guix gc -R "$drv" | \
50 grep "`guix build idutils --target=arm-linux-gnueabihf -d --no-grafts`" 50 grep "`guix build idutils --target=arm-linux-gnueabihf -d --no-grafts`"
51! guix gc -R "$drv" | grep "`guix build idutils -d --no-grafts`" 51guix gc -R "$drv" | grep "`guix build idutils -d --no-grafts`" && false
52 52
53# Build a tarball with no compression. 53# Build a tarball with no compression.
54guix pack --compression=none --bootstrap guile-bootstrap 54guix pack --compression=none --bootstrap guile-bootstrap
diff --git a/tests/guix-package-aliases.sh b/tests/guix-package-aliases.sh
index 311838b7685..f68d24b9a7a 100644
--- a/tests/guix-package-aliases.sh
+++ b/tests/guix-package-aliases.sh
@@ -36,7 +36,7 @@ guix install --bootstrap guile-bootstrap -p "$profile"
36test -x "$profile/bin/guile" 36test -x "$profile/bin/guile"
37 37
38# Make sure '-r' isn't passed as-is to 'guix package'. 38# Make sure '-r' isn't passed as-is to 'guix package'.
39! guix install -r guile-bootstrap -p "$profile" --bootstrap 39guix install -r guile-bootstrap -p "$profile" --bootstrap && false
40test -x "$profile/bin/guile" 40test -x "$profile/bin/guile"
41 41
42# Use a package transformation option and make sure it's recorded. 42# Use a package transformation option and make sure it's recorded.
@@ -48,16 +48,16 @@ grep "libreoffice=inkscape" "$profile/manifest"
48guix upgrade --version 48guix upgrade --version
49guix upgrade -n 49guix upgrade -n
50guix upgrade gui.e -n 50guix upgrade gui.e -n
51! guix upgrade foo bar -n; 51guix upgrade foo bar -n && false
52 52
53guix remove --version 53guix remove --version
54guix remove --bootstrap guile-bootstrap -p "$profile" 54guix remove --bootstrap guile-bootstrap -p "$profile"
55! test -x "$profile/bin/guile" 55test ! -x "$profile/bin/guile"
56test `guix package -p "$profile" -I | wc -l` -eq 0 56test `guix package -p "$profile" -I | wc -l` -eq 0
57 57
58! guix remove -p "$profile" this-is-not-installed --bootstrap 58guix remove -p "$profile" this-is-not-installed --bootstrap && false
59 59
60! guix remove -i guile-bootstrap -p "$profile" --bootstrap 60guix remove -i guile-bootstrap -p "$profile" --bootstrap && false
61 61
62guix search '\<board\>' game | grep '^name: gnubg' 62guix search '\<board\>' game | grep '^name: gnubg'
63 63
@@ -66,7 +66,7 @@ guix show guile
66guix show python@3 | grep "^name: python" 66guix show python@3 | grep "^name: python"
67 67
68# "python@2" exists but is deprecated; make sure it doesn't show up. 68# "python@2" exists but is deprecated; make sure it doesn't show up.
69! guix show python@2 69guix show python@2 && false
70 70
71# Specifying multiple packages. 71# Specifying multiple packages.
72output="`guix show sed grep | grep ^name:`" 72output="`guix show sed grep | grep ^name:`"
diff --git a/tests/guix-package-net.sh b/tests/guix-package-net.sh
index 1cdeff773a3..62e17815bf8 100644
--- a/tests/guix-package-net.sh
+++ b/tests/guix-package-net.sh
@@ -58,7 +58,7 @@ trap 'rm -f "$profile" "$profile_alt" "$profile.lock" "$profile_alt.lock" "$prof
58 58
59guix package --bootstrap -p "$profile" -i guile-bootstrap 59guix package --bootstrap -p "$profile" -i guile-bootstrap
60test -L "$profile" && test -L "$profile-1-link" 60test -L "$profile" && test -L "$profile-1-link"
61! test -f "$profile-2-link" 61test ! -f "$profile-2-link"
62test -f "$profile/bin/guile" 62test -f "$profile/bin/guile"
63 63
64boot_make="(@ (guix tests) gnu-make-for-tests)" 64boot_make="(@ (guix tests) gnu-make-for-tests)"
@@ -98,13 +98,13 @@ test "`guix package -p "$profile" -l | cut -f1 | grep guile | head -n1`" \
98 = " guile-bootstrap" 98 = " guile-bootstrap"
99 99
100# Exit with 1 when a generation does not exist. 100# Exit with 1 when a generation does not exist.
101! guix package -p "$profile" --list-generations=42 101guix package -p "$profile" --list-generations=42 && false
102! guix package -p "$profile" --switch-generation=99 102guix package -p "$profile" --switch-generation=99 && false
103 103
104# Remove a package. 104# Remove a package.
105guix package --bootstrap -p "$profile" -r "guile-bootstrap" 105guix package --bootstrap -p "$profile" -r "guile-bootstrap"
106test -L "$profile-3-link" 106test -L "$profile-3-link"
107test -f "$profile/bin/make" && ! test -f "$profile/bin/guile" 107test -f "$profile/bin/make" && test ! -f "$profile/bin/guile"
108 108
109# Roll back. 109# Roll back.
110guix package --roll-back -p "$profile" 110guix package --roll-back -p "$profile"
@@ -112,7 +112,7 @@ test "`readlink_base "$profile"`" = "$profile-2-link"
112test -x "$profile/bin/guile" && test -x "$profile/bin/make" 112test -x "$profile/bin/guile" && test -x "$profile/bin/make"
113guix package --roll-back -p "$profile" 113guix package --roll-back -p "$profile"
114test "`readlink_base "$profile"`" = "$profile-1-link" 114test "`readlink_base "$profile"`" = "$profile-1-link"
115test -x "$profile/bin/guile" && ! test -x "$profile/bin/make" 115test -x "$profile/bin/guile" && test ! -x "$profile/bin/make"
116 116
117# Switch to the rolled generation and switch back. 117# Switch to the rolled generation and switch back.
118guix package -p "$profile" --switch-generation=2 118guix package -p "$profile" --switch-generation=2
@@ -124,8 +124,8 @@ test "`readlink_base "$profile"`" = "$profile-1-link"
124for i in `seq 1 3` 124for i in `seq 1 3`
125do 125do
126 guix package --bootstrap --roll-back -p "$profile" 126 guix package --bootstrap --roll-back -p "$profile"
127 ! test -f "$profile/bin" 127 test ! -f "$profile/bin"
128 ! test -f "$profile/lib" 128 test ! -f "$profile/lib"
129 test "`readlink_base "$profile"`" = "$profile-0-link" 129 test "`readlink_base "$profile"`" = "$profile-0-link"
130done 130done
131 131
@@ -135,7 +135,7 @@ test -z "`guix package -p "$profile" -l 0`"
135# Reinstall after roll-back to the empty profile. 135# Reinstall after roll-back to the empty profile.
136guix package --bootstrap -p "$profile" -e "$boot_make" 136guix package --bootstrap -p "$profile" -e "$boot_make"
137test "`readlink_base "$profile"`" = "$profile-1-link" 137test "`readlink_base "$profile"`" = "$profile-1-link"
138test -x "$profile/bin/guile" && ! test -x "$profile/bin/make" 138test -x "$profile/bin/guile" && test ! -x "$profile/bin/make"
139 139
140# Check that the first generation is the current one. 140# Check that the first generation is the current one.
141test "`guix package -p "$profile" -l 1 | cut -f3 | head -n1`" = "(current)" 141test "`guix package -p "$profile" -l 1 | cut -f3 | head -n1`" = "(current)"
@@ -143,7 +143,7 @@ test "`guix package -p "$profile" -l 1 | cut -f3 | head -n1`" = "(current)"
143# Roll-back to generation 0, and install---all at once. 143# Roll-back to generation 0, and install---all at once.
144guix package --bootstrap -p "$profile" --roll-back -i guile-bootstrap 144guix package --bootstrap -p "$profile" --roll-back -i guile-bootstrap
145test "`readlink_base "$profile"`" = "$profile-1-link" 145test "`readlink_base "$profile"`" = "$profile-1-link"
146test -x "$profile/bin/guile" && ! test -x "$profile/bin/make" 146test -x "$profile/bin/guile" && test ! -x "$profile/bin/make"
147 147
148# Install Make. 148# Install Make.
149guix package --bootstrap -p "$profile" -e "$boot_make" 149guix package --bootstrap -p "$profile" -e "$boot_make"
@@ -175,7 +175,7 @@ test -z "`guix package -p "$profile" -l 3`"
175rm "$profile" 175rm "$profile"
176guix package --bootstrap -p "$profile" -i guile-bootstrap 176guix package --bootstrap -p "$profile" -i guile-bootstrap
177guix package --bootstrap -p "$profile_alt" -i gcc-bootstrap 177guix package --bootstrap -p "$profile_alt" -i gcc-bootstrap
178! guix package -p "$profile" --search-paths | grep LIBRARY_PATH 178guix package -p "$profile" --search-paths | grep LIBRARY_PATH && false
179guix package -p "$profile" -p "$profile_alt" --search-paths \ 179guix package -p "$profile" -p "$profile_alt" --search-paths \
180 | grep "LIBRARY_PATH.*$profile/lib.$profile_alt/lib" 180 | grep "LIBRARY_PATH.*$profile/lib.$profile_alt/lib"
181 181
@@ -234,4 +234,4 @@ guix package --bootstrap -e "$boot_make"
234test -f "$HOME/.guix-profile/bin/make" 234test -f "$HOME/.guix-profile/bin/make"
235 235
236guix package --bootstrap --roll-back 236guix package --bootstrap --roll-back
237! test -f "$HOME/.guix-profile/bin/make" 237test ! -f "$HOME/.guix-profile/bin/make"
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index cc416ec6a19..945d59cdfb7 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -37,7 +37,7 @@ rm -f "$profile" "$tmpfile"
37trap 'rm -f "$profile" "$profile.lock" "$profile-"[0-9]* "$tmpfile"; rm -rf "$module_dir" t-home-'"$$" EXIT 37trap 'rm -f "$profile" "$profile.lock" "$profile-"[0-9]* "$tmpfile"; rm -rf "$module_dir" t-home-'"$$" EXIT
38 38
39# Use `-e' with a non-package expression. 39# Use `-e' with a non-package expression.
40! guix package --bootstrap -e + 40guix package --bootstrap -e + && false
41 41
42# Install a store item and make sure the version and output in the manifest 42# Install a store item and make sure the version and output in the manifest
43# are correct. 43# are correct.
@@ -57,23 +57,23 @@ guix gc --list-live | grep "`readlink "$profile-1-link"`"
57# Installing the same package a second time does nothing. 57# Installing the same package a second time does nothing.
58guix package --bootstrap -p "$profile" -i guile-bootstrap 58guix package --bootstrap -p "$profile" -i guile-bootstrap
59test -L "$profile" && test -L "$profile-1-link" 59test -L "$profile" && test -L "$profile-1-link"
60! test -f "$profile-2-link" 60test ! -f "$profile-2-link"
61test -f "$profile/bin/guile" 61test -f "$profile/bin/guile"
62 62
63# Unsupported packages cannot be installed. 63# Unsupported packages cannot be installed.
64! guix package -e '(begin (use-modules (guix) (gnu packages base)) (package (inherit sed) (supported-systems (list))))' -n 64guix package -e '(begin (use-modules (guix) (gnu packages base)) (package (inherit sed) (supported-systems (list))))' -n && false
65case $(uname -m) in 65case $(uname -m) in
66 x86_64|i[3456]86) 66 x86_64|i[3456]86)
67 ! guix package -i novena-eeprom -n 67 guix package -i novena-eeprom -n && false
68 break;; 68 break;;
69 *) 69 *)
70 ! guix package -i intelmetool -n 70 guix package -i intelmetool -n && false
71 break;; 71 break;;
72esac 72esac
73 73
74# Collisions are properly flagged (in this case, 'g-wrap' propagates 74# Collisions are properly flagged (in this case, 'g-wrap' propagates
75# guile@2.2, which conflicts with guile@2.0.) 75# guile@2.2, which conflicts with guile@2.0.)
76! guix package --bootstrap -n -p "$profile" -i g-wrap guile@2.0 76guix package --bootstrap -n -p "$profile" -i g-wrap guile@2.0 && false
77 77
78guix package --bootstrap -n -p "$profile" -i g-wrap guile@2.0 \ 78guix package --bootstrap -n -p "$profile" -i g-wrap guile@2.0 \
79 --allow-collisions 79 --allow-collisions
@@ -88,7 +88,7 @@ test "`guix package -p "$profile" --search-paths | wc -l`" = 1 # $PATH
88 type -P rm ) 88 type -P rm )
89 89
90# Exit with 1 when a generation does not exist. 90# Exit with 1 when a generation does not exist.
91! guix package -p "$profile" --delete-generations=42 91guix package -p "$profile" --delete-generations=42 && false
92 92
93# Exit with 0 when trying to delete the zeroth generation. 93# Exit with 0 when trying to delete the zeroth generation.
94guix package -p "$profile" --delete-generations=0 94guix package -p "$profile" --delete-generations=0
@@ -101,12 +101,12 @@ guix package --bootstrap -i "glibc:debug" -p "$profile" -n
101 101
102# Make sure nonexistent outputs are reported. 102# Make sure nonexistent outputs are reported.
103guix package --bootstrap -i "guile-bootstrap:out" -p "$profile" -n 103guix package --bootstrap -i "guile-bootstrap:out" -p "$profile" -n
104! guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile" -n 104guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile" -n && false
105! guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile" 105guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile" && false
106 106
107# Make sure we get an error when trying to remove something that's not 107# Make sure we get an error when trying to remove something that's not
108# installed. 108# installed.
109! guix package --bootstrap -r something-not-installed -p "$profile" 109guix package --bootstrap -r something-not-installed -p "$profile" && false
110 110
111# Check whether `--list-available' returns something sensible. 111# Check whether `--list-available' returns something sensible.
112guix package -p "$profile" -A 'gui.*e' | grep guile 112guix package -p "$profile" -A 'gui.*e' | grep guile
@@ -118,8 +118,8 @@ guix package --show=guile | grep "^name: guile"
118guix package --show=texlive 118guix package --show=texlive
119 119
120# Fail for non-existent packages or package/version pairs. 120# Fail for non-existent packages or package/version pairs.
121! guix package --show=does-not-exist 121guix package --show=does-not-exist && false
122! guix package --show=emacs@42 122guix package --show=emacs@42 && false
123 123
124# Search. 124# Search.
125LC_MESSAGES=C 125LC_MESSAGES=C
@@ -163,19 +163,19 @@ guix package --search="" > /dev/null
163# There's no generation older than 12 months, so the following command should 163# There's no generation older than 12 months, so the following command should
164# have no effect. 164# have no effect.
165generation="`readlink_base "$profile"`" 165generation="`readlink_base "$profile"`"
166! guix package -p "$profile" --delete-generations=12m 166guix package -p "$profile" --delete-generations=12m && false
167test "`readlink_base "$profile"`" = "$generation" 167test "`readlink_base "$profile"`" = "$generation"
168 168
169# The following command should not delete the current generation, even though 169# The following command should not delete the current generation, even though
170# it matches the given pattern (see <http://bugs.gnu.org/19978>.) And since 170# it matches the given pattern (see <http://bugs.gnu.org/19978>.) And since
171# there's nothing else to delete, it should just fail. 171# there's nothing else to delete, it should just fail.
172guix package --list-generations -p "$profile" 172guix package --list-generations -p "$profile"
173! guix package --bootstrap -p "$profile" --delete-generations=1.. 173guix package --bootstrap -p "$profile" --delete-generations=1.. && false
174test "`readlink_base "$profile"`" = "$generation" 174test "`readlink_base "$profile"`" = "$generation"
175 175
176# Make sure $profile is a GC root at this point. 176# Make sure $profile is a GC root at this point.
177real_profile="`readlink -f "$profile"`" 177real_profile="`readlink -f "$profile"`"
178! guix gc -d "$real_profile" 178guix gc -d "$real_profile" && false
179test -d "$real_profile" 179test -d "$real_profile"
180 180
181# Now, let's remove all the symlinks to $real_profile, and make sure 181# Now, let's remove all the symlinks to $real_profile, and make sure
@@ -278,22 +278,22 @@ do
278 guix gc --list-live | grep "`readlink "$profile_link"`" 278 guix gc --list-live | grep "`readlink "$profile_link"`"
279 279
280 guix package --bootstrap --roll-back 280 guix package --bootstrap --roll-back
281 ! test -f "$HOME/.guix-profile/bin" 281 test ! -f "$HOME/.guix-profile/bin"
282 ! test -f "$HOME/.guix-profile/lib" 282 test ! -f "$HOME/.guix-profile/lib"
283 test "`readlink "$default_profile"`" = "`basename $default_profile-0-link`" 283 test "`readlink "$default_profile"`" = "`basename $default_profile-0-link`"
284done 284done
285 285
286# Check whether '-p ~/.guix-profile' makes any difference. 286# Check whether '-p ~/.guix-profile' makes any difference.
287# See <http://bugs.gnu.org/17939>. 287# See <http://bugs.gnu.org/17939>.
288! test -e "$HOME/.guix-profile-0-link" 288test ! -e "$HOME/.guix-profile-0-link"
289! test -e "$HOME/.guix-profile-1-link" 289test ! -e "$HOME/.guix-profile-1-link"
290guix package --bootstrap -p "$HOME/.guix-profile" -i guile-bootstrap 290guix package --bootstrap -p "$HOME/.guix-profile" -i guile-bootstrap
291! test -e "$HOME/.guix-profile-1-link" 291test ! -e "$HOME/.guix-profile-1-link"
292guix package --bootstrap --roll-back -p "$HOME/.guix-profile" 292guix package --bootstrap --roll-back -p "$HOME/.guix-profile"
293! test -e "$HOME/.guix-profile-0-link" 293test ! -e "$HOME/.guix-profile-0-link"
294 294
295# Extraneous argument. 295# Extraneous argument.
296! guix package install foo-bar 296guix package install foo-bar && false
297 297
298# Make sure the "broken pipe" doesn't yield an error. 298# Make sure the "broken pipe" doesn't yield an error.
299# Note: 'pipefail' is a Bash-specific option. 299# Note: 'pipefail' is a Bash-specific option.
@@ -382,7 +382,7 @@ cat > "$module_dir/package.scm"<<EOF
382 382
383(define my-package coreutils) ;returns *unspecified* 383(define my-package coreutils) ;returns *unspecified*
384EOF 384EOF
385! guix package --bootstrap --install-from-file="$module_dir/package.scm" 385guix package --bootstrap --install-from-file="$module_dir/package.scm" && false
386 386
387rm "$module_dir/package.scm" 387rm "$module_dir/package.scm"
388 388
diff --git a/tests/guix-refresh.sh b/tests/guix-refresh.sh
index c5214e1d6e9..1167703b74f 100644
--- a/tests/guix-refresh.sh
+++ b/tests/guix-refresh.sh
@@ -37,12 +37,12 @@ GUIX_TEST_UPDATER_TARGETS='
37 ("the-test-package" "" (("5.5" "file://'$PWD/$module_dir'/source"))))' 37 ("the-test-package" "" (("5.5" "file://'$PWD/$module_dir'/source"))))'
38 38
39# No newer version available. 39# No newer version available.
40! guix refresh -t test idutils 40guix refresh -t test idutils && false
41case "$(guix refresh -t test idutils 2>&1)" in 41case "$(guix refresh -t test idutils 2>&1)" in
42 *"$idutils_version"*"already the latest version"*) true;; 42 *"$idutils_version"*"already the latest version"*) true;;
43 *) false;; 43 *) false;;
44esac 44esac
45! guix refresh -t test libreoffice 45guix refresh -t test libreoffice && false
46case "$(guix refresh -t test libreoffice 2>&1)" in 46case "$(guix refresh -t test libreoffice 2>&1)" in
47 *"greater than the latest known version"*"1.0"*) true;; 47 *"greater than the latest known version"*"1.0"*) true;;
48 *) false;; 48 *) false;;
@@ -100,7 +100,7 @@ grep 'version "5.5"' "$module_dir/sample.scm"
100grep "$(guix hash -H sha256 -f nix-base32 "$module_dir/source")" "$module_dir/sample.scm" 100grep "$(guix hash -H sha256 -f nix-base32 "$module_dir/source")" "$module_dir/sample.scm"
101 101
102# Specifying a target version. 102# Specifying a target version.
103! guix refresh -t test guile=2.0.0 103guix refresh -t test guile=2.0.0 && false
104case "$(guix refresh -t test guile=2.0.0 2>&1)" in 104case "$(guix refresh -t test guile=2.0.0 2>&1)" in
105 *"failed to find"*"2.0.0"*) true;; 105 *"failed to find"*"2.0.0"*) true;;
106 *) false;; 106 *) false;;
diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh
index cb2b53466d0..ed368515eba 100644
--- a/tests/guix-shell.sh
+++ b/tests/guix-shell.sh
@@ -33,13 +33,13 @@ export XDG_CONFIG_HOME
33guix shell --bootstrap --pure guile-bootstrap -- guile --version 33guix shell --bootstrap --pure guile-bootstrap -- guile --version
34 34
35# '--symlink' can only be used with --container. 35# '--symlink' can only be used with --container.
36! guix shell --bootstrap guile-bootstrap -S /dummy=bin/guile 36guix shell --bootstrap guile-bootstrap -S /dummy=bin/guile && false
37 37
38# '--ad-hoc' is a thing of the past. 38# '--ad-hoc' is a thing of the past.
39! guix shell --ad-hoc guile-bootstrap 39guix shell --ad-hoc guile-bootstrap && false
40 40
41# Rejecting unsupported packages. 41# Rejecting unsupported packages.
42! guix shell -s armhf-linux intelmetool -n 42guix shell -s armhf-linux intelmetool -n && false
43 43
44# Test approximately that the child process does not inherit extra file 44# Test approximately that the child process does not inherit extra file
45# descriptors. Ideally we'd check there's nothing more than 0, 1, and 2, but 45# descriptors. Ideally we'd check there's nothing more than 0, 1, and 2, but
@@ -55,7 +55,7 @@ test "$(echo $fd_list | wc -w)" -le "$(echo $initial_fd_list | wc -w)"
55cat > "$tmpdir/guix.scm" <<EOF 55cat > "$tmpdir/guix.scm" <<EOF
56This is a broken guix.scm file. 56This is a broken guix.scm file.
57EOF 57EOF
58! (cd "$tmpdir"; SHELL="$(type -P true)" guix shell --bootstrap 2> "stderr") 58(cd "$tmpdir"; SHELL="$(type -P true)" guix shell --bootstrap 2> "stderr") && false
59grep "not authorized" "$tmpdir/stderr" 59grep "not authorized" "$tmpdir/stderr"
60rm "$tmpdir/stderr" 60rm "$tmpdir/stderr"
61 61
@@ -122,7 +122,7 @@ then
122 done 122 done
123 123
124 # 'make-boot0' itself must not be listed. 124 # 'make-boot0' itself must not be listed.
125 ! guix gc --references "$profile" | grep make-boot0 125 guix gc --references "$profile" | grep make-boot0 && false
126 126
127 # Honoring the local 'guix.scm' file. 127 # Honoring the local 'guix.scm' file.
128 echo '(@ (guix tests) gnu-make-for-tests)' > "$tmpdir/guix.scm" 128 echo '(@ (guix tests) gnu-make-for-tests)' > "$tmpdir/guix.scm"
diff --git a/tests/guix-style.sh b/tests/guix-style.sh
index 58f953a0ec1..2de879d5e33 100644
--- a/tests/guix-style.sh
+++ b/tests/guix-style.sh
@@ -65,7 +65,7 @@ cp "$tmpfile" "$tmpfile.bak"
65initial_hash="$(guix hash "$tmpfile")" 65initial_hash="$(guix hash "$tmpfile")"
66 66
67guix style -f "$tmpfile" 67guix style -f "$tmpfile"
68if ! test "$initial_hash" = "$(guix hash "$tmpfile")" 68if test "$initial_hash" != "$(guix hash "$tmpfile")"
69then 69then
70 cat "$tmpfile" 70 cat "$tmpfile"
71 diff -u "$tmpfile.bak" "$tmpfile" 71 diff -u "$tmpfile.bak" "$tmpfile"
@@ -73,8 +73,8 @@ then
73fi 73fi
74 74
75# Introduce random changes and try again. 75# Introduce random changes and try again.
76sed -i "$tmpfile" -e's/ +/ /g' 76sed -i "$tmpfile" -e's/ \+/ /g'
77! test "$initial_hash" = "$(guix hash "$tmpfile")" 77test "$initial_hash" != "$(guix hash "$tmpfile")"
78 78
79guix style -f "$tmpfile" 79guix style -f "$tmpfile"
80test "$initial_hash" = "$(guix hash "$tmpfile")" 80test "$initial_hash" = "$(guix hash "$tmpfile")"
diff --git a/tests/guix-system.sh b/tests/guix-system.sh
index 1dbd5a0b853..adc0c44a6fd 100644
--- a/tests/guix-system.sh
+++ b/tests/guix-system.sh
@@ -318,7 +318,7 @@ cat > "$tmpdir/config.scm" <<EOF
318 318
319(bad-local-file "whatever.scm") 319(bad-local-file "whatever.scm")
320EOF 320EOF
321! guix system build "$tmpdir/config.scm" -n 321guix system build "$tmpdir/config.scm" -n && false
322guix system build "$tmpdir/config.scm" -n 2>&1 | \ 322guix system build "$tmpdir/config.scm" -n 2>&1 | \
323 grep "config\.scm:4:2: warning:.*whatever.*relative to current directory" 323 grep "config\.scm:4:2: warning:.*whatever.*relative to current directory"
324 324