Skip to content

Commit

Permalink
Merge pull request #347 from tasleson/add_c_group_init_type_get
Browse files Browse the repository at this point in the history
C API: Add lsm_access_group_init_type_get
  • Loading branch information
tasleson authored Oct 23, 2018
2 parents c1f65ff + 7a53f83 commit c5698e8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions c_binding/include/libstoragemgmt/libstoragemgmt_accessgroups.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,25 @@ const char LSM_DLL_EXPORT *
lsm_string_list LSM_DLL_EXPORT *
lsm_access_group_initiator_id_get(lsm_access_group * group);

/**
* lsm_access_group_init_type_get - Retrieves the initiator type for specified
* access group.
*
* Version:
* 1.7
*
* Description:
* Retrieves the initiator type for the specified access group.
*
* @group:
* Access group to retrieve type of initiators present.
*
* Return: lsm_access_group_init_type
*
*/
lsm_access_group_init_type LSM_DLL_EXPORT
lsm_access_group_init_type_get(lsm_access_group * group);


#ifdef __cplusplus
}
Expand Down
4 changes: 4 additions & 0 deletions c_binding/lsm_datatypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,10 @@ MEMBER_FUNC_GET(const char *, lsm_access_group, LSM_IS_ACCESS_GROUP, name,
MEMBER_FUNC_GET(const char *, lsm_access_group, LSM_IS_ACCESS_GROUP, system_id,
NULL);

MEMBER_FUNC_GET(lsm_access_group_init_type, lsm_access_group,
LSM_IS_ACCESS_GROUP, init_type,
LSM_ACCESS_GROUP_INIT_TYPE_UNKNOWN);

lsm_string_list *lsm_access_group_initiator_id_get(lsm_access_group * group)
{
if (LSM_IS_ACCESS_GROUP(group)) {
Expand Down
2 changes: 2 additions & 0 deletions test/tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,12 +683,14 @@ START_TEST(test_access_groups)
fail_unless(NULL != lsm_access_group_id_get(group));
fail_unless(NULL != lsm_access_group_name_get(group));
fail_unless(NULL != lsm_access_group_system_id_get(group));
fail_unless(LSM_ACCESS_GROUP_INIT_TYPE_ISCSI_IQN == lsm_access_group_init_type_get(group));

lsm_access_group *copy = lsm_access_group_record_copy(group);
if( copy ) {
fail_unless( strcmp(lsm_access_group_id_get(group), lsm_access_group_id_get(copy)) == 0);
fail_unless( strcmp(lsm_access_group_name_get(group), lsm_access_group_name_get(copy)) == 0) ;
fail_unless( strcmp(lsm_access_group_system_id_get(group), lsm_access_group_system_id_get(copy)) == 0);
fail_unless( lsm_access_group_init_type_get(group) == lsm_access_group_init_type_get(copy));

G(rc, lsm_access_group_record_free, copy);
copy = NULL;
Expand Down

0 comments on commit c5698e8

Please sign in to comment.