test-tool: Avoid that login failure causes a segmentation fault
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
committed by
Ronnie Sahlberg
parent
5532325042
commit
e9536d3333
@@ -62,6 +62,8 @@ test_preventallow_2_itnexuses(void)
|
||||
logging(LOG_VERBOSE, "Create a second connection to the target");
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
logging(LOG_VERBOSE, "Try to eject the medium on the second connection");
|
||||
ret = startstopunit(sd2, 0, 0, 0, 0, 1, 0,
|
||||
|
||||
@@ -70,6 +70,9 @@ test_prout_preempt_rm_reg(void)
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
/* register secondary key */
|
||||
ret = prout_register_and_ignore(sd2, k2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
|
||||
@@ -135,6 +135,8 @@ test_prout_reserve_access_ea(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_access(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS,
|
||||
0, 0, 0, 0);
|
||||
@@ -157,6 +159,8 @@ test_prout_reserve_access_we(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_access(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE,
|
||||
1, 0, 1, 0);
|
||||
@@ -179,6 +183,8 @@ test_prout_reserve_access_earo(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_access(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS_REGISTRANTS_ONLY,
|
||||
1, 1, 0, 0);
|
||||
@@ -201,6 +207,8 @@ test_prout_reserve_access_wero(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_access(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE_REGISTRANTS_ONLY,
|
||||
1, 1, 1, 0);
|
||||
@@ -223,6 +231,8 @@ test_prout_reserve_access_eaar(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_access(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS_ALL_REGISTRANTS,
|
||||
1, 1, 0, 0);
|
||||
@@ -245,6 +255,8 @@ test_prout_reserve_access_wear(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_access(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE_ALL_REGISTRANTS,
|
||||
1, 1, 1, 0);
|
||||
|
||||
@@ -109,6 +109,8 @@ test_prout_reserve_ownership_ea(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_ownership(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS, 0);
|
||||
mpath_sd2_put(sd2);
|
||||
@@ -130,6 +132,8 @@ test_prout_reserve_ownership_we(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_ownership(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE, 0);
|
||||
mpath_sd2_put(sd2);
|
||||
@@ -151,6 +155,8 @@ test_prout_reserve_ownership_earo(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_ownership(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS_REGISTRANTS_ONLY, 0);
|
||||
mpath_sd2_put(sd2);
|
||||
@@ -172,6 +178,8 @@ test_prout_reserve_ownership_wero(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_ownership(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE_REGISTRANTS_ONLY, 0);
|
||||
mpath_sd2_put(sd2);
|
||||
@@ -193,6 +201,8 @@ test_prout_reserve_ownership_eaar(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_ownership(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS_ALL_REGISTRANTS, 1);
|
||||
mpath_sd2_put(sd2);
|
||||
@@ -214,6 +224,8 @@ test_prout_reserve_ownership_wear(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
verify_persistent_reserve_ownership(sd, sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE_ALL_REGISTRANTS, 1);
|
||||
mpath_sd2_put(sd2);
|
||||
|
||||
@@ -58,6 +58,8 @@ test_reserve6_2initiators(void)
|
||||
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
logging(LOG_NORMAL, "Try to take out a RESERVE6 from the second initiator");
|
||||
ret = reserve6_conflict(sd2);
|
||||
|
||||
@@ -55,6 +55,8 @@ test_reserve6_itnexus_loss(void)
|
||||
logging(LOG_VERBOSE, "Create a second connection to the target");
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
logging(LOG_NORMAL, "Try to take out a RESERVE6 from the second initiator");
|
||||
ret = reserve6_conflict(sd2);
|
||||
|
||||
@@ -55,6 +55,8 @@ test_reserve6_logout(void)
|
||||
logging(LOG_VERBOSE, "Create a second connection to the target");
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
logging(LOG_NORMAL, "Try to take out a RESERVE6 from the second initiator");
|
||||
ret = reserve6_conflict(sd2);
|
||||
|
||||
@@ -65,6 +65,8 @@ test_reserve6_target_cold_reset(void)
|
||||
logging(LOG_VERBOSE, "Create a second connection to the target");
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
logging(LOG_VERBOSE, "RESERVE6 from the second initiator should work now");
|
||||
ret = reserve6(sd2);
|
||||
|
||||
@@ -66,6 +66,8 @@ test_reserve6_target_warm_reset(void)
|
||||
logging(LOG_VERBOSE, "Create a second connection to the target");
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
logging(LOG_VERBOSE, "RESERVE6 from the second initiator should work now");
|
||||
ret = reserve6(sd2);
|
||||
|
||||
@@ -52,6 +52,8 @@ test_sanitize_readonly(void)
|
||||
logging(LOG_VERBOSE, "Create a second connection to the target");
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
logging(LOG_VERBOSE, "Set Software Write Protect on the second connection");
|
||||
ret = set_swp(sd2);
|
||||
|
||||
@@ -52,6 +52,8 @@ test_sanitize_reservations(void)
|
||||
logging(LOG_VERBOSE, "Create a second connection to the target");
|
||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
logging(LOG_VERBOSE, "Take out a RESERVE6 from the second "
|
||||
"initiator");
|
||||
|
||||
Reference in New Issue
Block a user