diff options
| author | Eric Bavier <bavier@posteo.net> | 2023-04-20 00:11:27 -0500 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2023-04-21 16:16:38 +0200 |
| commit | 37dd69b44511dc73eb04bdebe8d82c9a0386338e (patch) | |
| tree | d20ecc2b15659ed2345f00beb39170a5365a7051 | |
| parent | a09c7da8f8d8e732f969cf0a09aaa78f87032ab1 (diff) | |
tests: Fix checks for expected failures.
Addresses <https://issues.guix.gnu.org/62406>.
With 'set -e', a return status inverted with '!' does not cause the shell to
exit immediately. Instead use '&& false' to indicate an expected failure.
* tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh,
tests/guix-daemon.sh, tests/guix-download.sh,
tests/guix-environment-container.sh, tests/guix-environment.sh,
tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh,
tests/guix-hash.sh, tests/guix-home.sh, tests/guix-pack-relocatable.sh,
tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh,
tests/guix-package.sh, tests/guix-refresh.sh, tests/guix-shell.sh,
tests/guix-style.sh, tests/guix-system.sh: Replace uses of '! ...' with
'... && false' or `test ! ...` as appropriate.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| -rw-r--r-- | tests/guix-archive.sh | 8 | ||||
| -rw-r--r-- | tests/guix-build-branch.sh | 4 | ||||
| -rw-r--r-- | tests/guix-build.sh | 22 | ||||
| -rw-r--r-- | tests/guix-daemon.sh | 2 | ||||
| -rw-r--r-- | tests/guix-download.sh | 10 | ||||
| -rw-r--r-- | tests/guix-environment-container.sh | 7 | ||||
| -rw-r--r-- | tests/guix-environment.sh | 6 | ||||
| -rw-r--r-- | tests/guix-gc.sh | 18 | ||||
| -rw-r--r-- | tests/guix-git-authenticate.sh | 8 | ||||
| -rw-r--r-- | tests/guix-graph.sh | 6 | ||||
| -rw-r--r-- | tests/guix-hash.sh | 11 | ||||
| -rw-r--r-- | tests/guix-home.sh | 14 | ||||
| -rw-r--r-- | tests/guix-pack-relocatable.sh | 2 | ||||
| -rw-r--r-- | tests/guix-pack.sh | 4 | ||||
| -rw-r--r-- | tests/guix-package-aliases.sh | 12 | ||||
| -rw-r--r-- | tests/guix-package-net.sh | 22 | ||||
| -rw-r--r-- | tests/guix-package.sh | 46 | ||||
| -rw-r--r-- | tests/guix-refresh.sh | 6 | ||||
| -rw-r--r-- | tests/guix-shell.sh | 10 | ||||
| -rw-r--r-- | tests/guix-style.sh | 6 | ||||
| -rw-r--r-- | tests/guix-system.sh | 2 |
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. |
| 45 | guix archive --import < "$archive" | 45 | guix archive --import < "$archive" |
| 46 | 46 | ||
| 47 | ! guix archive something-that-does-not-exist | 47 | guix 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. |
| 50 | guix build guile-bootstrap > "$archive" | 50 | guix 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. |
| 63 | echo something invalid > "$archive" | 63 | echo something invalid > "$archive" |
| 64 | ! guix archive --missing < "$archive" | 64 | guix archive --missing < "$archive" && false |
| 65 | 65 | ||
| 66 | # Check '--extract'. | 66 | # Check '--extract'. |
| 67 | guile -c "(use-modules (guix serialization)) | 67 | guile -c "(use-modules (guix serialization)) |
| @@ -77,4 +77,6 @@ guix archive -t < "$archive" | grep "^D /share/guile" | |||
| 77 | guix archive -t < "$archive" | grep "^x /bin/guile" | 77 | guix archive -t < "$archive" | grep "^x /bin/guile" |
| 78 | guix archive -t < "$archive" | grep "^r /share/guile.*/boot-9\.scm" | 78 | guix archive -t < "$archive" | grep "^r /share/guile.*/boot-9\.scm" |
| 79 | 79 | ||
| 80 | ! echo foo | guix archive --authorize | 80 | echo foo | guix archive --authorize && false |
| 81 | |||
| 82 | exit 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 | |||
| 58 | test "$v0_1_0_drv" != "$latest_drv" | 58 | test "$v0_1_0_drv" != "$latest_drv" |
| 59 | test "$v0_1_0_drv" != "$orig_drv" | 59 | test "$v0_1_0_drv" != "$orig_drv" |
| 60 | 60 | ||
| 61 | ! guix build guix --with-commit=guile-gcrypt=000 -d | 61 | guix build guix --with-commit=guile-gcrypt=000 -d && false |
| 62 | |||
| 63 | exit 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 @@ | |||
| 25 | guix build --version | 25 | guix build --version |
| 26 | 26 | ||
| 27 | # Should fail. | 27 | # Should fail. |
| 28 | ! guix build -e + | 28 | guix 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. |
| 31 | guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S | 31 | guix 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 |
| 94 | EOF | 94 | EOF |
| 95 | ! guix build -f "$module_dir/foo.scm" 2> "$module_dir/stderr" | 95 | guix build -f "$module_dir/foo.scm" 2> "$module_dir/stderr" && false |
| 96 | grep "read error" "$module_dir/stderr" | 96 | grep "read error" "$module_dir/stderr" |
| 97 | rm "$module_dir/stderr" "$module_dir/foo.scm" | 97 | rm "$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 |
| 200 | EOF | 200 | EOF |
| 201 | 201 | ||
| 202 | ! guix build package-with-something-wrong -n | 202 | guix build package-with-something-wrong -n && false |
| 203 | guix build package-with-something-wrong -n 2> "$module_dir/err" || true | 203 | guix build package-with-something-wrong -n 2> "$module_dir/err" || true |
| 204 | grep "unbound" "$module_dir/err" # actual error | 204 | grep "unbound" "$module_dir/err" # actual error |
| 205 | grep "forget.*(gnu packages base)" "$module_dir/err" # hint | 205 | grep "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) |
| 242 | EOF | 242 | EOF |
| 243 | ! guix build -f "$module_dir/cc-user.scm" -n 2> "$module_dir/err" | 243 | guix build -f "$module_dir/cc-user.scm" -n 2> "$module_dir/err" && false |
| 244 | cat "$module_dir/err" | 244 | cat "$module_dir/err" |
| 245 | grep "make-thing.*unbound" "$module_dir/err" # actual error | 245 | grep "make-thing.*unbound" "$module_dir/err" # actual error |
| 246 | grep "forget.*(bb-public)" "$module_dir/err" # hint | 246 | grep "forget.*(bb-public)" "$module_dir/err" # hint |
| @@ -270,7 +270,7 @@ test "`guix build --log-file guile-bootstrap`" = "$log" | |||
| 270 | test "`guix build --log-file $out`" = "$log" | 270 | test "`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 | 273 | guix 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. |
| 276 | result="t-result-$$" | 276 | result="t-result-$$" |
| @@ -279,7 +279,7 @@ guix build -r "$result" \ | |||
| 279 | test -x "$result/bin/guile" | 279 | test -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)' | 282 | guix build -r "$result" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' && false |
| 283 | 283 | ||
| 284 | rm -f "$result" | 284 | rm -f "$result" |
| 285 | 285 | ||
| @@ -323,7 +323,7 @@ drv2=`guix build hello -d --with-input=gcc=gcc-toolchain` | |||
| 323 | test "$drv1" != "$drv2" | 323 | test "$drv1" != "$drv2" |
| 324 | guix gc -R "$drv2" | grep `guix build -d gcc-toolchain` | 324 | guix gc -R "$drv2" | grep `guix build -d gcc-toolchain` |
| 325 | 325 | ||
| 326 | ! guix build guile --with-input=libunistring=something-really-silly | 326 | guix build guile --with-input=libunistring=something-really-silly && false |
| 327 | 327 | ||
| 328 | # Deprecated/superseded packages. | 328 | # Deprecated/superseded packages. |
| 329 | test "`guix build superseded -d`" = "`guix build bar -d`" | 329 | test "`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. |
| 332 | guix build -n time # PASS | 332 | guix build -n time # PASS |
| 333 | guix build -n time@1.9 # PASS, version found | 333 | guix build -n time@1.9 # PASS, version found |
| 334 | ! guix build -n time@3.2 # FAIL, version not found | 334 | guix build -n time@3.2 && false # FAIL, version not found |
| 335 | ! guix build -n something-that-will-never-exist # FAIL | 335 | guix build -n something-that-will-never-exist && false # FAIL |
| 336 | 336 | ||
| 337 | # Invoking a monadic procedure. | 337 | # Invoking a monadic procedure. |
| 338 | guix build -e "(begin | 338 | guix build -e "(begin |
| @@ -404,4 +404,6 @@ export GUIX_BUILD_OPTIONS | |||
| 404 | guix build emacs | 404 | guix build emacs |
| 405 | 405 | ||
| 406 | GUIX_BUILD_OPTIONS="--something-completely-crazy" | 406 | GUIX_BUILD_OPTIONS="--something-completely-crazy" |
| 407 | ! guix build emacs | 407 | guix build emacs && false |
| 408 | |||
| 409 | exit 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=$! | |||
| 224 | GUIX_DAEMON_SOCKET="guix://$tcp_socket" | 224 | GUIX_DAEMON_SOCKET="guix://$tcp_socket" |
| 225 | export GUIX_DAEMON_SOCKET | 225 | export GUIX_DAEMON_SOCKET |
| 226 | 226 | ||
| 227 | ! guix gc | 227 | guix gc && false |
| 228 | 228 | ||
| 229 | unset GUIX_DAEMON_SOCKET | 229 | unset GUIX_DAEMON_SOCKET |
| 230 | kill "$daemon_pid" | 230 | kill "$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 @@ | |||
| 23 | guix download --version | 23 | guix download --version |
| 24 | 24 | ||
| 25 | # Make sure it fails here. | 25 | # Make sure it fails here. |
| 26 | ! guix download http://does.not/exist | 26 | guix download http://does.not/exist && false |
| 27 | 27 | ||
| 28 | ! guix download unknown://some/where; | 28 | guix download unknown://some/where && false |
| 29 | 29 | ||
| 30 | ! guix download /does-not-exist | 30 | guix download /does-not-exist && false |
| 31 | 31 | ||
| 32 | # This one should succeed. | 32 | # This one should succeed. |
| 33 | guix download "file://$abs_top_srcdir/README" | 33 | guix download "file://$abs_top_srcdir/README" |
| @@ -43,4 +43,6 @@ GUIX_DAEMON_SOCKET="/nowhere" guix download -o "$output" \ | |||
| 43 | cmp "$output" "$abs_top_srcdir/README" | 43 | cmp "$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" | 46 | guix download "file:///does-not-exist" "file://$abs_top_srcdir/README" && false |
| 47 | |||
| 48 | exit 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 | 263 | guix 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 | 266 | guix shell --bootstrap -CS bin/guile=/usr/bin/guile guile-bootstrap -- exit && false |
| 267 | 267 | ||
| 268 | # Check whether '--nesting' works. | 268 | # Check whether '--nesting' works. |
| 269 | guix build hello -d | 269 | guix build hello -d |
| 270 | env="$(type -P pre-inst-env)" | 270 | env="$(type -P pre-inst-env)" |
| 271 | if guix shell -C -D guix -- "$env" guix build hello -d # cannot work | 271 | guix shell -C -D guix -- "$env" guix build hello -d && false # cannot work |
| 272 | then false; else true; fi | ||
| 273 | hello_drv="$(guix build hello -d)" | 272 | hello_drv="$(guix build hello -d)" |
| 274 | hello_drv_nested="$(cd "$(dirname env)" && guix shell --bootstrap -CW -D guix -- "$env" guix build hello -d)" | 273 | hello_drv_nested="$(cd "$(dirname env)" && guix shell --bootstrap -CW -D guix -- "$env" guix build hello -d)" |
| 275 | test "$hello_drv" = "$hello_drv_nested" | 274 | test "$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 \ | |||
| 60 | grep '^PATH=' "$tmpdir/a" | 60 | grep '^PATH=' "$tmpdir/a" |
| 61 | grep '^GUIX_TEST_ABC=' "$tmpdir/a" | 61 | grep '^GUIX_TEST_ABC=' "$tmpdir/a" |
| 62 | grep '^GUIX_TEST_DEF=' "$tmpdir/a" | 62 | grep '^GUIX_TEST_DEF=' "$tmpdir/a" |
| 63 | ! grep '^GUIX_TEST_XYZ=' "$tmpdir/a" | 63 | grep '^GUIX_TEST_XYZ=' "$tmpdir/a" && false |
| 64 | 64 | ||
| 65 | # Make sure the exit value is preserved. | 65 | # Make sure the exit value is preserved. |
| 66 | if guix environment --bootstrap --ad-hoc guile-bootstrap --pure \ | 66 | if 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. |
| 37 | for option in "" "-C 500M" "--verify" "--optimize" "--list-roots" | 37 | for option in "" "-C 500M" "--verify" "--optimize" "--list-roots" |
| 38 | do | 38 | do |
| 39 | ! guix gc $option whatever | 39 | guix gc $option whatever && false |
| 40 | done | 40 | done |
| 41 | 41 | ||
| 42 | # This should fail. | 42 | # This should fail. |
| 43 | ! guix gc --verify=foo | 43 | guix gc --verify=foo && false |
| 44 | 44 | ||
| 45 | # Check the references of a .drv. | 45 | # Check the references of a .drv. |
| 46 | drv="`guix build guile-bootstrap -d`" | 46 | drv="`guix build guile-bootstrap -d`" |
| @@ -51,7 +51,7 @@ guix gc --references "$drv" | grep -e -bash | |||
| 51 | guix gc --references "$out" | 51 | guix gc --references "$out" |
| 52 | guix gc --references "$out/bin/guile" | 52 | guix gc --references "$out/bin/guile" |
| 53 | 53 | ||
| 54 | ! guix gc --references /dev/null; | 54 | guix gc --references /dev/null && false |
| 55 | 55 | ||
| 56 | # Check derivers. | 56 | # Check derivers. |
| 57 | guix gc --derivers "$out" | grep "$drv" | 57 | guix gc --derivers "$out" | grep "$drv" |
| @@ -62,7 +62,7 @@ test -f "$drv" | |||
| 62 | 62 | ||
| 63 | guix gc --list-dead | grep "$drv" | 63 | guix gc --list-dead | grep "$drv" |
| 64 | guix gc --delete "$drv" | 64 | guix gc --delete "$drv" |
| 65 | ! test -f "$drv" | 65 | test ! -f "$drv" |
| 66 | 66 | ||
| 67 | # Add a .drv, register it as a root. | 67 | # Add a .drv, register it as a root. |
| 68 | drv="`guix build --root=guix-gc-root lsh -d`" | 68 | drv="`guix build --root=guix-gc-root lsh -d`" |
| @@ -71,18 +71,18 @@ test -f "$drv" && test -L guix-gc-root | |||
| 71 | guix gc --list-roots | grep "$PWD/guix-gc-root" | 71 | guix gc --list-roots | grep "$PWD/guix-gc-root" |
| 72 | 72 | ||
| 73 | guix gc --list-live | grep "$drv" | 73 | guix gc --list-live | grep "$drv" |
| 74 | ! guix gc --delete "$drv"; | 74 | guix gc --delete "$drv" && false |
| 75 | 75 | ||
| 76 | rm guix-gc-root | 76 | rm guix-gc-root |
| 77 | guix gc --list-dead | grep "$drv" | 77 | guix gc --list-dead | grep "$drv" |
| 78 | guix gc --delete "$drv" | 78 | guix gc --delete "$drv" |
| 79 | ! test -f "$drv" | 79 | test ! -f "$drv" |
| 80 | 80 | ||
| 81 | # Try a random collection. | 81 | # Try a random collection. |
| 82 | guix gc -C 1KiB | 82 | guix gc -C 1KiB |
| 83 | 83 | ||
| 84 | # Check trivial error cases. | 84 | # Check trivial error cases. |
| 85 | ! guix gc --delete /dev/null; | 85 | guix gc --delete /dev/null && false |
| 86 | 86 | ||
| 87 | # Bug #19757 | 87 | # Bug #19757 |
| 88 | out="`guix build guile-bootstrap`" | 88 | out="`guix build guile-bootstrap`" |
| @@ -90,14 +90,14 @@ test -d "$out" | |||
| 90 | 90 | ||
| 91 | guix gc --delete "$out" | 91 | guix gc --delete "$out" |
| 92 | 92 | ||
| 93 | ! test -d "$out" | 93 | test ! -d "$out" |
| 94 | 94 | ||
| 95 | out="`guix build guile-bootstrap`" | 95 | out="`guix build guile-bootstrap`" |
| 96 | test -d "$out" | 96 | test -d "$out" |
| 97 | 97 | ||
| 98 | guix gc --delete "$out/" | 98 | guix gc --delete "$out/" |
| 99 | 99 | ||
| 100 | ! test -d "$out" | 100 | test ! -d "$out" |
| 101 | 101 | ||
| 102 | out="`guix build guile-bootstrap`" | 102 | out="`guix build guile-bootstrap`" |
| 103 | test -d "$out" | 103 | test -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" | |||
| 35 | cache_key="test-$$" | 35 | cache_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" \ | 38 | guix 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" \ | 62 | guix 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'. |
| 66 | guix git authenticate "$v1_0_0_commit" "$v1_0_0_signer" \ | 66 | guix 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 | |||
| 59 | guix graph -e '(@ (gnu packages bootstrap) %bootstrap-guile)' \ | 59 | guix graph -e '(@ (gnu packages bootstrap) %bootstrap-guile)' \ |
| 60 | | grep guile-bootstrap | 60 | | grep guile-bootstrap |
| 61 | 61 | ||
| 62 | ! guix graph -e + | 62 | guix 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. |
| 77 | guix graph git | grep 'label = "openssl' | 77 | guix graph git | grep 'label = "openssl' |
| 78 | guix graph git --with-input=openssl=libressl | grep 'label = "libressl' | 78 | guix graph git --with-input=openssl=libressl | grep 'label = "libressl' |
| 79 | ! guix graph git --with-input=openssl=libressl | grep 'label = "openssl' | 79 | guix graph git --with-input=openssl=libressl | grep 'label = "openssl' && false |
| 80 | 80 | ||
| 81 | # Try --load-path | 81 | # Try --load-path |
| 82 | guix graph -L $module_dir dummy | grep 'label = "dummy' | 82 | guix 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 | 85 | guix graph --path emacs vim && false |
| 86 | 86 | ||
| 87 | path="\ | 87 | path="\ |
| 88 | emacs | 88 | emacs |
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=" | |||
| 38 | test "`guix hash /dev/null "$abs_top_srcdir/README"`" = "`guix hash /dev/null ; guix hash "$abs_top_srcdir/README"`" | 38 | test "`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 | 41 | guix hash && false |
| 42 | 42 | ||
| 43 | # idem as `cat /dev/null | git hash-object --stdin` | 43 | # idem as `cat /dev/null | git hash-object --stdin` |
| 44 | test `guix hash -S git -H sha1 -f hex /dev/null` = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 | 44 | test `guix hash -S git -H sha1 -f hex /dev/null` = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 |
| 45 | 45 | ||
| 46 | ! guix hash -H abcd1234 /dev/null | 46 | guix hash -H abcd1234 /dev/null && false |
| 47 | 47 | ||
| 48 | mkdir "$tmpdir" | 48 | mkdir "$tmpdir" |
| 49 | echo -n executable > "$tmpdir/exe" | 49 | echo -n executable > "$tmpdir/exe" |
| @@ -61,11 +61,11 @@ test `guix hash -r "$tmpdir" 2>/dev/null` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslin | |||
| 61 | test `guix hash -r "$tmpdir" -H sha512 2>/dev/null` = 301ra58c2vahczzxiyfin41mpyb0ljh4dh9zn3ijvwviaw1j40sfzw5skh9x945da88n3785ggifzig7acd6k72h0mpsc20m1f66m9n | 61 | test `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" | 64 | guix 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 | 68 | guix hash -S nar /dev/null && false |
| 69 | 69 | ||
| 70 | # Adding a .git directory | 70 | # Adding a .git directory |
| 71 | mkdir "$tmpdir/.git" | 71 | mkdir "$tmpdir/.git" |
| @@ -80,5 +80,6 @@ test `guix hash -S nar $tmpdir -x` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppi | |||
| 80 | test `guix hash -S git $tmpdir -x` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk | 80 | test `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" | 83 | guix hash "$tmpdir" && false |
| 84 | 84 | ||
| 85 | exit 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"/* |
| 98 | else | 98 | else |
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`" | |||
| 37 | trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT | 37 | trap '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 | 40 | guix pack intelmetool -s armhf-linux -n && false |
| 41 | 41 | ||
| 42 | # Compute the derivation of a pack. | 42 | # Compute the derivation of a pack. |
| 43 | drv="`guix pack coreutils -d --no-grafts`" | 43 | drv="`guix pack coreutils -d --no-grafts`" |
| @@ -48,7 +48,7 @@ guix gc -R "$drv" | grep "`guix build coreutils -d --no-grafts`" | |||
| 48 | drv="`guix pack idutils -d --no-grafts --target=arm-linux-gnueabihf`" | 48 | drv="`guix pack idutils -d --no-grafts --target=arm-linux-gnueabihf`" |
| 49 | guix gc -R "$drv" | \ | 49 | guix 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`" | 51 | guix 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. |
| 54 | guix pack --compression=none --bootstrap guile-bootstrap | 54 | guix 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" | |||
| 36 | test -x "$profile/bin/guile" | 36 | test -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 | 39 | guix install -r guile-bootstrap -p "$profile" --bootstrap && false |
| 40 | test -x "$profile/bin/guile" | 40 | test -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" | |||
| 48 | guix upgrade --version | 48 | guix upgrade --version |
| 49 | guix upgrade -n | 49 | guix upgrade -n |
| 50 | guix upgrade gui.e -n | 50 | guix upgrade gui.e -n |
| 51 | ! guix upgrade foo bar -n; | 51 | guix upgrade foo bar -n && false |
| 52 | 52 | ||
| 53 | guix remove --version | 53 | guix remove --version |
| 54 | guix remove --bootstrap guile-bootstrap -p "$profile" | 54 | guix remove --bootstrap guile-bootstrap -p "$profile" |
| 55 | ! test -x "$profile/bin/guile" | 55 | test ! -x "$profile/bin/guile" |
| 56 | test `guix package -p "$profile" -I | wc -l` -eq 0 | 56 | test `guix package -p "$profile" -I | wc -l` -eq 0 |
| 57 | 57 | ||
| 58 | ! guix remove -p "$profile" this-is-not-installed --bootstrap | 58 | guix remove -p "$profile" this-is-not-installed --bootstrap && false |
| 59 | 59 | ||
| 60 | ! guix remove -i guile-bootstrap -p "$profile" --bootstrap | 60 | guix remove -i guile-bootstrap -p "$profile" --bootstrap && false |
| 61 | 61 | ||
| 62 | guix search '\<board\>' game | grep '^name: gnubg' | 62 | guix search '\<board\>' game | grep '^name: gnubg' |
| 63 | 63 | ||
| @@ -66,7 +66,7 @@ guix show guile | |||
| 66 | guix show python@3 | grep "^name: python" | 66 | guix 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 | 69 | guix show python@2 && false |
| 70 | 70 | ||
| 71 | # Specifying multiple packages. | 71 | # Specifying multiple packages. |
| 72 | output="`guix show sed grep | grep ^name:`" | 72 | output="`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 | ||
| 59 | guix package --bootstrap -p "$profile" -i guile-bootstrap | 59 | guix package --bootstrap -p "$profile" -i guile-bootstrap |
| 60 | test -L "$profile" && test -L "$profile-1-link" | 60 | test -L "$profile" && test -L "$profile-1-link" |
| 61 | ! test -f "$profile-2-link" | 61 | test ! -f "$profile-2-link" |
| 62 | test -f "$profile/bin/guile" | 62 | test -f "$profile/bin/guile" |
| 63 | 63 | ||
| 64 | boot_make="(@ (guix tests) gnu-make-for-tests)" | 64 | boot_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 | 101 | guix package -p "$profile" --list-generations=42 && false |
| 102 | ! guix package -p "$profile" --switch-generation=99 | 102 | guix package -p "$profile" --switch-generation=99 && false |
| 103 | 103 | ||
| 104 | # Remove a package. | 104 | # Remove a package. |
| 105 | guix package --bootstrap -p "$profile" -r "guile-bootstrap" | 105 | guix package --bootstrap -p "$profile" -r "guile-bootstrap" |
| 106 | test -L "$profile-3-link" | 106 | test -L "$profile-3-link" |
| 107 | test -f "$profile/bin/make" && ! test -f "$profile/bin/guile" | 107 | test -f "$profile/bin/make" && test ! -f "$profile/bin/guile" |
| 108 | 108 | ||
| 109 | # Roll back. | 109 | # Roll back. |
| 110 | guix package --roll-back -p "$profile" | 110 | guix package --roll-back -p "$profile" |
| @@ -112,7 +112,7 @@ test "`readlink_base "$profile"`" = "$profile-2-link" | |||
| 112 | test -x "$profile/bin/guile" && test -x "$profile/bin/make" | 112 | test -x "$profile/bin/guile" && test -x "$profile/bin/make" |
| 113 | guix package --roll-back -p "$profile" | 113 | guix package --roll-back -p "$profile" |
| 114 | test "`readlink_base "$profile"`" = "$profile-1-link" | 114 | test "`readlink_base "$profile"`" = "$profile-1-link" |
| 115 | test -x "$profile/bin/guile" && ! test -x "$profile/bin/make" | 115 | test -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. |
| 118 | guix package -p "$profile" --switch-generation=2 | 118 | guix package -p "$profile" --switch-generation=2 |
| @@ -124,8 +124,8 @@ test "`readlink_base "$profile"`" = "$profile-1-link" | |||
| 124 | for i in `seq 1 3` | 124 | for i in `seq 1 3` |
| 125 | do | 125 | do |
| 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" |
| 130 | done | 130 | done |
| 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. |
| 136 | guix package --bootstrap -p "$profile" -e "$boot_make" | 136 | guix package --bootstrap -p "$profile" -e "$boot_make" |
| 137 | test "`readlink_base "$profile"`" = "$profile-1-link" | 137 | test "`readlink_base "$profile"`" = "$profile-1-link" |
| 138 | test -x "$profile/bin/guile" && ! test -x "$profile/bin/make" | 138 | test -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. |
| 141 | test "`guix package -p "$profile" -l 1 | cut -f3 | head -n1`" = "(current)" | 141 | test "`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. |
| 144 | guix package --bootstrap -p "$profile" --roll-back -i guile-bootstrap | 144 | guix package --bootstrap -p "$profile" --roll-back -i guile-bootstrap |
| 145 | test "`readlink_base "$profile"`" = "$profile-1-link" | 145 | test "`readlink_base "$profile"`" = "$profile-1-link" |
| 146 | test -x "$profile/bin/guile" && ! test -x "$profile/bin/make" | 146 | test -x "$profile/bin/guile" && test ! -x "$profile/bin/make" |
| 147 | 147 | ||
| 148 | # Install Make. | 148 | # Install Make. |
| 149 | guix package --bootstrap -p "$profile" -e "$boot_make" | 149 | guix package --bootstrap -p "$profile" -e "$boot_make" |
| @@ -175,7 +175,7 @@ test -z "`guix package -p "$profile" -l 3`" | |||
| 175 | rm "$profile" | 175 | rm "$profile" |
| 176 | guix package --bootstrap -p "$profile" -i guile-bootstrap | 176 | guix package --bootstrap -p "$profile" -i guile-bootstrap |
| 177 | guix package --bootstrap -p "$profile_alt" -i gcc-bootstrap | 177 | guix package --bootstrap -p "$profile_alt" -i gcc-bootstrap |
| 178 | ! guix package -p "$profile" --search-paths | grep LIBRARY_PATH | 178 | guix package -p "$profile" --search-paths | grep LIBRARY_PATH && false |
| 179 | guix package -p "$profile" -p "$profile_alt" --search-paths \ | 179 | guix 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" | |||
| 234 | test -f "$HOME/.guix-profile/bin/make" | 234 | test -f "$HOME/.guix-profile/bin/make" |
| 235 | 235 | ||
| 236 | guix package --bootstrap --roll-back | 236 | guix package --bootstrap --roll-back |
| 237 | ! test -f "$HOME/.guix-profile/bin/make" | 237 | test ! -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" | |||
| 37 | trap 'rm -f "$profile" "$profile.lock" "$profile-"[0-9]* "$tmpfile"; rm -rf "$module_dir" t-home-'"$$" EXIT | 37 | trap '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 + | 40 | guix 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. |
| 58 | guix package --bootstrap -p "$profile" -i guile-bootstrap | 58 | guix package --bootstrap -p "$profile" -i guile-bootstrap |
| 59 | test -L "$profile" && test -L "$profile-1-link" | 59 | test -L "$profile" && test -L "$profile-1-link" |
| 60 | ! test -f "$profile-2-link" | 60 | test ! -f "$profile-2-link" |
| 61 | test -f "$profile/bin/guile" | 61 | test -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 | 64 | guix package -e '(begin (use-modules (guix) (gnu packages base)) (package (inherit sed) (supported-systems (list))))' -n && false |
| 65 | case $(uname -m) in | 65 | case $(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;; |
| 72 | esac | 72 | esac |
| 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 | 76 | guix package --bootstrap -n -p "$profile" -i g-wrap guile@2.0 && false |
| 77 | 77 | ||
| 78 | guix package --bootstrap -n -p "$profile" -i g-wrap guile@2.0 \ | 78 | guix 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 | 91 | guix 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. |
| 94 | guix package -p "$profile" --delete-generations=0 | 94 | guix 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. |
| 103 | guix package --bootstrap -i "guile-bootstrap:out" -p "$profile" -n | 103 | guix package --bootstrap -i "guile-bootstrap:out" -p "$profile" -n |
| 104 | ! guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile" -n | 104 | guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile" -n && false |
| 105 | ! guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile" | 105 | guix 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" | 109 | guix 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. |
| 112 | guix package -p "$profile" -A 'gui.*e' | grep guile | 112 | guix package -p "$profile" -A 'gui.*e' | grep guile |
| @@ -118,8 +118,8 @@ guix package --show=guile | grep "^name: guile" | |||
| 118 | guix package --show=texlive | 118 | guix 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 | 121 | guix package --show=does-not-exist && false |
| 122 | ! guix package --show=emacs@42 | 122 | guix package --show=emacs@42 && false |
| 123 | 123 | ||
| 124 | # Search. | 124 | # Search. |
| 125 | LC_MESSAGES=C | 125 | LC_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. |
| 165 | generation="`readlink_base "$profile"`" | 165 | generation="`readlink_base "$profile"`" |
| 166 | ! guix package -p "$profile" --delete-generations=12m | 166 | guix package -p "$profile" --delete-generations=12m && false |
| 167 | test "`readlink_base "$profile"`" = "$generation" | 167 | test "`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. |
| 172 | guix package --list-generations -p "$profile" | 172 | guix package --list-generations -p "$profile" |
| 173 | ! guix package --bootstrap -p "$profile" --delete-generations=1.. | 173 | guix package --bootstrap -p "$profile" --delete-generations=1.. && false |
| 174 | test "`readlink_base "$profile"`" = "$generation" | 174 | test "`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. |
| 177 | real_profile="`readlink -f "$profile"`" | 177 | real_profile="`readlink -f "$profile"`" |
| 178 | ! guix gc -d "$real_profile" | 178 | guix gc -d "$real_profile" && false |
| 179 | test -d "$real_profile" | 179 | test -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`" |
| 284 | done | 284 | done |
| 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" | 288 | test ! -e "$HOME/.guix-profile-0-link" |
| 289 | ! test -e "$HOME/.guix-profile-1-link" | 289 | test ! -e "$HOME/.guix-profile-1-link" |
| 290 | guix package --bootstrap -p "$HOME/.guix-profile" -i guile-bootstrap | 290 | guix package --bootstrap -p "$HOME/.guix-profile" -i guile-bootstrap |
| 291 | ! test -e "$HOME/.guix-profile-1-link" | 291 | test ! -e "$HOME/.guix-profile-1-link" |
| 292 | guix package --bootstrap --roll-back -p "$HOME/.guix-profile" | 292 | guix package --bootstrap --roll-back -p "$HOME/.guix-profile" |
| 293 | ! test -e "$HOME/.guix-profile-0-link" | 293 | test ! -e "$HOME/.guix-profile-0-link" |
| 294 | 294 | ||
| 295 | # Extraneous argument. | 295 | # Extraneous argument. |
| 296 | ! guix package install foo-bar | 296 | guix 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* |
| 384 | EOF | 384 | EOF |
| 385 | ! guix package --bootstrap --install-from-file="$module_dir/package.scm" | 385 | guix package --bootstrap --install-from-file="$module_dir/package.scm" && false |
| 386 | 386 | ||
| 387 | rm "$module_dir/package.scm" | 387 | rm "$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 | 40 | guix refresh -t test idutils && false |
| 41 | case "$(guix refresh -t test idutils 2>&1)" in | 41 | case "$(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;; |
| 44 | esac | 44 | esac |
| 45 | ! guix refresh -t test libreoffice | 45 | guix refresh -t test libreoffice && false |
| 46 | case "$(guix refresh -t test libreoffice 2>&1)" in | 46 | case "$(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" | |||
| 100 | grep "$(guix hash -H sha256 -f nix-base32 "$module_dir/source")" "$module_dir/sample.scm" | 100 | grep "$(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 | 103 | guix refresh -t test guile=2.0.0 && false |
| 104 | case "$(guix refresh -t test guile=2.0.0 2>&1)" in | 104 | case "$(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 | |||
| 33 | guix shell --bootstrap --pure guile-bootstrap -- guile --version | 33 | guix 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 | 36 | guix 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 | 39 | guix shell --ad-hoc guile-bootstrap && false |
| 40 | 40 | ||
| 41 | # Rejecting unsupported packages. | 41 | # Rejecting unsupported packages. |
| 42 | ! guix shell -s armhf-linux intelmetool -n | 42 | guix 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)" | |||
| 55 | cat > "$tmpdir/guix.scm" <<EOF | 55 | cat > "$tmpdir/guix.scm" <<EOF |
| 56 | This is a broken guix.scm file. | 56 | This is a broken guix.scm file. |
| 57 | EOF | 57 | EOF |
| 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 |
| 59 | grep "not authorized" "$tmpdir/stderr" | 59 | grep "not authorized" "$tmpdir/stderr" |
| 60 | rm "$tmpdir/stderr" | 60 | rm "$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" | |||
| 65 | initial_hash="$(guix hash "$tmpfile")" | 65 | initial_hash="$(guix hash "$tmpfile")" |
| 66 | 66 | ||
| 67 | guix style -f "$tmpfile" | 67 | guix style -f "$tmpfile" |
| 68 | if ! test "$initial_hash" = "$(guix hash "$tmpfile")" | 68 | if test "$initial_hash" != "$(guix hash "$tmpfile")" |
| 69 | then | 69 | then |
| 70 | cat "$tmpfile" | 70 | cat "$tmpfile" |
| 71 | diff -u "$tmpfile.bak" "$tmpfile" | 71 | diff -u "$tmpfile.bak" "$tmpfile" |
| @@ -73,8 +73,8 @@ then | |||
| 73 | fi | 73 | fi |
| 74 | 74 | ||
| 75 | # Introduce random changes and try again. | 75 | # Introduce random changes and try again. |
| 76 | sed -i "$tmpfile" -e's/ +/ /g' | 76 | sed -i "$tmpfile" -e's/ \+/ /g' |
| 77 | ! test "$initial_hash" = "$(guix hash "$tmpfile")" | 77 | test "$initial_hash" != "$(guix hash "$tmpfile")" |
| 78 | 78 | ||
| 79 | guix style -f "$tmpfile" | 79 | guix style -f "$tmpfile" |
| 80 | test "$initial_hash" = "$(guix hash "$tmpfile")" | 80 | test "$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") |
| 320 | EOF | 320 | EOF |
| 321 | ! guix system build "$tmpdir/config.scm" -n | 321 | guix system build "$tmpdir/config.scm" -n && false |
| 322 | guix system build "$tmpdir/config.scm" -n 2>&1 | \ | 322 | guix 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 | ||
