def nfsShareUnmount(volume):
    ### Unmounting NFS shares
    logging.info('Unmounting NFS shares "%s"', volume['name'])
    nfsUnmount = umountVolume(volume)
    if nfsUnmount == 'PASSED':
        logging.info('NFS share "%s" unmounted successfully', volume['name'])
    else:
        endTime = ctime()
        msg = 'failed to Unmount NFS share "%s"' % volume['name']
        logAndresult(testcase, 'FAILED', msg, startTime, endTime)
Exemple #2
0
                        ['FAILED', result[1]], startTime, endTime)
                    exit()

                time.sleep(2)
                startTime = ctime()
                # mapping volume as a cifs share
                vol = {
                    'name': '%s' % (config['volDatasetname%d' % (x)]),
                    'mountPoint': '%s' % (config['volMountpoint%d' % (x)]),
                    'AccountName': '%s' % (config['volAccountName%d' % (x)]),
                    'TSMIPAddress': '%s' % (config['volIPAddress%d' % (x)])
                }
                # mount
                mount = mountCIFS(vol)
                #umount
                uMount = umountVolume(vol)
                endTime = ctime()
                if mount == 'PASSED' and operation.lower() == 'true':
                    print 'Mount passed after cifs enable on a nfs enabled volume'
                    resultCollection(
                        'Mount passed after cifs enable on a nfs enabled volume',
                        ['PASSED', ''], startTime, endTime)
                    startTime = ctime()
                    disableResult = enabledDisableCIFS(config, vol_id, 'false')
                    endTime = ctime()
                    if disableResult[0] == 'PASSED':
                        print 'disable cifs on nfs enabled volume is passed'
                        resultCollection(
                            'disable cifs on nfs enabled volume is: ',
                            ['PASSED', ''], startTime, endTime)
                    else:
Exemple #3
0
                # mounting of CIFS sub filesystem
                startTime = ctime()
                mountResult = mountCIFS(subVol)
                endTime = ctime()
                if mountResult == 'FAILED':
                    resultCollection(
                        'Mount of CIFS sub filesystem %s is failed' %
                        (subVolName), ['FAILED', ''], startTime, endTime)
                else:
                    resultCollection(
                        'Mount of CIFS sub filesystem %s is passed' %
                        (subVolName), ['PASSED', ''], startTime, endTime)

                # umounting CIFS sub filesystem
                startTime = ctime()
                umountResult = umountVolume(subVol)
                endTime = ctime()
                if umountResult == 'FAILED':
                    resultCollection(
                        'Umount of CIFS sub filesystem %s is failed' %
                        (subVolName), ['FAILED', ''], startTime, endTime)
                else:
                    resultCollection(
                        'Umount of CIFS sub filesystem %s is passed' %
                        (subVolName), ['PASSED', ''], startTime, endTime)

                # getting id of newly created sub filesystem
                startTime = ctime()
                subVolumes = listVolume(config)
                endTime = ctime()
                if subVolumes[0] == 'FAILED':
        'mountPoint': mount_p,
        'TSMIPAddress': Tsm_ip
    }
    logging.info("Mounting Nfs volumes")
    result_mount = mountNFS(volume)
    if result_mount == 'PASSED':
        logging.info("volume mounted sucessfully %s" % result_mount)
    elif result_mount == 'FAILED':
        logging.error("Failed to mount volumes %s so ending the script" %
                      result_mount)
        endTime = ctime()
        resultCollection('Umounting volume test case is', \
                ['BLOCKED', result_mount], startTime, endTime)

    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")
Exemple #5
0
    print 'volume is mounted succesfully with %s protocol' % prtcl
    logging.debug('volume is mounted succesfully with %s protocol', prtcl)
else:
    msg = 'Failed to mount nfs share with %s protocol' % prtcl
    endTime = ctime()
    logAndresult(testcase, 'FAILED', msg, startTime, endTime)

endTime = ctime()
resultCollection('%s, testcase is' %testcase, ['PASSED', ' '],\
                startTime, endTime)
resultCollectionNew('"%s" testcase ends....' % testcase, ['', '\n'])

time.sleep(2)  #before unmounting waiting for 2s
logging.debug('Unmounting Nfs share %s', (volname))
#nfsUmount2 = umountVolume(vol) - ERROR
nfsUmount2 = umountVolume(volume)
if nfsUmount2 == '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 deleteVolume[0] == 'PASSED':
    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)
Exemple #6
0
            mountStatus)
else:
    endTime = ctime()
    print mountResult[1]
    #print 'NFS volume \"%s\" failed to mount' %(volume['name'])
    #msg = 'failed to mount NFS share "%s"' %volume['name']
    logAndresult(testcase, 'FAILED', mountResult[1], startTime, endTime)
   
endTime = ctime()
resultCollection('NFS soft/hard mount, testcase is', ['PASSED', ' '],\
                startTime, endTime)
resultCollectionNew('"%s" testcase ends....' %testcase, ['', '\n'])

time.sleep(2) #before unmounting waiting for 2s
logging.info("UnMounting NFS Share '%s'", volume['name'])
umount = umountVolume(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 deleteVolume[0] == 'PASSED':
    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)
Exemple #7
0
    elif io_output[0] == 'PASSED':
        msg = "Iops are  running correct"
        logging.debug('Compared result: %s', msg)
        print msg
        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"---')
Exemple #8
0
         resultCollection('Testcase for readonly condition is Passed in ISCSI', \
                 ['PASSED',''], startTime, endTime)
     elif mkdir_res[0] == 'PASSED' and readonly_value == 'false':
         logging.debug('Testcase for readonly condition is Passed')
         endTime = ctime()
         resultCollection('Testcase for readonly condition is Passed in ISCSI ', \
                 ['PASSED',''], startTime, endTime)
     else:
         logging.debug('Testcase for readonly condition is FAILED')
         endTime = ctime()
         resultCollection('Testcase for readonly condition is failed in ISCSI', \
                 ['FAILED',''], startTime, endTime)
 logging.info('logging out from iscsi session')
 login_result = iscsi_login_logout(iqn, tsm_ip, 'logout')
 logging.debug('unmounting the volume %s', (volname))
 Umount1 = umountVolume(mount_dir)
 logging.debug('unmounting volume result is %s', (Umount1))
 if Umount1 == 'PASSED':
     logging.info('Deleting the created volume')
     del_vol = delete_volume(volid, stdurl)
     print del_vol
     logging.debug('deleteing volume result is %s', (del_vol))
     exit()
 else:
     errormsg = "Problem in unmounting volume hence volume is not deleted"
     endTime = ctime()
     resultCollection('umounting volume failed', ['BLOCKED', ''], startTime,
                      endTime)
 logging.info('---End of script  "Modify the lun Attributes and \
         verify if I/o interrupts values"...')
 exit()