def verify_vdbench_during_prop_edit(volname): logging.info('Sleeping for 10s....') time.sleep(10) #waiting 10s before editing other properties logging.info('Checking whether vdbench is still running or not....') check_vdbench = is_vdbench_alive(volname) if not check_vdbench: endTime = ctime() msg = 'Vdbench has stopped running after editing lun attributes' logAndresult(testcase, 'FAILED', msg, startTime, endTime)
def UseFileInMountPoint(volume): output = getoutput('mount | grep %s | awk \'{print $3}\'' \ %(volume['mountPoint'])) mount_point = output[0].strip('\n') exe_vdb = executeVdbenchFile(volume, VdbFile) time.sleep(20) #sleeping for 30s before trying to umount the volume on which vdbench is running logging.info('Now unmounting the mountPoint which is in use') check_vdbench = is_vdbench_alive(volume['name']) if check_vdbench: umount_output = executeCmd('umount mount/%s' %(volume['mountPoint'])) if umount_output[0] == 'FAILED': print 'expected result : %s' %(umount_output[1]) logging.debug('expected result: %s', umount_output[1]) umountFail = True return ['PASSED', umountFail] else: print 'Unexpected Result: Unmount happened when file in '\ 'mountPoint is in use' kill_process(volume['name']) return ['FAILED', 'Unmount happened when file in mountPoint is in use'] else: return ['FAILED', 'Vdbench stopped, MountPoint not in use']
volume = {'TSMIPAddress' : tsmIP, 'mountPoint': vol_mntPoint,\ 'name' : volname} nfsMount = mountNFS(volume) if nfsMount[0] == 'FAILED': msg = 'failed to mount NFS share "%s"' % (volume['name']) logAndresult(testcase, 'FAILED', msg, startTime, endTime) logging.info('Mounted Nfs Share "%s" successfully', volname) mount_point = getoutput('mount | grep %s | awk \'{print $3}\'' \ %(volume['mountPoint'])) mount_point = mount_point[0].strip('\n') executeVdbenchFile(volume, 'filesystem_nfs') check_vdbench = is_vdbench_alive(volname) time.sleep(1) while True: mountDetails = mountPointDetails('-m', mount_point) Used = mountDetails[2] if int(Used) >= 1000: logging.debug('vdbench has successfully created 1 GB file of the') logging.debug('going to stop vdbench after 10 seconds...') time.sleep(10) break check_vdbench = is_vdbench_alive(volname) if check_vdbench: continue else: logging.debug('vdbench has stopped unexpectedly....') break
%(tsmIP) + tsmList[1] logAndresult(testcase, 'BLOCKED', tsmList[1], startTime, endTime) vol1 = {'name': 'nfsDataset1', 'tsmid': tsmID, \ 'datasetid': datasetID, 'protocoltype': 'NFS', 'iops': 200} #creating volume and mouting the same final_result1 = addVol_client_Mount(vol1, stdurl, tsmID, tsmName, ClientIP) #running vdbench on the first volume logging.info('Running vdbench by using file') exe1 = executeVdbenchFile(final_result1[0], VdbFile) logging.info('waiting for 30s for vdbench to run on first dataset') time.sleep(30) check_vdbench1 = is_vdbench_alive(vol1['name']) if check_vdbench1: logging.info('vdbench is running on first dataset....') logging.info('Adding one more NFS dataset to the same VSM and '\ 'mounting it on the same client and running vdbench on it') #while Ios are running creating another volume to the same tenant vol2 = {'name': 'nfsDataset2', 'tsmid': tsmID, \ 'datasetid': datasetID, 'protocoltype': 'NFS', 'iops': 200} final_result2 = addVol_client_Mount(vol2, stdurl, tsmID, tsmName, ClientIP) time.sleep(2) logging.info('Checking whether vdbench is running on first dataset after' \ 'adding another dataset to same tenant') #verifying if IOs are affected on first volume
time.sleep(2) logging.debug('verifying IOPS at peer Node IP: %s', NODE2_IP) verify_IOPS_afterHA(NODE2_IP, PASSWD) time.sleep(120) logging.debug('Making Node: %s available', NODE1_IP) available_result = change_node_state(STDURL, NODE1_IP, 'available') if available_result[0] == 'FAILED': logging.debug('Not able to move Node to available state') logging.debug('Not going to delete volume, Node is not available') exit() verify_IOPS_afterHA(NODE1_IP, PASSWD) time.sleep(120) check_vdbench = is_vdbench_alive(volumeDict['name']) if check_vdbench: logging.debug('vdbench is running, going to kill the vdbench process...') kill_vdbench() time.sleep(2) check_vdbench = is_vdbench_alive(volumeDict['name']) if check_vdbench: logging.debug('Failed to kill vdbench process, going to kill again...') kill_vdbench() else: logging.debug('Successfully killed vdbench process') print 'Successfully killed vdbench process' else: logging.debug('Vdbench process has stopped unexpectedly...') print 'Vdbench process has stopped' exit()