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 /tests/guix-package-net.sh | |
| 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>
Diffstat (limited to 'tests/guix-package-net.sh')
| -rw-r--r-- | tests/guix-package-net.sh | 22 |
1 files changed, 11 insertions, 11 deletions
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" |
