summaryrefslogtreecommitdiff
path: root/tests/guix-package-net.sh
diff options
context:
space:
mode:
authorEric Bavier <bavier@posteo.net>2023-04-20 00:11:27 -0500
committerLudovic Courtès <ludo@gnu.org>2023-04-21 16:16:38 +0200
commit37dd69b44511dc73eb04bdebe8d82c9a0386338e (patch)
treed20ecc2b15659ed2345f00beb39170a5365a7051 /tests/guix-package-net.sh
parenta09c7da8f8d8e732f969cf0a09aaa78f87032ab1 (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.sh22
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
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"