TESTS: get rid of iscsic2
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
@@ -410,7 +410,6 @@ typedef struct libiscsi_suite_info {
|
||||
} libiscsi_suite_info;
|
||||
|
||||
#define NON_PGR_FUNCS suite_init, suite_cleanup, test_setup, test_teardown
|
||||
#define PGR_FUNCS suite_init_pgr, suite_cleanup_pgr, test_setup, test_teardown
|
||||
|
||||
/* SCSI protocol tests */
|
||||
static libiscsi_suite_info scsi_suites[] = {
|
||||
@@ -427,7 +426,7 @@ static libiscsi_suite_info scsi_suites[] = {
|
||||
{ "PrinReadKeys", NON_PGR_FUNCS, tests_prin_read_keys },
|
||||
{ "PrinServiceactionRange", NON_PGR_FUNCS, tests_prin_serviceaction_range },
|
||||
{ "ProutRegister", NON_PGR_FUNCS, tests_prout_register },
|
||||
{ "ProutReserve", PGR_FUNCS, tests_prout_reserve },
|
||||
{ "ProutReserve", NON_PGR_FUNCS, tests_prout_reserve },
|
||||
{ "Read6", NON_PGR_FUNCS, tests_read6 },
|
||||
{ "Read10", NON_PGR_FUNCS, tests_read10 },
|
||||
{ "Read12", NON_PGR_FUNCS, tests_read12 },
|
||||
@@ -508,7 +507,7 @@ static libiscsi_suite_info all_suites[] = {
|
||||
{ "PrinServiceactionRange", NON_PGR_FUNCS,
|
||||
tests_prin_serviceaction_range },
|
||||
{ "ProutRegister", NON_PGR_FUNCS, tests_prout_register },
|
||||
{ "ProutReserve", PGR_FUNCS, tests_prout_reserve },
|
||||
{ "ProutReserve", NON_PGR_FUNCS, tests_prout_reserve },
|
||||
{ "Read6", NON_PGR_FUNCS, tests_read6 },
|
||||
{ "Read10", NON_PGR_FUNCS, tests_read10 },
|
||||
{ "Read12", NON_PGR_FUNCS, tests_read12 },
|
||||
@@ -553,7 +552,7 @@ static libiscsi_suite_info scsi_usb_sbc_suites[] = {
|
||||
{ "PrinServiceactionRange", NON_PGR_FUNCS,
|
||||
tests_prin_serviceaction_range },
|
||||
{ "ProutRegister", NON_PGR_FUNCS, tests_prout_register },
|
||||
{ "ProutReserve", PGR_FUNCS, tests_prout_reserve },
|
||||
{ "ProutReserve", NON_PGR_FUNCS, tests_prout_reserve },
|
||||
{ "Read6", NON_PGR_FUNCS, tests_read6 },
|
||||
{ "Read10", NON_PGR_FUNCS, tests_read10 },
|
||||
{ "Read12", NON_PGR_FUNCS, tests_read12 },
|
||||
@@ -597,11 +596,8 @@ static struct test_family families[] = {
|
||||
* globals for test setup and teardown
|
||||
*/
|
||||
struct scsi_task *task;
|
||||
int tgt_lun2;
|
||||
struct iscsi_context *iscsic2;
|
||||
unsigned char *read_write_buf;
|
||||
|
||||
|
||||
static void
|
||||
print_usage(void)
|
||||
{
|
||||
@@ -710,32 +706,6 @@ suite_cleanup(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
suite_init_pgr(void)
|
||||
{
|
||||
suite_init();
|
||||
iscsic2 = iscsi_context_login(initiatorname2, sd->iscsi_url, &tgt_lun2);
|
||||
if (iscsic2 == NULL) {
|
||||
fprintf(stderr,
|
||||
"error: Failed to login to target for test set-up\n");
|
||||
suite_cleanup();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
suite_cleanup_pgr(void)
|
||||
{
|
||||
if (iscsic2) {
|
||||
iscsi_logout_sync(iscsic2);
|
||||
iscsi_destroy_context(iscsic2);
|
||||
iscsic2 = NULL;
|
||||
}
|
||||
suite_cleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
list_all_tests(void)
|
||||
{
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
|
||||
/* globals between setup, tests, and teardown */
|
||||
extern struct scsi_task *task;
|
||||
extern struct iscsi_context *iscsic2;
|
||||
extern int tgt_lun2;
|
||||
extern unsigned char *read_write_buf;
|
||||
|
||||
#ifndef HAVE_CU_SUITEINFO_PSETUPFUNC
|
||||
|
||||
@@ -124,11 +124,15 @@ test_prout_reserve_access_ea(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_access(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS,
|
||||
0, 0, 0, 0);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -136,11 +140,15 @@ test_prout_reserve_access_we(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_access(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE,
|
||||
1, 0, 1, 0);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -148,11 +156,15 @@ test_prout_reserve_access_earo(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_access(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS_REGISTRANTS_ONLY,
|
||||
1, 1, 0, 0);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -160,11 +172,15 @@ test_prout_reserve_access_wero(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_access(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE_REGISTRANTS_ONLY,
|
||||
1, 1, 1, 0);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -172,11 +188,15 @@ test_prout_reserve_access_eaar(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_access(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS_ALL_REGISTRANTS,
|
||||
1, 1, 0, 0);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -184,9 +204,13 @@ test_prout_reserve_access_wear(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_access(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE_ALL_REGISTRANTS,
|
||||
1, 1, 1, 0);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
@@ -98,10 +98,14 @@ test_prout_reserve_ownership_ea(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_ownership(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS, 0);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -109,10 +113,14 @@ test_prout_reserve_ownership_we(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_ownership(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE, 0);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -120,10 +128,14 @@ test_prout_reserve_ownership_earo(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_ownership(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS_REGISTRANTS_ONLY, 0);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -131,10 +143,14 @@ test_prout_reserve_ownership_wero(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_ownership(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE_REGISTRANTS_ONLY, 0);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -142,10 +158,14 @@ test_prout_reserve_ownership_eaar(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_ownership(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS_ALL_REGISTRANTS, 1);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -153,8 +173,12 @@ test_prout_reserve_ownership_wear(void)
|
||||
{
|
||||
struct scsi_device sd2;
|
||||
|
||||
sd2.iscsi_ctx = iscsic2;
|
||||
sd2.iscsi_lun = tgt_lun2;
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
verify_persistent_reserve_ownership(sd, &sd2,
|
||||
SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE_ALL_REGISTRANTS, 1);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
@@ -94,5 +94,4 @@ test_reserve6_2initiators(void)
|
||||
|
||||
iscsi_logout_sync(sd2.iscsi_ctx);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
iscsic2 = NULL;
|
||||
}
|
||||
|
||||
@@ -80,5 +80,4 @@ test_reserve6_itnexus_loss(void)
|
||||
finished:
|
||||
iscsi_logout_sync(sd2.iscsi_ctx);
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
iscsic2 = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user