Пример #1
0
def tsm_creation_flow(stdurl, poolName, acctName, tsm_params):
    #pool details
    list_pool = listPool(stdurl)
    if list_pool[0] == 'FAILED':
        return ['FAILED', list_pool[1]]
    pool_info = get_pool_info(list_pool[1], poolName)
    if pool_info[0] == 'FAILED':
        return ['FAILED', pool_info[1]]
    pool_id = pool_info[1]
    logging.debug('Pool id of pool "%s" is: %s', poolName, pool_id)
    #account details
    account_creation = create_account(acctName, stdurl)
    if account_creation[0] == 'FAILED' and 'already exists' in str(
            account_creation[1]):
        logging.debug('Account already exist, taking its details..')
    elif account_creation[0] == 'FAILED':
        return ['FAILED', account_creation[1]]
    logging.debug('"%s" Account created successfully', acctName)
    list_acct = listAccount_new(stdurl)
    if list_acct[0] == 'FAILED':
        return ['FAILED', list_acct[1]]
    get_accInfo = get_account_info(list_acct[1], acctName)
    if get_accInfo[0] == 'FAILED':
        return ['FAILED', get_accInfo[1]]
    acct_id = get_accInfo[1]
    logging.debug('Account Id of account "%s" is: %s', acctName, acct_id)
    #tsm details
    req_ids = {'poolid': pool_id, 'accountid': acct_id}
    final_tsm_params = dict(tsm_params.items() + req_ids.items())
    logging.debug('final_tsm_params : %s', final_tsm_params)
    tsm_creation = create_tsm(final_tsm_params, stdurl)
    if tsm_creation[0] == 'FAILED':
        return ['FAILED', tsm_creation[1]]
    return ['PASSED', 'Tsm "%s" created successfully' % (tsm_params['name'])]
Пример #2
0
if allocatable_diskidlist[0] == 'FAILED':
    logging.error('Testcase %s is blocked due to' \
            ': %s', tcName, allocatable_diskidlist[1])
    is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG)
allocatable_diskidlist = allocatable_diskidlist[1]
# Get params for pool creation (Needs controller, pool info etc..,)
pool_params = {'name': POOL_NAME, 'siteid': site_id, 'clusterid': \
        ctrl_cluster_id, 'controllerid': ctrl_id, 'iops': POOL_IOPS, \
        'diskslist': allocatable_diskidlist, 'grouptype': POOL_TYPE}
pool_creation = create_pool(pool_params, STDURL)
if pool_creation[0] == 'FAILED':
    logging.error('Testcase %s is blocked due to' \
            ' : %s', tcName, pool_creation[1])
    is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG)

pool_result = listPool(STDURL)
if pool_result[0] == 'FAILED':
    print 'Not able to get Pools...'
    logging.error('mount/umount 100 NFS volumes test case is blocked...')
    is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG)
elif pool_result[0] == 'BLOCKED':
    print 'There is no pool...'
    logging.debug('mount/umount 100 NFS volumes test case is')
    is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG)
else:
    pools = pool_result[1]

pool_info = get_pool_info(pools, pool_name)
if pool_info[0] == 'FAILED':
    print 'Not able to get pool ID...'
    logging.error('Not able to get pool ID, Error: %s', pool_info[1])
Пример #3
0
pool_params = {'name': POOL_NAME, 'siteid': site_id, 'clusterid': ctrl_cluster_id, \
        'controllerid': ctrl_id, 'iops': POOL_IOPS, 'diskslist': allocatable_diskidlist, \
        'grouptype': POOL_TYPE}

# Pool creation step

pool_creation = create_pool(pool_params, STDURL)
if pool_creation[0] == 'FAILED':
    logging.error('Testcase %s is blocked due to' \
           ' : %s', tcName,pool_creation[1])
    is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG)

# Obtain the Pool list for before extracting the name

pool_list = listPool(STDURL)
if pool_list[0] == 'FAILED':
    logging.error('Testcase %s is blocked due to' \
            ': %s',tcName, pool_list[1])
    is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG)
pool_list = pool_list[1]

# Get the pool_info for the desired from the list obtained above

#pool_info = get_pool_info(pool_list, POOL_NAME)
pool_info = get_pool_info(pool_list, None)
if pool_info[0] == 'FAILED':
    logging.error('Testcase %s is blocked due to' \
           ' : %s', tcName, pool_info[1])

# Extract the pool_id from the info obtained for said pool above