Commit 005e18a8 authored by Darek Stojaczyk's avatar Darek Stojaczyk
Browse files

autotest/common: silence hash output



We've got a bunch of `if hash` checks that generate
unnecessary output, e.g.:

$ if ! hash ceph; then [...]
/var/jenkins/workspace/Other_systems/centos7_autotest/
spdk/test/common/autotest_common.sh: line 28: hash: ceph: not found

We now silence that output in cases where we do expect
the binary to be unavailable and handle that case, but
we hold off in cases where `if hash` is just a sanity
check (e.g. `hash sgdisk` in part_dev_by_gpt() which
can make the entire function return immediately and do
nothing).

Change-Id: I7cbfada858aa86d57cbe182ea7f9b222debc8b88
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453207


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarSeth Howell <seth.howell5141@gmail.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent fabd7fbb
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -25,11 +25,11 @@ if [[ ! -z $1 ]]; then
fi

# If certain utilities are not installed, preemptively disable the tests
if ! hash ceph; then
if ! hash ceph &>/dev/null; then
	SPDK_TEST_RBD=0
fi

if ! hash pmempool; then
if ! hash pmempool &>/dev/null; then
	SPDK_TEST_PMDK=0
fi

@@ -281,7 +281,7 @@ function process_core() {
		fi
		echo "exe for $core is $exe"
		if [[ ! -z "$exe" ]]; then
			if hash gdb; then
			if hash gdb &>/dev/null; then
				gdb -batch -ex "thread apply all bt full" $exe $core
			fi
			cp $exe $output_dir
@@ -325,13 +325,13 @@ function waitforlisten() {

	local rpc_addr="${2:-$DEFAULT_RPC_ADDR}"

	if hash ip; then
	if hash ip &>/dev/null; then
		local have_ip_cmd=true
	else
		local have_ip_cmd=false
	fi

	if hash ss; then
	if hash ss &>/dev/null; then
		local have_ss_cmd=true
	else
		local have_ss_cmd=false