Commit 1a5357aa authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

test/nvmf: move format_interchange_key to common.sh



While here, make sure the key doesn't contain a trailing \n.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I07f0665d1855d66a9c8300c883bd3e5055379ba3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21750


Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 7da5bc20
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -685,3 +685,12 @@ clean_kernel_target() {

	modprobe -r "${modules[@]##*/}" nvmet
}

format_interchange_psk() {
	local key hash crc

	key=$1 hash=${2:-01}
	crc=$(echo -n $key | gzip -1 -c | tail -c8 | head -c 4)

	echo -n "NVMeTLSkey-1:$hash:$(base64 <(echo -n ${key}${crc})):"
}
+0 −9
Original line number Diff line number Diff line
@@ -45,15 +45,6 @@ function run_bdevperf() {
	killprocess $bdevperf_pid
}

format_interchange_psk() {
	local key hash crc

	key=$1 hash=${2:-01}
	crc=$(echo -n $key | gzip -1 -c | tail -c8 | head -c 4)

	echo "NVMeTLSkey-1:$hash:$(base64 <(echo -n ${key}${crc})):"
}

setup_nvmf_tgt() {
	local key=$1