test/system: Fix typos in conditional expressions

'[' is a command that's the same as 'test' and they might be implemented
as standalone executables or shell built-ins.  Therefore, the negation
(ie., '!') has to cover the entire command to operate on its exit code.
Instead, if it's writtten as '[ ! ... ]', then the negation becomes an
argument to '[', which isn't the same thing.

Fallout from 54a2ca1ead

https://github.com/containers/toolbox/pull/1341
This commit is contained in:
Debarshi Ray 2023-07-13 21:48:31 +02:00
parent c846b6d844
commit 21299a3c5b

View file

@ -86,7 +86,7 @@ function _pull_and_cache_distro_image() {
distro="$1"
version="$2"
if [ ! -v IMAGES[$distro] ]; then
if ! [ -v IMAGES[$distro] ]; then
fail "Requested distro (${distro}) does not have a matching image"
fi
@ -302,7 +302,7 @@ function pull_distro_image() {
distro="$1"
version="$2"
if [ ! -v IMAGES[$distro] ]; then
if ! [ -v IMAGES[$distro] ]; then
fail "Requested distro (${distro}) does not have a matching image"
fi