Example #1
0
def delete_dataset(volname, volid, stdurl):
    deleteVolume = delete_volume(volid, stdurl)
    if 'PASSED' in deleteVolume:
        print 'Volume \"%s\" Deleted successfully' % (volname)
        logging.debug('Volume \"%s\" Deleted successfully', volname)
    else:
        print 'Failed to deleted the volume \"%s\"' % (volname)
        logging.debug('Failed to deleted the volume \"%s\"', volname)
Example #2
0
    endTime = ctime()
    msg = 'failed to Unmount NFS share "%s"' % (volume['name'])
    logAndresult(testcase, 'FAILED', msg, startTime, endTime)
else:
    logging.debug('Volume "%s" umounted successfully', volume['name'])

command = 'cat /var/log/devd.log | grep %s | grep -w  unmount' \
        %(volume['mountPoint'])

logs = getControllerInfoAppend(nodeIP, passwd, command, "results/result.csv")
logging.debug('Mount alerts from devd.log is: %s', logs)
print logs

endTime = ctime()
resultCollection('NFS share mount/umount alerts(devd logs), '\
    'testcase is', ['PASSED',' '],startTime, endTime)
resultCollectionNew('"%s" testcase ends....' % testcase, ['', '\n'])

delvol = delete_volume(volid, stdurl)
if 'FAILED' in delvol:
    print 'Failed to deleted the volume \"%s\"' % (volume['name'])
    logging.debug('Failed to deleted the volume \"%s\"', \
                        volume['name'])
else:
    print 'Volume \"%s\" Deleted successfully' % (volume['name'])
    logging.debug('Volume \"%s\" Deleted successfully', \
                    volume['name'])

logging.info('----End of testcase "%s"----\n', testcase)
print('----End of testcase "%s"----\n' % testcase)
Example #3
0
            time.sleep(10)
            break
        check_vdbench = is_vdbench_alive(volname)
        if check_vdbench:
            continue
        else:
            logging.debug('vdbench has stopped unexpectedly....')
            break

    kill_vdbench()
    logging.info('waiting for 10s')
    time.sleep(10)

    umount_output = executeCmd('umount -l mount/%s' % (volume['mountPoint']))
    if umount_output[0] == 'FAILED':
        logging.error('Not able to umount %s, still go ahead and delete '\
     'the NFS share', volname)
    else:
        logging.debug('NFS share %s umounted successfully', volname)

    delete_result = delete_volume(volid, stdurl)
    endTime = ctime()
    if delete_result[0] == 'FAILED':
        logAndresult(testcase, 'FAILED', delete_result[1], startTime, endTime)

    logging.debug('Volume "%s" deleted successfully', volname)
    logging.info('volume provision was successful for "%s times"', n)
endTime = ctime()
resultCollection('%s, testcase is' %testcase, ['PASSED',' '], \
                startTime, endTime)
Example #4
0
    logging.debug('mount/umount 100 NFS volumes test case is failed...')
    resultCollection('mount/umount 100 NFS volumes test case is', \
            ['FAILED', ''], startTime, endTime)
else:
    print 'Having problem in umounting all the volumes...'
    logging.error('Having problem in umounting all the volumes...')
    logging.debug('mount/umount 100 NFS volumes test case is failed...')
    resultCollection('mount/umount 100 NFS volumes test case is', \
            ['FAILED', ''], startTime, endTime)
#------------------------------------------------------------------------------

###Deleting volumes------------------------------------------------------------
for x in range(1, 6):
    i = 20 * (x - 1)
    for y in range(1, 21):
        result = delete_volume(VOLUME_IDs[i], STDURL)
        if result[0] == 'FAILED':
            VOL_REMOVE = False
        i = i + 1
#------------------------------------------------------------------------------

###deleting TSM/VSM------------------------------------------------------------
if VOL_REMOVE:
    for x in range(0, 5):
        delete_tsm_resp = delete_tsm(TSM_IDs[x], STDURL)
        if delete_tsm_resp[0] == 'FAILED':
            TSM_REMOVE = False
#------------------------------------------------------------------------------

#verifying and logging remove_configuration details----------------------------
if VOL_REMOVE and TSM_REMOVE:
Example #5
0
remove_configuration = False
if node_online:
    #There might be few chances to Node come up, and suddenly we move it...
    #to available state, so sleep for 5 seconds
    time.sleep(5)
    available_state = change_node_state(STDURL, NODE1_IP, 'available')
    if available_state == 'FAILED':
        logging.debug('Not able to move Node to available state, Will not be '\
                'able to remove configuration')
    else:
        logging.debug('Node with IP: %s is in available state, removing '\
                'configuration', NODE1_IP)
        remove_configuration = True
else:
    logging.debug('Node did not come up can not remove configuration, please '\
            'check it manually...')

if remove_configuration:
    logging.debug('ungracefull HA test case(iSCSI) completed, removing '\
            'configuration')
    add_auth_grup = assign_iniator_gp_to_LUN(STDURL, vol_id, account_id,
                                             'None')
    if add_auth_grup[0] == 'FAILED':
        logging.error(
            'Not able to set auth group to None, do not delete volume')
        get_logger_footer('ungracefull HA test case(iSCSI) completed')
    else:
        logging.debug('Go and delete the volume')
        delete_volume(vol_id, STDURL)
        get_logger_footer('ungracefull HA test case(iSCSI) completed')
Example #6
0
    logging.debug('Successfully deleted user "%s"', usr2)
    print 'Successfully deleted user "%s"' % usr2

#changing back home path....
HOME = getoutput('cat /etc/default/useradd | grep HOME | cut -d  "=" -f 2')
HOME = HOME[0].rstrip('\n')
replace_data(infile, HOME, '/home')
logging.debug('replacing back Home path as "/home" in %s file', infile)
print 'replacing back Home path as "/home" in %s file' % infile

#unmounting and deleting the volume....
umount = umount_nfs_volume(volume)
if umount == 'PASSED':
    logging.debug('Volume "%s" umounted successfully', volume['name'])
else:
    logging.debug('Failed to umount the volume "%s"', volume['name'])

logging.info('Deleting volume "%s"', volume['name'])
deleteVolume = delete_volume(volid, stdurl)
if 'PASSED' in deleteVolume:
    print 'Volume \"%s\" Deleted successfully' % (volume['name'])
    logging.debug('Volume \"%s\" Deleted successfully', \
                volume['name'])
else:
    print 'Failed to deleted the volume \"%s\"' % (volume['name'])
    logging.debug('Failed to deleted the volume \"%s\"', \
                    volume['name'])

logging.info('----End of testcase "%s"----\n', testcase)
print('----End of testcase "%s"----\n' % testcase)
# umount the NFS share
umountResult = executeCmd('umount %s' % (CLIENT_MOUNT_PNT))

#logging out the iSCSI LUN from client
iscsiLogout = iscsi_login_logout(discoverIqn, VSM_IP, 'logout')

# setting authentication group to 'None' before deleting the iSCSI LUN
addIscsiAuthGrup = assign_iniator_gp_to_LUN(STDURL, volId, account_id, 'None')
if addIscsiAuthGrup[0] == 'FAILED':
    logging.error('Not able to set auth group to None, do not delete volume')
    get_logger_footer('AMSx-WLAx-NSWx-ISCSI-IORx-TC_CONTINUOUS_ISTGTCONTROL_REFRESH test case is '\
            'completed')
    exit()

# going to delete the nfs share
delete_vol = delete_volume(volId, STDURL)
if delete_vol[0] == 'FAILED':
    print 'Volume deleetion failed after running multiple sighup test case'
    logging.debug('Volume deletion failed after running multiple sighup '\
            'test case, error is : %s', delete_vol[1])
    logging.debug('Since volume is not deleted, not going to delete VSM')
    get_logger_footer(
        'AMSx-WLAx-NSWx-ISCSI-IORx-TC_CONTINUOUS_ISTGTCONTROL_REFRESH test case is completed'
    )
    exit()

# Volume deleted successfully, going to deete VSMs
logging.debug('Volume deleted bsuccessfully, going to deete VSMs ')
delete_vsm = delete_tsm(vsmId, STDURL)
if delete_vsm[0] == 'FAILED':
    print 'VSM deleetion failed after running multiple sighup test case'
Example #8
0
    logging.info("Started umounting volumes")
    result_umount = umountVolume(volume)
    print result_umount
    if result_umount == 'PASSED':
        logging.info('volume umounted succesfull')
        endTime = ctime()
        resultCollection('Volume is Unmounted Succesfully is', \
                            ['PASSED', ''], startTime, endTime)
    elif result_umount == 'FAILED':
        logging.error("failed to umount %s " % result_umount)
        endTime = ctime()
        resultCollection('Volume is not unmounted Succesfully', \
                ['FAILED', ''], startTime, endTime)

    ## deleting volumes
    if result_umount == 'PASSED':
        logging.info("volume deletion is in progress")
        result_delete = delete_volume(volId, stdurl)
        if result_delete[0] == 'PASSED':
            logging.info("volume deleted sucessfully")
            print result_delete
        elif result_delete[0] == 'FAILED':
            print result_delete
            logging.error('Failed to umount volumes %s' % result_delete)
            endTime = ctime()
            resultCollection('Failed to Delete', \
                    ['BLOCKED', result_mount], startTime, endTime)
    logging.info('---------------Execution of CreateMountDeletenfs.py script'\
            'ENDs-----------------')
Example #9
0
        endTime = ctime()
        resultCollection('Iops value are different after updating the value in ISCSI', \
                ['PASSED',''], startTime, endTime)
    else:
        print "problem in comparing files"

    time.sleep(130)
    logging.info('Executing Vdbench stopped')
    logging.info('logging out from iscsi session')
    login_result = iscsi_login_logout(iqn, tsm_ip, 'logout')
    logging.debug('unmounting the volume %s', (iops_volname))
    nfsUmount1 = umountVolume(mount_dir)
    logging.debug('unmounting volume result is %s', (nfsUmount1))
    if nfsUmount1 == 'PASSED':
        logging.info('Deleting the created volume')
        del_vol = delete_volume(iops_volid, stdurl)
        print del_vol
        logging.debug('deleteing volume result is %s', (del_vol))
    else:
        errormsg = "Problem in unmounting volume"
        endTime = ctime()
        resultCollection('umounting volume failed', ['BLOCKED', ''], startTime,
                         endTime)

    logging.info('---End of script "Edit QoS properties while '\
            'running IOPS and verify QoS values"---')

if TpEnable_flag == 1:
    logging.info(
        'Creating dictionary for creating volume with throughput enabled')
    volume2 = {'name': 'IscsiTpVol', 'tsmid': tsm_id, 'datasetid': dataset_id,\