Commit 9b107f7e authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

test/lvol: Use NOT() for negative tests



In these examples, it's expected from the rpc to fail so NOT()
should be used to indicate that.

The actual pipeline variant causes the ERR trap to be triggered
from rpc_cmd() since the PIPESTATUS[@] == 1 0. Due to that, extra
call to print_backtrace() is made from rpc_cmd() context - this
change will also make sure this extra call is avoided.

Change-Id: If445ab4805e53b7d02d2287f74ab061600907d93
Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23793


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent db026688
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -521,7 +521,7 @@ function test_lvol_set_parent_bdev_from_esnap() {
	verify_esnap_clone "$lvol_uuid" "$esnap2_uuid"

	# Try again with aliases instead uuid
	rpc_cmd bdev_lvol_set_parent_bdev lvs_test/lvol esnap2 | grep "File exists"
	NOT rpc_cmd bdev_lvol_set_parent_bdev lvs_test/lvol esnap2

	# Calculate again md5 of the first 3 clusters and of last 2 clusters of lvol
	nbd_start_disks "$DEFAULT_RPC_ADDR" "$lvol_uuid" /dev/nbd2
@@ -604,7 +604,7 @@ function test_lvol_set_parent_bdev_from_snapshot() {
	verify_esnap_clone "$lvol_uuid" "$esnap1_uuid"

	# Try again with aliases instead uuid
	rpc_cmd bdev_lvol_set_parent_bdev lvs_test/lvol esnap1 | grep "File exists"
	NOT rpc_cmd bdev_lvol_set_parent_bdev lvs_test/lvol esnap1

	# Calculate again md5 of the first 3 clusters and of last 2 clusters of lvol
	nbd_start_disks "$DEFAULT_RPC_ADDR" "$lvol_uuid" /dev/nbd2
@@ -674,7 +674,7 @@ function test_lvol_set_parent_bdev_from_none() {
	verify_esnap_clone "$lvol_uuid" "$esnap_uuid"

	# Try again with aliases instead uuid
	rpc_cmd bdev_lvol_set_parent_bdev lvs_test/lvol esnap | grep "File exists"
	NOT rpc_cmd bdev_lvol_set_parent_bdev lvs_test/lvol esnap

	# Calculate again md5 of the first 3 clusters and of last 2 clusters of lvol
	nbd_start_disks "$DEFAULT_RPC_ADDR" "$lvol_uuid" /dev/nbd2
+3 −3
Original line number Diff line number Diff line
@@ -677,7 +677,7 @@ function test_lvol_set_parent_from_snapshot() {
	[ "$(jq '.[].driver_specific.lvol.esnap_clone' <<< "$clone_bdev")" = "false" ]

	# Try again with aliases instead uuid
	rpc_cmd bdev_lvol_set_parent lvs_test/lvol2 lvs_test/snap2 | grep "File exists"
	NOT rpc_cmd bdev_lvol_set_parent lvs_test/lvol2 lvs_test/snap2

	# Delete lvol2_temp
	# New state:
@@ -777,7 +777,7 @@ function test_lvol_set_parent_from_esnap() {
	[ "$(jq '.[].driver_specific.lvol.esnap_clone' <<< "$clone_bdev")" = "false" ]

	# Try again with aliases instead uuid
	rpc_cmd bdev_lvol_set_parent lvs_test/lvol2 lvs_test/snap2 | grep "File exists"
	NOT rpc_cmd bdev_lvol_set_parent lvs_test/lvol2 lvs_test/snap2

	# Delete lvol2_temp
	# New state:
@@ -861,7 +861,7 @@ function test_lvol_set_parent_from_none() {
	[ "$(jq '.[].driver_specific.lvol.esnap_clone' <<< "$clone_bdev")" = "false" ]

	# Try again with aliases instead uuid
	rpc_cmd bdev_lvol_set_parent lvs_test/lvol2 lvs_test/snap2 | grep "File exists"
	NOT rpc_cmd bdev_lvol_set_parent lvs_test/lvol2 lvs_test/snap2

	# Delete lvol2_temp
	# New state: