From: Christian Goeschel Ndjomouo Date: Fri, 10 Apr 2026 17:47:30 +0000 (-0400) Subject: tests: directly check exitcode for stability and code simplicity X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=da23c4a8d2d1405bc99761d195659bd994e7ca87;p=thirdparty%2Futil-linux.git tests: directly check exitcode for stability and code simplicity Signed-off-by: Christian Goeschel Ndjomouo --- diff --git a/tests/run.sh b/tests/run.sh index 3d26bea31..52a463599 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -245,11 +245,10 @@ fi mkdir -p "$top_builddir"/tests/ >| $top_builddir/tests/failures -printf "%s\n" ${comps[*]} | - sort | - xargs -I '{}' -P $paraller_jobs -n 1 bash -c "'{}' \"$OPTS\" || - echo '{}' >> $top_builddir/tests/failures" -if [ $? != 0 ]; then + +if ! printf "%s\n" "${comps[@]}" | sort | xargs -I '{}' -P $paraller_jobs -n 1 bash -c "'{}' \"$OPTS\" \ + || echo '{}' >> $top_builddir/tests/failures"; then + echo "xargs error" >&2 exit 1 fi diff --git a/tests/ts/blkdiscard/offsets b/tests/ts/blkdiscard/offsets index 89925bc42..a74d1171b 100755 --- a/tests/ts/blkdiscard/offsets +++ b/tests/ts/blkdiscard/offsets @@ -51,6 +51,7 @@ if [ "$?" != "0" ]; then grep -q "BLKDISCARD ioctl failed: Operation not supported" "$TS_ERRLOG" \ && ts_skip "BLKDISCARD not supported" fi + run_tscmd $TS_CMD_BLKDISCARD -v --offset 1 $DEVICE run_tscmd $TS_CMD_BLKDISCARD -v -o 511 $DEVICE run_tscmd $TS_CMD_BLKDISCARD -v -o 512 $DEVICE diff --git a/tests/ts/choom/choom b/tests/ts/choom/choom index 054c87cc4..f333ed286 100755 --- a/tests/ts/choom/choom +++ b/tests/ts/choom/choom @@ -30,9 +30,7 @@ oom_score_adj=$("$TS_CMD_CHOOM" --pid $PID \ (( oom_score_adj++ )) -"$TS_CMD_CHOOM" --pid $PID --adjust $oom_score_adj &>/dev/null - -if [[ "$?" != 0 ]]; then +if ! "$TS_CMD_CHOOM" --pid $PID --adjust $oom_score_adj &>/dev/null; then ts_failed "OOM adjust score change failed" fi @@ -44,4 +42,4 @@ if (( "$new_oom_score_adj" == "$oom_score_adj" )); then echo "ok" >> "$TS_OUTPUT" fi -ts_finalize \ No newline at end of file +ts_finalize diff --git a/tests/ts/chrt/chrt b/tests/ts/chrt/chrt index eaa0a90d5..f31f54eaf 100755 --- a/tests/ts/chrt/chrt +++ b/tests/ts/chrt/chrt @@ -38,8 +38,7 @@ function skip_policy { } function skip_kernel_lt { - ts_kernel_ver_lt $1 $2 $3 - if [ $? == 0 ]; then + if ts_kernel_ver_lt $1 $2 $3; then ts_skip_subtest "kernel version must be >= $1.$2.$3" return 1 fi @@ -63,8 +62,7 @@ function cleanup_output { ts_init_subtest "fifo" -skip_policy SCHED_FIFO -if [ $? == 0 ]; then +if skip_policy SCHED_FIFO; then do_chrt --fifo 1 do_chrt --fifo 99 cleanup_output @@ -73,8 +71,7 @@ fi ts_init_subtest "batch" -skip_policy SCHED_BATCH && skip_kernel_ge 6 12 0 -if [ $? == 0 ]; then +if skip_policy SCHED_BATCH && skip_kernel_ge 6 12 0; then do_chrt --batch 0 cleanup_output ts_finalize_subtest @@ -82,8 +79,7 @@ fi ts_init_subtest "batch-custom-slice" -skip_policy SCHED_BATCH && skip_kernel_lt 6 12 0 -if [ $? == 0 ]; then +if skip_policy SCHED_BATCH && skip_kernel_lt 6 12 0; then do_chrt --batch --sched-runtime 100000 0 cleanup_output ts_finalize_subtest @@ -91,8 +87,7 @@ fi ts_init_subtest "other" -skip_policy SCHED_OTHER && skip_kernel_ge 6 12 0 -if [ $? == 0 ]; then +if skip_policy SCHED_OTHER && skip_kernel_ge 6 12 0; then do_chrt --other 0 cleanup_output ts_finalize_subtest @@ -100,8 +95,7 @@ fi ts_init_subtest "other-custom-slice" -skip_policy SCHED_OTHER && skip_kernel_lt 6 12 0 -if [ $? == 0 ]; then +if skip_policy SCHED_OTHER && skip_kernel_lt 6 12 0; then do_chrt --other --sched-runtime 100000 0 cleanup_output ts_finalize_subtest @@ -109,8 +103,7 @@ fi ts_init_subtest "rr" -skip_policy SCHED_RR -if [ $? == 0 ]; then +if skip_policy SCHED_RR; then do_chrt --rr 1 do_chrt --rr 99 cleanup_output @@ -119,8 +112,7 @@ fi ts_init_subtest "idle" -skip_policy SCHED_IDLE -if [ $? == 0 ]; then +if skip_policy SCHED_IDLE; then do_chrt --idle 0 cleanup_output ts_finalize_subtest @@ -128,8 +120,7 @@ fi ts_init_subtest "deadline" -skip_policy SCHED_DEADLINE -if [ $? == 0 ]; then +if skip_policy SCHED_DEADLINE; then do_chrt --deadline --sched-period 130000 0 do_chrt --deadline --sched-period 130000 --sched-deadline 120000 0 do_chrt --deadline --sched-period 130000 --sched-deadline 120000 --sched-runtime 100000 0 @@ -138,8 +129,7 @@ if [ $? == 0 ]; then fi ts_init_subtest "ext" -skip_policy SCHED_EXT -if [ $? == 0 ]; then +if skip_policy SCHED_EXT; then do_chrt --ext 0 do_chrt -e 0 cleanup_output diff --git a/tests/ts/copyfilerange/copyfilerange b/tests/ts/copyfilerange/copyfilerange index 0cc05e0a4..5d487738b 100755 --- a/tests/ts/copyfilerange/copyfilerange +++ b/tests/ts/copyfilerange/copyfilerange @@ -34,8 +34,7 @@ cat b >>"$TS_OUTPUT" ts_finalize_subtest ts_init_subtest "invalid-input" -"$TS_CMD_COPYFILERANGE" a b 3:bogus:1 bogus::2 :::: bogus svhhs:%%:8 &>/dev/null -if [[ "$?" != "0" ]]; then +if ! "$TS_CMD_COPYFILERANGE" a b 3:bogus:1 bogus::2 :::: bogus svhhs:%%:8 &>/dev/null; then echo "ok" >"$TS_OUTPUT" fi ts_finalize_subtest diff --git a/tests/ts/cramfs/mkfs b/tests/ts/cramfs/mkfs index a63134941..7cffb535f 100755 --- a/tests/ts/cramfs/mkfs +++ b/tests/ts/cramfs/mkfs @@ -98,8 +98,7 @@ DEVICE=$($TS_CMD_LOSETUP --show -f $IMAGE_PATH) ts_register_loop_device "$DEVICE" ts_log "check the image" -ts_device_has "TYPE" "cramfs" $DEVICE -[ "$?" == "0" ] || ts_die "Cannot find cramfs on $DEVICE" +ts_device_has "TYPE" "cramfs" $DEVICE || ts_die "Cannot find cramfs on $DEVICE" ts_log "mount the image" ts_mount "cramfs" -r -L $LABEL $TS_MOUNTPOINT diff --git a/tests/ts/getopt/basic b/tests/ts/getopt/basic index 8fbe44209..58635e515 100755 --- a/tests/ts/getopt/basic +++ b/tests/ts/getopt/basic @@ -23,9 +23,14 @@ ts_init "$*" ts_check_test_command "$TS_CMD_GETOPT" -TEMP=$($TS_CMD_GETOPT -o ab:c:: --long a-long,b-long:,c-long:: -n 'example.bash' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar) -if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi + +if ! TEMP=$($TS_CMD_GETOPT -o ab:c:: --long a-long,b-long:,c-long:: \ + -n 'example.bash' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar); +then + echo "Terminating..." >&2 + exit 1 ; +fi eval set -- "$TEMP" diff --git a/tests/ts/hwclock/systohc b/tests/ts/hwclock/systohc index e6d8e5d38..c1a4c5672 100755 --- a/tests/ts/hwclock/systohc +++ b/tests/ts/hwclock/systohc @@ -80,8 +80,7 @@ diff=$(check_diff_offset $OFFSET_A $OFFSET_B 0.02) \ || ts_skip "unreliable ntp or sys clock offsets: $NTP_IP $OFFSET_A $OFFSET_B +/-$diff" # hwclock --show should work if we have a hw clock -tmp=$($TS_CMD_HWCLOCK --show 2>&1) -if [ $? != "0" ]; then +if ! tmp=$($TS_CMD_HWCLOCK --show 2>&1); then echo "$tmp" | grep -q "Cannot access the Hardware Clock via" \ && ts_skip "no hardware clock found" ts_failed "hwclock --show" diff --git a/tests/ts/kill/options b/tests/ts/kill/options index 8313a6fec..c4151a9bd 100755 --- a/tests/ts/kill/options +++ b/tests/ts/kill/options @@ -40,8 +40,7 @@ try_option() check_test_sigreceive $TEST_PID [ $? -eq 1 ] || echo "${HELPER_SYMLINK##*/} helper did not start" >> "$TS_OUTPUT" - "$TS_CMD_KILL" "$@" $TEST_PID >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" - if [ $? -ne 0 ]; then + if ! "$TS_CMD_KILL" "$@" $TEST_PID >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"; then echo "kill $@ did not work" >> "$TS_OUTPUT" all_ok=false fi diff --git a/tests/ts/kill/pidfdino b/tests/ts/kill/pidfdino index 9d6e57ed6..f4c31c804 100755 --- a/tests/ts/kill/pidfdino +++ b/tests/ts/kill/pidfdino @@ -53,8 +53,7 @@ try_option() check_test_sigreceive "${TEST_PID}" [ $? -eq 1 ] || echo "${HELPER_SYMLINK##*/} helper did not start" >> "$TS_OUTPUT" - "$TS_CMD_KILL" "$@" "${TEST_PID}:${TEST_PIDFD_INO}" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" - if [ $? -ne 0 ]; then + if ! "$TS_CMD_KILL" "$@" "${TEST_PID}:${TEST_PIDFD_INO}" >>"$TS_OUTPUT" 2>>"$TS_ERRLOG"; then echo "kill $* did not work" >> "$TS_OUTPUT" all_ok=false fi @@ -78,4 +77,4 @@ if $all_ok; then fi rm -f "$HELPER_SYMLINK" -ts_finalize \ No newline at end of file +ts_finalize diff --git a/tests/ts/kill/print_pid b/tests/ts/kill/print_pid index f97f88d86..abaf08f45 100755 --- a/tests/ts/kill/print_pid +++ b/tests/ts/kill/print_pid @@ -38,8 +38,7 @@ TEST_PID=$! check_test_sigreceive $TEST_PID [ $? -eq 1 ] || echo "${HELPER_SYMLINK##*/} helper did not start" >> "$TS_OUTPUT" -KILL_PID=$("$TS_CMD_KILL" -p ${HELPER_SYMLINK##*/} 2>> "$TS_OUTPUT" 2>> "$TS_ERRLOG") -if [ $? -ne 0 ]; then +if ! KILL_PID=$("$TS_CMD_KILL" -p "${HELPER_SYMLINK##*/}" 2>> "$TS_ERRLOG"); then echo "kill -p did not work" >> "$TS_OUTPUT" all_ok=false fi diff --git a/tests/ts/kill/queue b/tests/ts/kill/queue index 0a7d5d26a..5f89d6e23 100755 --- a/tests/ts/kill/queue +++ b/tests/ts/kill/queue @@ -38,8 +38,8 @@ TEST_PID=$! check_test_sigreceive $TEST_PID [ $? -eq 1 ] || echo "${HELPER_SYMLINK##*/} helper did not start" >> "$TS_OUTPUT" -"$TS_CMD_KILL" -1 --queue 42 $TEST_PID >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -if [ $? -ne 0 ]; then + +if ! "$TS_CMD_KILL" -1 --queue 42 $TEST_PID >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"; then echo "kill --queue 42 failed" >> "$TS_OUTPUT" all_ok=false fi diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context index 8ed878068..4046e6703 100755 --- a/tests/ts/libmount/context +++ b/tests/ts/libmount/context @@ -48,8 +48,7 @@ DEVICE="${TS_DEVICE}1" udevadm settle -grep -q " $DEVNAME\$" /proc/partitions -if [ $? -ne 0 ]; then +if ! grep -q " $DEVNAME\$" /proc/partitions; then ts_skip "no partition!" fi diff --git a/tests/ts/libmount/context-py b/tests/ts/libmount/context-py index 862ca0de1..4c6d182b2 100755 --- a/tests/ts/libmount/context-py +++ b/tests/ts/libmount/context-py @@ -57,8 +57,7 @@ DEVICE="${TS_DEVICE}1" udevadm settle -grep -q " $DEVNAME\$" /proc/partitions -if [ $? -ne 0 ]; then +if ! grep -q " $DEVNAME\$" /proc/partitions; then ts_skip "no partition!" fi diff --git a/tests/ts/libmount/context-utab b/tests/ts/libmount/context-utab index b955c2eb9..e431b0722 100755 --- a/tests/ts/libmount/context-utab +++ b/tests/ts/libmount/context-utab @@ -45,8 +45,7 @@ DEVICE="${TS_DEVICE}1" udevadm settle -grep -q " $DEVNAME\$" /proc/partitions -if [ $? -ne 0 ]; then +if ! grep -q " $DEVNAME\$" /proc/partitions; then ts_skip "no partition!" fi diff --git a/tests/ts/libmount/context-utab-py b/tests/ts/libmount/context-utab-py index cf1a0654c..3916f8897 100755 --- a/tests/ts/libmount/context-utab-py +++ b/tests/ts/libmount/context-utab-py @@ -50,8 +50,8 @@ DEVICE="${TS_DEVICE}1" udevadm settle -grep -q " $DEVNAME\$" /proc/partitions -if [ $? -ne 0 ]; then + +if ! grep -q " $DEVNAME\$" /proc/partitions; then ts_skip "no partition!" fi diff --git a/tests/ts/lslogins/checkuser b/tests/ts/lslogins/checkuser index b6b14e0c6..6fa7f29b6 100755 --- a/tests/ts/lslogins/checkuser +++ b/tests/ts/lslogins/checkuser @@ -8,8 +8,8 @@ ts_init "$*" ts_check_prog sqlite3 ts_check_test_command "$TS_CMD_LSLOGINS" -$TS_CMD_LSLOGINS --version|grep "lastlog2" >/dev/null -if [ $? -ne 0 ]; then + +if ! $TS_CMD_LSLOGINS --version|grep "lastlog2" >/dev/null; then ts_skip "lastlog2 not supported" fi diff --git a/tests/ts/lslogins/json_mode b/tests/ts/lslogins/json_mode index 3ca96d395..f70419ad7 100755 --- a/tests/ts/lslogins/json_mode +++ b/tests/ts/lslogins/json_mode @@ -8,8 +8,8 @@ ts_init "$*" ts_check_prog sqlite3 ts_check_test_command "$TS_CMD_LSLOGINS" -$TS_CMD_LSLOGINS --version|grep "lastlog2" >/dev/null -if [ $? -ne 0 ]; then + +if ! $TS_CMD_LSLOGINS --version|grep "lastlog2" >/dev/null; then ts_skip "lastlog2 not supported" fi @@ -29,4 +29,4 @@ $TS_CMD_LSLOGINS --lastlog-file=/dev/null \ --json > "$TS_OUTPUT" rm $DB_FILE -ts_finalize \ No newline at end of file +ts_finalize diff --git a/tests/ts/misc/canonicalize b/tests/ts/misc/canonicalize index d65c79412..94fdb4694 100755 --- a/tests/ts/misc/canonicalize +++ b/tests/ts/misc/canonicalize @@ -27,8 +27,8 @@ grep -q 'nodev[[:space:]]*tmpfs' /proc/filesystems || \ ts_skip_subtest "tmpfs unsupported" mkdir -p $TS_MOUNTPOINT &> /dev/null -$TS_CMD_MOUNT -t tmpfs tmpfs $TS_MOUNTPOINT >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? -eq 0 ] || ts_skip "tmpfs mount failed" +$TS_CMD_MOUNT -t tmpfs tmpfs $TS_MOUNTPOINT >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_skip "tmpfs mount failed" # reuse the same TS_MOUNTPOINT in all subtests BASE=$TS_MOUNTPOINT diff --git a/tests/ts/mount/fallback b/tests/ts/mount/fallback index 8a24634b2..6a2132710 100755 --- a/tests/ts/mount/fallback +++ b/tests/ts/mount/fallback @@ -23,11 +23,10 @@ test_mount_fallback() { mkdir -p "$TS_MOUNTPOINT" "$TS_CMD_ENOSYS" $2 -- "$TS_CMD_MOUNT" --bind "$MY_SOURCE" "$TS_MOUNTPOINT" \ - >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" - [ "$?" = "0" ] || ts_log "error: mount $TS_MOUNTPOINT" + >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" || ts_log "error: mount $TS_MOUNTPOINT" - "$TS_CMD_FINDMNT" --mountpoint "$TS_MOUNTPOINT" &> /dev/null - [ $? -eq 0 ] || ts_die "Not found target (mount failed?)" + "$TS_CMD_FINDMNT" --mountpoint "$TS_MOUNTPOINT" &> /dev/null \ + || ts_die "Not found target (mount failed?)" "$TS_CMD_UMOUNT" "$TS_MOUNTPOINT" || ts_die "Cannot umount $TS_MOUNTPOINT" @@ -72,8 +71,9 @@ ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" $TS_CMD_ENOSYS -s mount_setattr -- \ "$TS_CMD_MOUNT" --options remount,ro "$MOUNTPOINT" \ >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -$TS_CMD_FINDMNT --kernel --mountpoint "$MOUNTPOINT" --options "ro" &> /dev/null -[ "$?" == "0" ] || ts_die "Cannot find read-only in $MOUNTPOINT in /proc/self/mountinfo" +$TS_CMD_FINDMNT --kernel --mountpoint "$MOUNTPOINT" --options "ro" &> /dev/null \ + || ts_die "Cannot find read-only in $MOUNTPOINT in /proc/self/mountinfo" + $TS_CMD_ENOSYS -s mount_setattr -- \ "$TS_CMD_MOUNT" --make-slave "$MOUNTPOINT" \ >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" diff --git a/tests/ts/mount/fstab-all b/tests/ts/mount/fstab-all index 2519230cd..7448557ae 100755 --- a/tests/ts/mount/fstab-all +++ b/tests/ts/mount/fstab-all @@ -85,48 +85,43 @@ ts_finalize_subtest ts_init_subtest "filter-type" -$TS_CMD_MOUNT --all --fstab "${TS_FSTAB}" --types ext4 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_log "mount failed" +$TS_CMD_MOUNT --all --fstab "${TS_FSTAB}" --types ext4 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_log "mount failed" udevadm settle -$TS_CMD_UMOUNT ${MOUNTPOINT}D -[ $? == 0 ] || ts_log "umount failed" +$TS_CMD_UMOUNT ${MOUNTPOINT}D || ts_log "umount failed" ts_finalize_subtest ts_init_subtest "filter-notype" -$TS_CMD_MOUNT --all --fstab "${TS_FSTAB}" --types noext4 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_log "mount failed" +$TS_CMD_MOUNT --all --fstab "${TS_FSTAB}" --types noext4 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_log "mount failed" udevadm settle -$TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C} -[ $? == 0 ] || ts_log "umount failed" +$TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C} || ts_log "umount failed" ts_finalize_subtest ts_init_subtest "filter-option" -$TS_CMD_MOUNT --all --fstab "${TS_FSTAB}" --test-opts ro >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_log "mount failed" +$TS_CMD_MOUNT --all --fstab "${TS_FSTAB}" --test-opts ro >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_log "mount failed" udevadm settle -$TS_CMD_UMOUNT ${MOUNTPOINT}C -[ $? == 0 ] || ts_log "umount failed" +$TS_CMD_UMOUNT ${MOUNTPOINT}C || ts_log "umount failed" ts_finalize_subtest ts_init_subtest "override-option" -$TS_CMD_MOUNT --all --fstab "${TS_FSTAB}" --options ro >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_log "mount failed" +$TS_CMD_MOUNT --all --fstab "${TS_FSTAB}" --options ro >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_log "mount failed" udevadm settle -$TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C,D} -[ $? == 0 ] || ts_log "umount failed" +$TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C,D} || ts_log "umount failed" ts_finalize_subtest ts_init_subtest "relative-path" cd "$TS_OUTDIR" > /dev/null -$TS_CMD_MOUNT --all --fstab $(basename "${TS_FSTAB}") >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_log "mount failed" +$TS_CMD_MOUNT --all --fstab $(basename "${TS_FSTAB}") >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_log "mount failed" udevadm settle -$TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C,D} -[ $? == 0 ] || ts_log "umount failed" +$TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C,D} || ts_log "umount failed" cd - > /dev/null ts_finalize_subtest @@ -143,11 +138,10 @@ echo "${TS_DEVICE}4 /foo/D ext4 rw,defaults 0 0" >> "${TS_FSTAB}" $TS_CMD_MOUNT --all \ --fstab "${TS_FSTAB}" \ --target-prefix $MY_ROOT \ - --options X-mount.mkdir >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_log "mount failed" + --options X-mount.mkdir >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_log "mount failed" udevadm settle -$TS_CMD_UMOUNT $MY_ROOT/foo/{A,B,C,D} -[ $? == 0 ] || ts_log "umount failed" +$TS_CMD_UMOUNT $MY_ROOT/foo/{A,B,C,D} || ts_log "umount failed" ts_finalize_subtest ts_finalize diff --git a/tests/ts/mount/fstab-bind b/tests/ts/mount/fstab-bind index cd47fd122..abcece722 100755 --- a/tests/ts/mount/fstab-bind +++ b/tests/ts/mount/fstab-bind @@ -20,11 +20,11 @@ ts_fstab_add $MY_SOURCE "$TS_MOUNTPOINT" "none" "bind,default,noauto" mkdir -p $MY_SOURCE mkdir -p $TS_MOUNTPOINT -$TS_CMD_MOUNT --fstab "$TS_FSTAB" $TS_MOUNTPOINT >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ "$?" = "0" ] || ts_log "error: mount $TS_MOUNTPOINT" +$TS_CMD_MOUNT --fstab "$TS_FSTAB" $TS_MOUNTPOINT >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_log "error: mount $TS_MOUNTPOINT" -$TS_CMD_FINDMNT --mountpoint "$TS_MOUNTPOINT" &> /dev/null -[ $? -eq 0 ] || ts_die "Not found target (mount failed?)" +$TS_CMD_FINDMNT --mountpoint "$TS_MOUNTPOINT" &> /dev/null \ + || ts_die "Not found target (mount failed?)" $TS_CMD_UMOUNT $TS_MOUNTPOINT || ts_die "Cannot umount $TS_MOUNTPOINT" diff --git a/tests/ts/mount/fstab-broken b/tests/ts/mount/fstab-broken index 75b87876d..ea70001fa 100755 --- a/tests/ts/mount/fstab-broken +++ b/tests/ts/mount/fstab-broken @@ -38,16 +38,16 @@ echo "tmpd $MNT tmpfs" >> "$TS_FSTAB" ts_fstab_close ts_init_subtest "mount" -$TS_CMD_MOUNT --fstab "$TS_FSTAB" $MNT &> /dev/null -[ "$?" = "0" ] || ts_log "error: mount $MNT" -$TS_CMD_FINDMNT --kernel --mountpoint "$MNT" &> /dev/null -if [ "$?" != "0" ]; then +$TS_CMD_MOUNT --fstab "$TS_FSTAB" $MNT &> /dev/null || ts_log "error: mount $MNT" + +if ! $TS_CMD_FINDMNT --kernel --mountpoint "$MNT" &> /dev/null; then ts_log "Cannot find $MNT in /proc/self/mountinfo" else ts_log "OK" fi -$TS_CMD_UMOUNT $MNT &> /dev/null -if [ "$?" = "0" ]; then + + +if $TS_CMD_UMOUNT $MNT &> /dev/null; then # for old systems with mtab and /sbin/mount.tmpfs /bin/umount --fake "$MNT" &> /dev/null else @@ -57,16 +57,16 @@ ts_finalize_subtest ts_init_subtest "mount-all" -$TS_CMD_MOUNT --fstab "$TS_FSTAB" --all &> /dev/null -[ "$?" = "0" ] || ts_log "error: mount -a" -$TS_CMD_FINDMNT --kernel --mountpoint "$MNT" &> /dev/null -if [ "$?" != "0" ]; then +$TS_CMD_MOUNT --fstab "$TS_FSTAB" --all &> /dev/null || ts_log "error: mount -a" + +if ! $TS_CMD_FINDMNT --kernel --mountpoint "$MNT" &> /dev/null; then ts_log "Cannot find $MNT in /proc/self/mountinfo" else ts_log "OK" fi -$TS_CMD_UMOUNT $MNT &> /dev/null -if [ "$?" = "0" ]; then + + +if $TS_CMD_UMOUNT $MNT &> /dev/null; then # for old systems with mtab and /sbin/mount.tmpfs /bin/umount --fake $MNT &> /dev/null else diff --git a/tests/ts/mount/fstab-none b/tests/ts/mount/fstab-none index f7526d19a..9d8981eab 100755 --- a/tests/ts/mount/fstab-none +++ b/tests/ts/mount/fstab-none @@ -17,14 +17,13 @@ ts_fstab_add "none" "$TS_MOUNTPOINT" "tmpfs" "rw,nosuid,nodev,relatime" mkdir -p $TS_MOUNTPOINT -$TS_CMD_MOUNT --fstab "$TS_FSTAB" $TS_MOUNTPOINT >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ "$?" = "0" ] || ts_log "error: mount $TS_MOUNTPOINT" +$TS_CMD_MOUNT --fstab "$TS_FSTAB" $TS_MOUNTPOINT >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_log "error: mount $TS_MOUNTPOINT" -$TS_CMD_FINDMNT --mountpoint "$TS_MOUNTPOINT" &> /dev/null -[ $? -eq 0 ] || ts_die "Not found target (mount failed?)" +$TS_CMD_FINDMNT --mountpoint "$TS_MOUNTPOINT" &> /dev/null || ts_die "Not found target (mount failed?)" -$TS_CMD_FINDMNT --source "none" --mountpoint "$TS_MOUNTPOINT" &> /dev/null -[ $? -eq 0 ] || ts_die "Not found source and target" +$TS_CMD_FINDMNT --source "none" --mountpoint "$TS_MOUNTPOINT" &> /dev/null \ + || ts_die "Not found source and target" $TS_CMD_UMOUNT $TS_MOUNTPOINT || ts_die "Cannot umount $TS_MOUNTPOINT" diff --git a/tests/ts/mount/remount b/tests/ts/mount/remount index d661fb7d4..01d795086 100755 --- a/tests/ts/mount/remount +++ b/tests/ts/mount/remount @@ -48,11 +48,11 @@ grep -E -q "^$DEVICE $TS_MOUNTPOINT" $MTAB_FILE \ # remount $TS_CMD_MOUNT --options remount,ro $TS_MOUNTPOINT &> /dev/null \ - || ts_die "Cannot remount $TS_MOUNTPOINT" + || ts_die "Cannot remount $TS_MOUNTPOINT" # check the remount -$TS_CMD_FINDMNT --kernel --mountpoint "$TS_MOUNTPOINT" --options "ro" &> /dev/null -[ "$?" == "0" ] || ts_die "Cannot find read-only in $TS_MOUNTPOINT in /proc/self/mountinfo" +$TS_CMD_FINDMNT --kernel --mountpoint "$TS_MOUNTPOINT" --options "ro" &> /dev/null \ + || ts_die "Cannot find read-only in $TS_MOUNTPOINT in /proc/self/mountinfo" ts_log "Success" ts_finalize diff --git a/tests/ts/mount/shared-subtree b/tests/ts/mount/shared-subtree index 09779b956..d1e88066d 100755 --- a/tests/ts/mount/shared-subtree +++ b/tests/ts/mount/shared-subtree @@ -17,12 +17,11 @@ ts_check_prog "mkfs.ext2" [ -d $TS_MOUNTPOINT ] || mkdir -p $TS_MOUNTPOINT # bind -$TS_CMD_MOUNT --bind $TS_MOUNTPOINT $TS_MOUNTPOINT &> /dev/null -[ "$?" = "0" ] || ts_die "error: mount --bind" +$TS_CMD_MOUNT --bind $TS_MOUNTPOINT $TS_MOUNTPOINT &> /dev/null || ts_die "error: mount --bind" # check the bind -$TS_CMD_FINDMNT --kernel --mountpoint $TS_MOUNTPOINT &> /dev/null -[ "$?" == "0" ] || ts_die "Cannot find bound $TS_MOUNTPOINT in /proc/self/mountinfo" +$TS_CMD_FINDMNT --kernel --mountpoint $TS_MOUNTPOINT &> /dev/null \ + || ts_die "Cannot find bound $TS_MOUNTPOINT in /proc/self/mountinfo" # use the same mounpoint for all sub-tests MOUNTPOINT="$TS_MOUNTPOINT" diff --git a/tests/ts/mount/special b/tests/ts/mount/special index 8b0cc94d5..6a5b5085d 100755 --- a/tests/ts/mount/special +++ b/tests/ts/mount/special @@ -59,8 +59,7 @@ ts_finalize_subtest ts_init_subtest "missing-options" -grep -q 'nodev[[:space:]]*tmpfs' /proc/filesystems -if [ "$?" == "0" ]; then +if grep -q 'nodev[[:space:]]*tmpfs' /proc/filesystems; then cat > $MOUNTER < "$TS_OUTPUT" udevadm settle - grep -q "$mountpoint" /proc/mounts - if [ "$?" == "0" ]; then + if grep -q "$mountpoint" /proc/mounts; then cat "$LIBMOUNT_UTAB" \ | grep "$mountpoint" \ | sed -e "s|$mountpoint|/mountpoint|g" \ diff --git a/tests/ts/mount/umount-alltargets b/tests/ts/mount/umount-alltargets index 96e071050..95a30158d 100755 --- a/tests/ts/mount/umount-alltargets +++ b/tests/ts/mount/umount-alltargets @@ -15,8 +15,9 @@ ts_check_test_command "$TS_CMD_FDISK" ts_skip_nonroot ts_check_prog "mkfs.ext2" -$TS_CMD_UMOUNT --help | grep -q all-targets -[ $? -eq 1 ] && ts_skip "all-targets unsupported" +if ! $TS_CMD_UMOUNT --help | grep -q all-targets; then + ts_skip "all-targets unsupported" +fi # set global variable TS_DEVICE ts_scsi_debug_init dev_size_mb=50 @@ -87,8 +88,7 @@ MOUNTPOINT=$TS_MOUNTPOINT # ts_init_subtest "all-targets-mnt" multi_mount ${TS_DEVICE}1 $MOUNTPOINT -$TS_CMD_UMOUNT --all-targets ${MOUNTPOINT}1 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_log "umount failed" +$TS_CMD_UMOUNT --all-targets ${MOUNTPOINT}1 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" || ts_log "umount failed" ts_finalize_subtest # @@ -96,8 +96,7 @@ ts_finalize_subtest # ts_init_subtest "all-targets-dev" multi_mount ${TS_DEVICE}1 $MOUNTPOINT -$TS_CMD_UMOUNT --all-targets ${TS_DEVICE}1 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_log "umount failed" +$TS_CMD_UMOUNT --all-targets ${TS_DEVICE}1 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" || ts_log "umount failed" ts_finalize_subtest # @@ -112,8 +111,9 @@ $TS_CMD_MOUNT ${TS_DEVICE}2 ${MOUNTPOINT}1/subA &> /dev/null $TS_CMD_MOUNT ${TS_DEVICE}3 ${MOUNTPOINT}1/subA/subAB &> /dev/null [ -d "${MOUNTPOINT}1/subB" ] || mkdir -p ${MOUNTPOINT}1/subB $TS_CMD_MOUNT ${TS_DEVICE}4 ${MOUNTPOINT}1/subB &> /dev/null -$TS_CMD_UMOUNT --recursive --all-targets ${TS_DEVICE}1 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_log "umount failed" + +$TS_CMD_UMOUNT --recursive --all-targets ${TS_DEVICE}1 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_log "umount failed" ts_finalize_subtest ts_log "Success" diff --git a/tests/ts/mount/umount-recursive b/tests/ts/mount/umount-recursive index 1b0b29fb3..32410263b 100755 --- a/tests/ts/mount/umount-recursive +++ b/tests/ts/mount/umount-recursive @@ -92,16 +92,16 @@ ts_log "F) Mount mountpoint-bind" $TS_CMD_MOUNT --bind $TS_MOUNTPOINT $TS_MOUNTPOINT &> /dev/null udevadm settle -$TS_CMD_UMOUNT --recursive $TS_MOUNTPOINT >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_die "umount failed" +$TS_CMD_UMOUNT --recursive $TS_MOUNTPOINT >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_die "umount failed" # the mountpoint has already been unmounted, so this second call should not fail -$TS_CMD_UMOUNT --graceful $TS_MOUNTPOINT >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_die "--graceful on unmounted mountpoint failed" +$TS_CMD_UMOUNT --graceful $TS_MOUNTPOINT >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_die "--graceful on unmounted mountpoint failed" # non-existent path should not fail with --graceful -$TS_CMD_UMOUNT --graceful /non-existent-path-$$ >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[ $? == 0 ] || ts_die "--graceful on non-existent path failed" +$TS_CMD_UMOUNT --graceful /non-existent-path-$$ >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_die "--graceful on non-existent path failed" ts_log "Success" ts_finalize diff --git a/tests/ts/pipesz/pipesz b/tests/ts/pipesz/pipesz index 0090c5d98..c1f4fa618 100755 --- a/tests/ts/pipesz/pipesz +++ b/tests/ts/pipesz/pipesz @@ -26,53 +26,53 @@ set -o pipefail DEFAULT_PIPE_SIZE=$(($($TS_HELPER_SYSINFO pagesize) * 16)) ts_init_subtest "set-fd-bad" -$TS_CMD_PIPESZ --check --set 4096 --fd 42 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[[ $? -eq 0 ]] && ts_logerr "expected failure" +$TS_CMD_PIPESZ --check --set 4096 --fd 42 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" && ts_logerr "expected failure" ts_finalize_subtest ts_init_subtest "set-fd" -echo -n | $TS_CMD_PIPESZ --check --set 4096 --stdin >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[[ $? -ne 0 ]] && ts_logerr "expected success" +echo -n | $TS_CMD_PIPESZ --check --set 4096 --stdin >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_logerr "expected success" ts_finalize_subtest ts_init_subtest "set-file-bad" -$TS_CMD_PIPESZ --check --set 4096 --file "/dev/null" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[[ $? -eq 0 ]] && ts_logerr "expected failure" +$TS_CMD_PIPESZ --check --set 4096 --file "/dev/null" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + && ts_logerr "expected failure" ts_finalize_subtest ts_init_subtest "set-file" -echo -n | $TS_CMD_PIPESZ --check --set 4096 --file "/dev/stdin" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[[ $? -ne 0 ]] && ts_logerr "expected success" +echo -n | $TS_CMD_PIPESZ --check --set 4096 --file "/dev/stdin" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_logerr "expected success" ts_finalize_subtest ts_init_subtest "get-fd-bad" -$TS_CMD_PIPESZ --check --get --fd 42 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[[ $? -eq 0 ]] && ts_logerr "expected failure" +$TS_CMD_PIPESZ --check --get --fd 42 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" && ts_logerr "expected failure" ts_finalize_subtest ts_init_subtest "get-fd" -echo -n | $TS_CMD_PIPESZ --check --get --stdin 2>> "$TS_ERRLOG" | sed "s/$DEFAULT_PIPE_SIZE/DEFAULT_PIPE_SIZE/g" >> "$TS_OUTPUT" -[[ $? -ne 0 ]] && ts_logerr "expected success" +echo -n | $TS_CMD_PIPESZ --check --get --stdin 2>> "$TS_ERRLOG" \ + | sed "s/$DEFAULT_PIPE_SIZE/DEFAULT_PIPE_SIZE/g" >> "$TS_OUTPUT" \ + || ts_logerr "expected success" ts_finalize_subtest ts_init_subtest "get-file-bad" -$TS_CMD_PIPESZ --check --get --file "/dev/null" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[[ $? -eq 0 ]] && ts_logerr "expected failure" +$TS_CMD_PIPESZ --check --get --file "/dev/null" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + && ts_logerr "expected failure" ts_finalize_subtest ts_init_subtest "get-file" -echo -n | $TS_CMD_PIPESZ --check --get --file "/dev/stdin" 2>> "$TS_ERRLOG" | sed "s/$DEFAULT_PIPE_SIZE/DEFAULT_PIPE_SIZE/g" >> "$TS_OUTPUT" -[[ $? -ne 0 ]] && ts_logerr "expected success" +echo -n | $TS_CMD_PIPESZ --check --get --file "/dev/stdin" 2>> "$TS_ERRLOG" \ + | sed "s/$DEFAULT_PIPE_SIZE/DEFAULT_PIPE_SIZE/g" >> "$TS_OUTPUT" \ + || ts_logerr "expected success" ts_finalize_subtest ts_init_subtest "pipe-max-size" -echo -n | $TS_CMD_PIPESZ --check --stdin >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[[ $? -ne 0 ]] && ts_logerr "expected success" +echo -n | $TS_CMD_PIPESZ --check --stdin >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_logerr "expected success" ts_finalize_subtest ts_init_subtest "exec" -echo this_should_be_output_by_cat | $TS_CMD_PIPESZ --check --stdin cat >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" -[[ $? -ne 0 ]] && ts_logerr "expected success" +echo this_should_be_output_by_cat | $TS_CMD_PIPESZ --check --stdin cat >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" \ + || ts_logerr "expected success" ts_finalize_subtest set +o pipefail diff --git a/tests/ts/setarch/setarch b/tests/ts/setarch/setarch index 05b72f3cb..e2c71c828 100755 --- a/tests/ts/setarch/setarch +++ b/tests/ts/setarch/setarch @@ -46,8 +46,7 @@ ts_init_subtest uname26 finmsg="" # for debugging 2.6 issues echo "###### --uname-2.6 echo" >>"$TS_OUTPUT" -$TS_CMD_SETARCH $ARCH --verbose --uname-2.6 echo "2.6 worked" >> "$TS_OUTPUT" 2>&1 -if [ $? -eq 0 ]; then +if $TS_CMD_SETARCH $ARCH --verbose --uname-2.6 echo "2.6 worked" >> "$TS_OUTPUT" 2>&1; then expected='^2.6 worked$' else # this may happen after execvp - gets written to stderr @@ -57,8 +56,7 @@ fi sed -i "$ s/$expected/2.6 works or kernel too old/" "$TS_OUTPUT" echo "###### --uname-2.6 true, non-verbose" >>"$TS_OUTPUT" -$TS_CMD_SETARCH $ARCH --uname-2.6 true >> "$TS_OUTPUT" 2>&1 -if [ $? -eq 0 ]; then +if $TS_CMD_SETARCH $ARCH --uname-2.6 true >> "$TS_OUTPUT" 2>&1; then echo "2.6 works or kernel too old" >> "$TS_OUTPUT" else # this may happen after execvp - gets written to stderr diff --git a/tests/ts/su/environ b/tests/ts/su/environ index 88242936c..6769db5d1 100755 --- a/tests/ts/su/environ +++ b/tests/ts/su/environ @@ -32,7 +32,7 @@ $TS_CMD_SU --whitelist-environment FOO,BAR --login --command 'echo foo:$FOO bar: # the environment, not the overall functionality of su(1). Therefore, if su(1) # fails due to authentication, the test should be skipped. # -grep -q 'Authentication failure' "$TS_ERRLOG" -[ $? -eq 0 ] && ts_skip "authentication failure" + +grep -q 'Authentication failure' "$TS_ERRLOG" && ts_skip "authentication failure" ts_finalize diff --git a/tests/ts/su/group b/tests/ts/su/group index 157dd8249..a51984c0b 100755 --- a/tests/ts/su/group +++ b/tests/ts/su/group @@ -52,8 +52,7 @@ ts_init_subtest "primary-login" | grep -o "$grp_name" \ | uniq >> "$TS_OUTPUT" -grep -q 'Authentication failure' "$TS_ERRLOG" -[ "$?" -eq 0 ] && ts_skip_subtest "authentication failure" +grep -q 'Authentication failure' "$TS_ERRLOG" && ts_skip_subtest "authentication failure" ts_finalize_subtest ts_init_subtest "supplemental-no-login" @@ -69,8 +68,7 @@ ts_init_subtest "supplemental-login" | grep -o "$grp_name" \ | uniq >> "$TS_OUTPUT" -grep -q 'Authentication failure' "$TS_ERRLOG" -[ "$?" -eq 0 ] && ts_skip_subtest "authentication failure" +grep -q 'Authentication failure' "$TS_ERRLOG" && ts_skip_subtest "authentication failure" ts_finalize_subtest ts_init_subtest "group-id" @@ -85,4 +83,4 @@ ts_finalize_subtest groupdel "$grp_name" -ts_finalize \ No newline at end of file +ts_finalize diff --git a/tests/ts/uuidd/uuidd b/tests/ts/uuidd/uuidd index 04f02f431..04889ae1c 100755 --- a/tests/ts/uuidd/uuidd +++ b/tests/ts/uuidd/uuidd @@ -26,8 +26,7 @@ UUIDD_PID="$(mktemp -u "${TS_OUTDIR}/uuiddXXXXXXXXXXXXX")" # socket path must be short (SIZEOF_SOCKADDR_UN_SUN_PATH 108) UUIDD_SOCKET=$(mktemp "/tmp/ultest-$TS_COMPONENT-$TS_TESTNAME-socketXXXXXX") -$TS_CMD_UUIDD -p "$UUIDD_PID" -s "$UUIDD_SOCKET" -if [ $? -ne 0 ]; then +if ! $TS_CMD_UUIDD -p "$UUIDD_PID" -s "$UUIDD_SOCKET"; then ts_failed "daemon start" fi diff --git a/tests/ts/uuidgen/uuidgen b/tests/ts/uuidgen/uuidgen index 112eab766..3ecc0ed94 100755 --- a/tests/ts/uuidgen/uuidgen +++ b/tests/ts/uuidgen/uuidgen @@ -24,15 +24,20 @@ ts_check_test_command "$TS_CMD_UUIDGEN" OUTPUT_FILE="$(mktemp "${TS_OUTDIR}/uuidgenXXXXXXXXXXXXX")" test_flag() { + local uuidgen_ret uuid_parse_ret + uuid_parse_ret=0 + echo "option: $1" >> "$TS_OUTPUT" - $TS_CMD_UUIDGEN $1 > "$OUTPUT_FILE" 2>>"$TS_OUTPUT" - ret=$? + $TS_CMD_UUIDGEN "$1" > "$OUTPUT_FILE" 2>>"$TS_OUTPUT" + uuidgen_ret=$? + $TS_HELPER_UUID_PARSER "$OUTPUT_FILE" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" - if [ $? -ne 0 ] || [ $ret -ne 0 ]; then + uuid_parse_ret=$? + if [ $uuid_parse_ret -ne 0 ] || [ $uuidgen_ret -ne 0 ]; then echo "something wrong with $OUTPUT_FILE" >> "$TS_OUTPUT" - cat $OUTPUT_FILE >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" + cat "$OUTPUT_FILE" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" fi - echo "return values: $ret and $?" >> "$TS_OUTPUT" + echo "return values: $uuidgen_ret and $uuid_parse_ret" >> "$TS_OUTPUT" } test_flag -r