TESTS: move the default url, lun and iscsi context into a structure

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2014-09-18 16:42:45 -07:00
parent 40de7d95a9
commit 9b768f7de9
177 changed files with 939 additions and 934 deletions

View File

@@ -39,95 +39,95 @@ test_startstopunit_noloej(void)
}
logging(LOG_VERBOSE, "Test that media is not ejected when LOEJ==0 IMMED==0 NO_FLUSH==0 START==0");
ret = startstopunit(iscsic, tgt_lun,
ret = startstopunit(sd->iscsi_ctx, sd->iscsi_lun,
0, 0, 0, 0, 0, 0,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test TESTUNITREADY that medium is not ejected.");
ret = testunitready(iscsic, tgt_lun,
ret = testunitready(sd->iscsi_ctx, sd->iscsi_lun,
EXPECT_SANITIZE);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test that media is not ejected when LOEJ==0 IMMED==0 NO_FLUSH==0 START==1");
ret = startstopunit(iscsic, tgt_lun,
ret = startstopunit(sd->iscsi_ctx, sd->iscsi_lun,
0, 0, 0, 0, 0, 1,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test TESTUNITREADY that medium is not ejected.");
ret = testunitready(iscsic, tgt_lun,
ret = testunitready(sd->iscsi_ctx, sd->iscsi_lun,
EXPECT_SANITIZE);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test that media is not ejected when LOEJ==0 IMMED==1 NO_FLUSH==0 START==0");
ret = startstopunit(iscsic, tgt_lun,
ret = startstopunit(sd->iscsi_ctx, sd->iscsi_lun,
1, 0, 0, 0, 0, 0,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test TESTUNITREADY that medium is not ejected.");
ret = testunitready(iscsic, tgt_lun,
ret = testunitready(sd->iscsi_ctx, sd->iscsi_lun,
EXPECT_SANITIZE);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test that media is not ejected when LOEJ==0 IMMED==1 NO_FLUSH==0 START==1");
ret = startstopunit(iscsic, tgt_lun,
ret = startstopunit(sd->iscsi_ctx, sd->iscsi_lun,
1, 0, 0, 0, 0, 1,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test TESTUNITREADY that medium is not ejected.");
ret = testunitready(iscsic, tgt_lun,
ret = testunitready(sd->iscsi_ctx, sd->iscsi_lun,
EXPECT_SANITIZE);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test that media is not ejected when LOEJ==0 IMMED==0 NO_FLUSH==1 START==0");
ret = startstopunit(iscsic, tgt_lun,
ret = startstopunit(sd->iscsi_ctx, sd->iscsi_lun,
0, 0, 0, 1, 0, 0,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test TESTUNITREADY that medium is not ejected.");
ret = testunitready(iscsic, tgt_lun,
ret = testunitready(sd->iscsi_ctx, sd->iscsi_lun,
EXPECT_SANITIZE);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test that media is not ejected when LOEJ==0 IMMED==0 NO_FLUSH==1 START==1");
ret = startstopunit(iscsic, tgt_lun,
ret = startstopunit(sd->iscsi_ctx, sd->iscsi_lun,
0, 0, 0, 1, 0, 1,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test TESTUNITREADY that medium is not ejected.");
ret = testunitready(iscsic, tgt_lun,
ret = testunitready(sd->iscsi_ctx, sd->iscsi_lun,
EXPECT_SANITIZE);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test that media is not ejected when LOEJ==0 IMMED==1 NO_FLUSH==1 START==0");
ret = startstopunit(iscsic, tgt_lun,
ret = startstopunit(sd->iscsi_ctx, sd->iscsi_lun,
1, 0, 0, 1, 0, 0,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test TESTUNITREADY that medium is not ejected.");
ret = testunitready(iscsic, tgt_lun,
ret = testunitready(sd->iscsi_ctx, sd->iscsi_lun,
EXPECT_SANITIZE);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test that media is not ejected when LOEJ==0 IMMED==1 NO_FLUSH==1 START==1");
ret = startstopunit(iscsic, tgt_lun,
ret = startstopunit(sd->iscsi_ctx, sd->iscsi_lun,
1, 0, 0, 1, 0, 1,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test TESTUNITREADY that medium is not ejected.");
ret = testunitready(iscsic, tgt_lun,
ret = testunitready(sd->iscsi_ctx, sd->iscsi_lun,
EXPECT_SANITIZE);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "In case the target did eject the medium, load it again.");
startstopunit(iscsic, tgt_lun, 1, 0, 0, 0, 1, 1,
startstopunit(sd->iscsi_ctx, sd->iscsi_lun, 1, 0, 0, 0, 1, 1,
EXPECT_STATUS_GOOD);
}