Example #1
0
def test_dcgm_group_get_all_ids_standalone(handle):
    """
    Get all the group IDS configured on the host engine
    """
    handleObj = pydcgm.DcgmHandle(handle=handle)
    systemObj = handleObj.GetSystem()

    #Get the list of groups before we add ours so that we account for them
    groupIdListBefore = dcgm_agent.dcgmGroupGetAllIds(handle)

    expectedCount = len(groupIdListBefore)
    groupObjs = []

    for index in xrange(0, 10):
        expectedCount += 1
        name = 'Test'
        name += ` index `
        groupObj = systemObj.GetEmptyGroup(name)
        groupObjs.append(
            groupObj)  #keep reference so it doesn't go out of scope
        pass

    groupIdListAfter = dcgm_agent.dcgmGroupGetAllIds(handle)
    assert len(
        groupIdListAfter
    ) == expectedCount, "Num of groups less than expected. Expected: %d Returned %d" % (
        expectedCount, len(groupIdListAfter))
Example #2
0
def helper_dcgm_group_delete_grp(handle):
    handleObj = pydcgm.DcgmHandle(handle=handle)
    groupObj = pydcgm.DcgmGroup(handleObj, groupName="test1")
    groupId = groupObj.GetId().value

    #Delete the group
    groupObj.Delete()

    ids = dcgm_agent.dcgmGroupGetAllIds(handle)
    assert (groupId not in ids), "groupId %d in %s" % (groupId, str(ids))
Example #3
0
 def GetAllGroupIds(self):
     return dcgm_agent.dcgmGroupGetAllIds(self._dcgmHandle.handle)