Tony Asleson
2014-07-24 21:01:37 UTC
Signed-off-by: Tony Asleson <***@redhat.com>
---
c_binding/include/libstoragemgmt/libstoragemgmt.h | 4 +-
.../libstoragemgmt/libstoragemgmt_plug_interface.h | 4 +-
c_binding/lsm_mgmt.cpp | 12 +++--
c_binding/lsm_plugin_ipc.cpp | 31 ++++++++-----
plugin/simc/simc_lsmplugin.c | 5 ++-
test/tester.c | 52 +++++++++++++++-------
6 files changed, 70 insertions(+), 38 deletions(-)
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt.h b/c_binding/include/libstoragemgmt/libstoragemgmt.h
index a49aafd..5345017 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt.h
@@ -515,7 +515,7 @@ extern "C" {
* @param[in] name Name of access group
* @param[in] init_id Initiator id to be added to group
* @param[in] init_type Initiator type
- * @param[in] system_id System id to create access group for
+ * @param[in] system System to create access group for
* @param[out] access_group Returned access group
* @param[in] flags Reserved for future use, must be zero.
* @return LSM_ERR_OK on success, else error reason
@@ -524,7 +524,7 @@ extern "C" {
const char *name,
const char *init_id,
lsm_initiator_type init_type,
- const char *system_id,
+ lsm_system *system,
lsm_access_group **access_group,
lsm_flag flags);
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
index 789d89a..1deab9a 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
@@ -473,7 +473,7 @@ typedef int (*lsm_plug_access_group_list)(lsm_plugin_ptr c,
* @param[in] name Name of access group
* @param[in] initiator_id Initiator to be added to group
* @param[in] id_type Initiator type
- * @param[in] system_id System to create group for
+ * @param[in] system System to create group for
* @param[out] access_group Newly created access group
* @param[in] flags Reserved
* @return LSM_ERR_OK, else error reason
@@ -482,7 +482,7 @@ typedef int (*lsm_plug_access_group_create)(lsm_plugin_ptr c,
const char *name,
const char *initiator_id,
lsm_access_group_init_type init_type,
- const char *system_id,
+ lsm_system *system,
lsm_access_group **access_group,
lsm_flag flags);
diff --git a/c_binding/lsm_mgmt.cpp b/c_binding/lsm_mgmt.cpp
index 722d126..c75ffd5 100644
--- a/c_binding/lsm_mgmt.cpp
+++ b/c_binding/lsm_mgmt.cpp
@@ -1437,13 +1437,17 @@ int lsm_access_group_list(lsm_connect *c, const char *search_key,
int lsm_access_group_create(lsm_connect *c, const char *name,
const char *init_id, lsm_initiator_type init_type,
- const char *system_id,
+ lsm_system *system,
lsm_access_group **access_group, lsm_flag flags)
{
CONN_SETUP(c);
- if( CHECK_STR(name) || CHECK_STR(init_id) || CHECK_STR(system_id)
- || CHECK_RP(access_group) || LSM_FLAG_UNUSED_CHECK(flags) ) {
+ if( !LSM_IS_SYSTEM(system) ) {
+ return LSM_ERR_INVALID_SYSTEM;
+ }
+
+ if( CHECK_STR(name) || CHECK_STR(init_id) || CHECK_RP(access_group) ||
+ LSM_FLAG_UNUSED_CHECK(flags) ) {
return LSM_ERR_INVALID_ARGUMENT;
}
@@ -1451,7 +1455,7 @@ int lsm_access_group_create(lsm_connect *c, const char *name,
p["name"] = Value(name);
p["init_id"] = Value(init_id);
p["init_type"] = Value((int32_t)init_type);
- p["system_id"] = Value(system_id);
+ p["system"] = system_to_value(system);
p["flags"] = Value(flags);
Value parameters(p);
diff --git a/c_binding/lsm_plugin_ipc.cpp b/c_binding/lsm_plugin_ipc.cpp
index 11e0f05..8058158 100644
--- a/c_binding/lsm_plugin_ipc.cpp
+++ b/c_binding/lsm_plugin_ipc.cpp
@@ -1156,25 +1156,32 @@ static int ag_create(lsm_plugin_ptr p, Value ¶ms, Value &response)
Value v_name = params["name"];
Value v_init_id = params["init_id"];
Value v_init_type = params["init_type"];
- Value v_system_id = params["system_id"];
+ Value v_system = params["system"];
if( Value::string_t == v_name.valueType() &&
Value::string_t == v_init_id.valueType() &&
Value::numeric_t == v_init_type.valueType() &&
- Value::string_t == v_system_id.valueType() &&
+ Value::object_t == v_system.valueType() &&
LSM_FLAG_EXPECTED_TYPE(params)) {
lsm_access_group *ag = NULL;
- rc = p->san_ops->ag_create(
- p,
- v_name.asC_str(),
- v_init_id.asC_str(),
- (lsm_access_group_init_type)v_init_type.asInt32_t(),
- v_system_id.asC_str(), &ag,
- LSM_FLAG_GET_VALUE(params));
- if( LSM_ERR_OK == rc ) {
- response = access_group_to_value(ag);
- lsm_access_group_record_free(ag);
+ lsm_system *system = value_to_system(v_system);
+
+ if( system ) {
+ rc = p->san_ops->ag_create(
+ p,
+ v_name.asC_str(),
+ v_init_id.asC_str(),
+ (lsm_access_group_init_type)v_init_type.asInt32_t(),
+ system, &ag,
+ LSM_FLAG_GET_VALUE(params));
+ if( LSM_ERR_OK == rc ) {
+ response = access_group_to_value(ag);
+ lsm_access_group_record_free(ag);
+ }
+
+ lsm_system_record_free(system);
+ system = NULL;
}
} else {
rc = LSM_ERR_TRANSPORT_INVALID_ARG;
diff --git a/plugin/simc/simc_lsmplugin.c b/plugin/simc/simc_lsmplugin.c
index f19708b..310fa32 100644
--- a/plugin/simc/simc_lsmplugin.c
+++ b/plugin/simc/simc_lsmplugin.c
@@ -1147,7 +1147,7 @@ static int access_group_create(lsm_plugin_ptr c,
const char *name,
const char *initiator_id,
lsm_access_group_init_type id_type,
- const char *system_id,
+ lsm_system *system,
lsm_access_group **access_group,
lsm_flag flags)
{
@@ -1165,7 +1165,8 @@ static int access_group_create(lsm_plugin_ptr c,
if( initiators && id &&
(LSM_ERR_OK == lsm_string_list_elem_set(initiators, 0, initiator_id))) {
ag = lsm_access_group_record_alloc(id, name, initiators, id_type,
- system_id, NULL);
+ lsm_system_id_get(system),
+ NULL);
aag = alloc_allocated_ag(ag, id_type);
if( ag && aag ) {
g_hash_table_insert(pd->access_groups, (gpointer)id,
diff --git a/test/tester.c b/test/tester.c
index 96119d6..f7434af 100644
--- a/test/tester.c
+++ b/test/tester.c
@@ -600,16 +600,20 @@ START_TEST(test_access_groups)
uint32_t count = 0;
uint32_t i = 0;
lsm_string_list *init_list = NULL;
+ lsm_system *system = NULL;
int rc = 0;
fail_unless(c!=NULL);
+
+ system = get_system(c);
+
G(rc, lsm_access_group_list, c, NULL, NULL, &groups, &count, LSM_FLAG_RSVD);
fail_unless(count == 0, "Expect 0 access groups, got %"PRIu32, count);
fail_unless(groups == NULL);
G(rc, lsm_access_group_create, c, "test_access_groups",
- "iqn.1994-05.com.domain:01.89bd01", LSM_INITIATOR_ISCSI, SYSTEM_ID,
+ "iqn.1994-05.com.domain:01.89bd01", LSM_INITIATOR_ISCSI, system,
&group, LSM_FLAG_RSVD);
if( LSM_ERR_OK == rc ) {
@@ -720,6 +724,9 @@ START_TEST(test_access_groups)
groups = NULL;
count = 0;
}
+
+ G(rc, lsm_system_record_free, system);
+ system = NULL;
}
END_TEST
@@ -731,12 +738,14 @@ START_TEST(test_access_groups_grant_revoke)
lsm_pool *pool = get_test_pool(c);
char *job = NULL;
lsm_volume *n = NULL;
+ lsm_system *system = NULL;
fail_unless(pool != NULL);
+ system = get_system(c);
G(rc, lsm_access_group_create, c, "test_access_groups_grant_revoke",
ISCSI_HOST[0], LSM_INITIATOR_ISCSI,
- SYSTEM_ID,
+ system,
&group, LSM_FLAG_RSVD);
@@ -795,6 +804,8 @@ START_TEST(test_access_groups_grant_revoke)
G(rc, lsm_volume_record_free, n);
G(rc, lsm_pool_record_free, pool);
+
+ G(rc, lsm_system_record_free, system);
}
END_TEST
@@ -1511,16 +1522,19 @@ START_TEST(test_invalid_input)
/* lsmAccessGroupCreate */
lsm_access_group *ag = NULL;
+ lsm_system *system = NULL;
+ system = get_system(c);
- rc = lsm_access_group_create(c, NULL, NULL, 0, NULL, NULL, LSM_FLAG_RSVD);
+ rc = lsm_access_group_create(c, NULL, NULL, 0, system, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
rc = lsm_access_group_create(c, "my_group", ISCSI_HOST[0], LSM_INITIATOR_OTHER,
- "system-id", NULL, LSM_FLAG_RSVD);
- fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+ NULL, NULL, LSM_FLAG_RSVD);
+ fail_unless(rc == LSM_ERR_INVALID_SYSTEM, "rc = %d", rc);
+
rc = lsm_access_group_create(c, "my_group", ISCSI_HOST[0], LSM_INITIATOR_OTHER,
- SYSTEM_ID, &ag, LSM_FLAG_RSVD);
+ system, &ag, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_OK, "rc = %d", rc);
fail_unless(ag != NULL);
@@ -1778,8 +1792,6 @@ START_TEST(test_invalid_input)
int member_type = 65535;
uint64_t size = 0;
int flags = 10;
- lsm_system *system = get_system(c);
-
rc = lsm_pool_create(NULL, NULL, NULL, size, raid_type, member_type, NULL, NULL, flags);
fail_unless(rc == LSM_ERR_INVALID_CONN, "rc = %d", rc);
@@ -1821,13 +1833,10 @@ START_TEST(test_invalid_input)
rc = lsm_pool_record_free(test_pool);
fail_unless(LSM_ERR_OK == rc, "%d", rc);
- rc = lsm_system_record_free(system);
- fail_unless(LSM_ERR_OK == rc, "%d", rc);
-
-
- rc = lsm_string_list_free(f);
+ G(rc, lsm_system_record_free, system );
+ system = NULL;
+ G(rc, lsm_string_list_free, f);
f = NULL;
- fail_unless(LSM_ERR_OK == rc, "%d", rc);
}
END_TEST
@@ -1918,13 +1927,18 @@ END_TEST
START_TEST(test_iscsi_auth_in)
{
lsm_access_group *group = NULL;
+ lsm_system *system = NULL;
//char *job = NULL;
int rc;
+ system = get_system(c);
+
G(rc, lsm_access_group_create, c, "ISCSI_AUTH", ISCSI_HOST[0],
- LSM_INITIATOR_ISCSI, SYSTEM_ID, &group, LSM_FLAG_RSVD);
+ LSM_INITIATOR_ISCSI, system, &group, LSM_FLAG_RSVD);
fail_unless(LSM_ERR_OK == rc, "rc = %d");
+ G(rc, lsm_system_record_free, system);
+ system = NULL;
if( LSM_ERR_OK == rc ) {
/* TODO FIX THIS UP after we take out the C initiator support.
@@ -2670,15 +2684,18 @@ START_TEST(test_search_access_groups)
lsm_access_group *group = NULL;
lsm_pool *pool = get_test_pool(c);
+ lsm_system *system = get_system(c);
+ fail_unless(system != NULL, "Missing system!");
+
for( i = 0; i < 2; ++i ) {
char ag_name[64];
snprintf(ag_name, sizeof(ag_name), "test_access_group_%d", i);
G(rc, lsm_access_group_create, c, ag_name, ISCSI_HOST[i],
- LSM_INITIATOR_ISCSI, SYSTEM_ID, &group, LSM_FLAG_RSVD);
+ LSM_INITIATOR_ISCSI, system, &group, LSM_FLAG_RSVD);
if( LSM_ERR_OK == rc ) {
G(rc, lsm_access_group_record_free, group);
@@ -2686,6 +2703,9 @@ START_TEST(test_search_access_groups)
}
}
+ G(rc, lsm_system_record_free, system);
+ system = NULL;
+
G(rc, lsm_access_group_list, c, NULL, NULL, &ag, &count, LSM_FLAG_RSVD);
fail_unless(count > 0, "We are expecting some access_groups!");
---
c_binding/include/libstoragemgmt/libstoragemgmt.h | 4 +-
.../libstoragemgmt/libstoragemgmt_plug_interface.h | 4 +-
c_binding/lsm_mgmt.cpp | 12 +++--
c_binding/lsm_plugin_ipc.cpp | 31 ++++++++-----
plugin/simc/simc_lsmplugin.c | 5 ++-
test/tester.c | 52 +++++++++++++++-------
6 files changed, 70 insertions(+), 38 deletions(-)
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt.h b/c_binding/include/libstoragemgmt/libstoragemgmt.h
index a49aafd..5345017 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt.h
@@ -515,7 +515,7 @@ extern "C" {
* @param[in] name Name of access group
* @param[in] init_id Initiator id to be added to group
* @param[in] init_type Initiator type
- * @param[in] system_id System id to create access group for
+ * @param[in] system System to create access group for
* @param[out] access_group Returned access group
* @param[in] flags Reserved for future use, must be zero.
* @return LSM_ERR_OK on success, else error reason
@@ -524,7 +524,7 @@ extern "C" {
const char *name,
const char *init_id,
lsm_initiator_type init_type,
- const char *system_id,
+ lsm_system *system,
lsm_access_group **access_group,
lsm_flag flags);
diff --git a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
index 789d89a..1deab9a 100644
--- a/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
+++ b/c_binding/include/libstoragemgmt/libstoragemgmt_plug_interface.h
@@ -473,7 +473,7 @@ typedef int (*lsm_plug_access_group_list)(lsm_plugin_ptr c,
* @param[in] name Name of access group
* @param[in] initiator_id Initiator to be added to group
* @param[in] id_type Initiator type
- * @param[in] system_id System to create group for
+ * @param[in] system System to create group for
* @param[out] access_group Newly created access group
* @param[in] flags Reserved
* @return LSM_ERR_OK, else error reason
@@ -482,7 +482,7 @@ typedef int (*lsm_plug_access_group_create)(lsm_plugin_ptr c,
const char *name,
const char *initiator_id,
lsm_access_group_init_type init_type,
- const char *system_id,
+ lsm_system *system,
lsm_access_group **access_group,
lsm_flag flags);
diff --git a/c_binding/lsm_mgmt.cpp b/c_binding/lsm_mgmt.cpp
index 722d126..c75ffd5 100644
--- a/c_binding/lsm_mgmt.cpp
+++ b/c_binding/lsm_mgmt.cpp
@@ -1437,13 +1437,17 @@ int lsm_access_group_list(lsm_connect *c, const char *search_key,
int lsm_access_group_create(lsm_connect *c, const char *name,
const char *init_id, lsm_initiator_type init_type,
- const char *system_id,
+ lsm_system *system,
lsm_access_group **access_group, lsm_flag flags)
{
CONN_SETUP(c);
- if( CHECK_STR(name) || CHECK_STR(init_id) || CHECK_STR(system_id)
- || CHECK_RP(access_group) || LSM_FLAG_UNUSED_CHECK(flags) ) {
+ if( !LSM_IS_SYSTEM(system) ) {
+ return LSM_ERR_INVALID_SYSTEM;
+ }
+
+ if( CHECK_STR(name) || CHECK_STR(init_id) || CHECK_RP(access_group) ||
+ LSM_FLAG_UNUSED_CHECK(flags) ) {
return LSM_ERR_INVALID_ARGUMENT;
}
@@ -1451,7 +1455,7 @@ int lsm_access_group_create(lsm_connect *c, const char *name,
p["name"] = Value(name);
p["init_id"] = Value(init_id);
p["init_type"] = Value((int32_t)init_type);
- p["system_id"] = Value(system_id);
+ p["system"] = system_to_value(system);
p["flags"] = Value(flags);
Value parameters(p);
diff --git a/c_binding/lsm_plugin_ipc.cpp b/c_binding/lsm_plugin_ipc.cpp
index 11e0f05..8058158 100644
--- a/c_binding/lsm_plugin_ipc.cpp
+++ b/c_binding/lsm_plugin_ipc.cpp
@@ -1156,25 +1156,32 @@ static int ag_create(lsm_plugin_ptr p, Value ¶ms, Value &response)
Value v_name = params["name"];
Value v_init_id = params["init_id"];
Value v_init_type = params["init_type"];
- Value v_system_id = params["system_id"];
+ Value v_system = params["system"];
if( Value::string_t == v_name.valueType() &&
Value::string_t == v_init_id.valueType() &&
Value::numeric_t == v_init_type.valueType() &&
- Value::string_t == v_system_id.valueType() &&
+ Value::object_t == v_system.valueType() &&
LSM_FLAG_EXPECTED_TYPE(params)) {
lsm_access_group *ag = NULL;
- rc = p->san_ops->ag_create(
- p,
- v_name.asC_str(),
- v_init_id.asC_str(),
- (lsm_access_group_init_type)v_init_type.asInt32_t(),
- v_system_id.asC_str(), &ag,
- LSM_FLAG_GET_VALUE(params));
- if( LSM_ERR_OK == rc ) {
- response = access_group_to_value(ag);
- lsm_access_group_record_free(ag);
+ lsm_system *system = value_to_system(v_system);
+
+ if( system ) {
+ rc = p->san_ops->ag_create(
+ p,
+ v_name.asC_str(),
+ v_init_id.asC_str(),
+ (lsm_access_group_init_type)v_init_type.asInt32_t(),
+ system, &ag,
+ LSM_FLAG_GET_VALUE(params));
+ if( LSM_ERR_OK == rc ) {
+ response = access_group_to_value(ag);
+ lsm_access_group_record_free(ag);
+ }
+
+ lsm_system_record_free(system);
+ system = NULL;
}
} else {
rc = LSM_ERR_TRANSPORT_INVALID_ARG;
diff --git a/plugin/simc/simc_lsmplugin.c b/plugin/simc/simc_lsmplugin.c
index f19708b..310fa32 100644
--- a/plugin/simc/simc_lsmplugin.c
+++ b/plugin/simc/simc_lsmplugin.c
@@ -1147,7 +1147,7 @@ static int access_group_create(lsm_plugin_ptr c,
const char *name,
const char *initiator_id,
lsm_access_group_init_type id_type,
- const char *system_id,
+ lsm_system *system,
lsm_access_group **access_group,
lsm_flag flags)
{
@@ -1165,7 +1165,8 @@ static int access_group_create(lsm_plugin_ptr c,
if( initiators && id &&
(LSM_ERR_OK == lsm_string_list_elem_set(initiators, 0, initiator_id))) {
ag = lsm_access_group_record_alloc(id, name, initiators, id_type,
- system_id, NULL);
+ lsm_system_id_get(system),
+ NULL);
aag = alloc_allocated_ag(ag, id_type);
if( ag && aag ) {
g_hash_table_insert(pd->access_groups, (gpointer)id,
diff --git a/test/tester.c b/test/tester.c
index 96119d6..f7434af 100644
--- a/test/tester.c
+++ b/test/tester.c
@@ -600,16 +600,20 @@ START_TEST(test_access_groups)
uint32_t count = 0;
uint32_t i = 0;
lsm_string_list *init_list = NULL;
+ lsm_system *system = NULL;
int rc = 0;
fail_unless(c!=NULL);
+
+ system = get_system(c);
+
G(rc, lsm_access_group_list, c, NULL, NULL, &groups, &count, LSM_FLAG_RSVD);
fail_unless(count == 0, "Expect 0 access groups, got %"PRIu32, count);
fail_unless(groups == NULL);
G(rc, lsm_access_group_create, c, "test_access_groups",
- "iqn.1994-05.com.domain:01.89bd01", LSM_INITIATOR_ISCSI, SYSTEM_ID,
+ "iqn.1994-05.com.domain:01.89bd01", LSM_INITIATOR_ISCSI, system,
&group, LSM_FLAG_RSVD);
if( LSM_ERR_OK == rc ) {
@@ -720,6 +724,9 @@ START_TEST(test_access_groups)
groups = NULL;
count = 0;
}
+
+ G(rc, lsm_system_record_free, system);
+ system = NULL;
}
END_TEST
@@ -731,12 +738,14 @@ START_TEST(test_access_groups_grant_revoke)
lsm_pool *pool = get_test_pool(c);
char *job = NULL;
lsm_volume *n = NULL;
+ lsm_system *system = NULL;
fail_unless(pool != NULL);
+ system = get_system(c);
G(rc, lsm_access_group_create, c, "test_access_groups_grant_revoke",
ISCSI_HOST[0], LSM_INITIATOR_ISCSI,
- SYSTEM_ID,
+ system,
&group, LSM_FLAG_RSVD);
@@ -795,6 +804,8 @@ START_TEST(test_access_groups_grant_revoke)
G(rc, lsm_volume_record_free, n);
G(rc, lsm_pool_record_free, pool);
+
+ G(rc, lsm_system_record_free, system);
}
END_TEST
@@ -1511,16 +1522,19 @@ START_TEST(test_invalid_input)
/* lsmAccessGroupCreate */
lsm_access_group *ag = NULL;
+ lsm_system *system = NULL;
+ system = get_system(c);
- rc = lsm_access_group_create(c, NULL, NULL, 0, NULL, NULL, LSM_FLAG_RSVD);
+ rc = lsm_access_group_create(c, NULL, NULL, 0, system, NULL, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
rc = lsm_access_group_create(c, "my_group", ISCSI_HOST[0], LSM_INITIATOR_OTHER,
- "system-id", NULL, LSM_FLAG_RSVD);
- fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+ NULL, NULL, LSM_FLAG_RSVD);
+ fail_unless(rc == LSM_ERR_INVALID_SYSTEM, "rc = %d", rc);
+
rc = lsm_access_group_create(c, "my_group", ISCSI_HOST[0], LSM_INITIATOR_OTHER,
- SYSTEM_ID, &ag, LSM_FLAG_RSVD);
+ system, &ag, LSM_FLAG_RSVD);
fail_unless(rc == LSM_ERR_OK, "rc = %d", rc);
fail_unless(ag != NULL);
@@ -1778,8 +1792,6 @@ START_TEST(test_invalid_input)
int member_type = 65535;
uint64_t size = 0;
int flags = 10;
- lsm_system *system = get_system(c);
-
rc = lsm_pool_create(NULL, NULL, NULL, size, raid_type, member_type, NULL, NULL, flags);
fail_unless(rc == LSM_ERR_INVALID_CONN, "rc = %d", rc);
@@ -1821,13 +1833,10 @@ START_TEST(test_invalid_input)
rc = lsm_pool_record_free(test_pool);
fail_unless(LSM_ERR_OK == rc, "%d", rc);
- rc = lsm_system_record_free(system);
- fail_unless(LSM_ERR_OK == rc, "%d", rc);
-
-
- rc = lsm_string_list_free(f);
+ G(rc, lsm_system_record_free, system );
+ system = NULL;
+ G(rc, lsm_string_list_free, f);
f = NULL;
- fail_unless(LSM_ERR_OK == rc, "%d", rc);
}
END_TEST
@@ -1918,13 +1927,18 @@ END_TEST
START_TEST(test_iscsi_auth_in)
{
lsm_access_group *group = NULL;
+ lsm_system *system = NULL;
//char *job = NULL;
int rc;
+ system = get_system(c);
+
G(rc, lsm_access_group_create, c, "ISCSI_AUTH", ISCSI_HOST[0],
- LSM_INITIATOR_ISCSI, SYSTEM_ID, &group, LSM_FLAG_RSVD);
+ LSM_INITIATOR_ISCSI, system, &group, LSM_FLAG_RSVD);
fail_unless(LSM_ERR_OK == rc, "rc = %d");
+ G(rc, lsm_system_record_free, system);
+ system = NULL;
if( LSM_ERR_OK == rc ) {
/* TODO FIX THIS UP after we take out the C initiator support.
@@ -2670,15 +2684,18 @@ START_TEST(test_search_access_groups)
lsm_access_group *group = NULL;
lsm_pool *pool = get_test_pool(c);
+ lsm_system *system = get_system(c);
+ fail_unless(system != NULL, "Missing system!");
+
for( i = 0; i < 2; ++i ) {
char ag_name[64];
snprintf(ag_name, sizeof(ag_name), "test_access_group_%d", i);
G(rc, lsm_access_group_create, c, ag_name, ISCSI_HOST[i],
- LSM_INITIATOR_ISCSI, SYSTEM_ID, &group, LSM_FLAG_RSVD);
+ LSM_INITIATOR_ISCSI, system, &group, LSM_FLAG_RSVD);
if( LSM_ERR_OK == rc ) {
G(rc, lsm_access_group_record_free, group);
@@ -2686,6 +2703,9 @@ START_TEST(test_search_access_groups)
}
}
+ G(rc, lsm_system_record_free, system);
+ system = NULL;
+
G(rc, lsm_access_group_list, c, NULL, NULL, &ag, &count, LSM_FLAG_RSVD);
fail_unless(count > 0, "We are expecting some access_groups!");
--
1.8.2.1
1.8.2.1