Skip to content

Commit

Permalink
ZTS: Fix mmp_interval failure
Browse files Browse the repository at this point in the history
The mmp_interval test case was failing on Fedora 30 due to the built-in
'echo' command terminating the script when it was unable to write to
the sysfs module parameter.  This change in behavior was observed with
ksh-2020.0.0-alpha1.  Resolve the issue by using the external cat
command which fails gracefully as expected.

Additionally, remove some incorrect quotes around the $? return values.

Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8906
  • Loading branch information
behlendorf authored and tonyhutter committed Aug 13, 2019
1 parent 0537bf6 commit 336744d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/zfs-tests/include/libtest.shlib
Original file line number Diff line number Diff line change
Expand Up @@ -3494,13 +3494,13 @@ function set_tunable_impl
Linux)
typeset zfs_tunables="/sys/module/$module/parameters"
[[ -w "$zfs_tunables/$tunable" ]] || return 1
echo -n "$value" > "$zfs_tunables/$tunable"
return "$?"
cat >"$zfs_tunables/$tunable" <<<"$value"
return $?
;;
SunOS)
[[ "$module" -eq "zfs" ]] || return 1
echo "${tunable}/${mdb_cmd}0t${value}" | mdb -kw
return "$?"
return $?
;;
esac
}
Expand All @@ -3527,7 +3527,7 @@ function get_tunable_impl
typeset zfs_tunables="/sys/module/$module/parameters"
[[ -f "$zfs_tunables/$tunable" ]] || return 1
cat $zfs_tunables/$tunable
return "$?"
return $?
;;
SunOS)
[[ "$module" -eq "zfs" ]] || return 1
Expand Down

0 comments on commit 336744d

Please sign in to comment.