def space_increase_nfs(stdurl, tsmID): startTime = ctime() volList = listVolumeWithTSMId_new(stdurl, tsmID) endTime = ctime() if volList[0] == 'FAILED': logAndresult(tcName, 'BLOCKED', volList[1], startTime, endTime) get_volInfo = get_volume_info(volList[1], volname) vol_quota = get_volInfo[6] logging.debug('volume size is: %s', vol_quota) logging.info('Increasing space of NFS volume') vol_quota1 = vol_quota.strip('G') quota = int(vol_quota1) + 2 quota = '%sG' % quota quota1 = quota.rstrip('G') edit_quota = edit_vol_quota(volid, quota, stdurl) if edit_quota[0] == 'FAILED': logAndresult(tcName, 'FAILED', edit_quota[1], startTime, endTime) logging.debug('Successfully updated quota of volume "%s" from %s to %s'\ ,volname, vol_quota, quota) time.sleep(5) logging.info('verifying quota update of client side') mountDetails1 = mountPointDetails('-h', mount_point) size = mountDetails1[1].strip('G') if float(size) == float(quota1): logging.debug('Quota on client after size update is : %sG', size) logging.debug('Quota of Nfs share has been updated on client side') else: endTime = ctime() msg = 'Size is not updated on client side, current size is : %s' % size logAndresult(tcName, 'FAILED', msg, startTime, endTime)
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 kill_vdbench() logging.info('waiting for 10s')
mnt_iscsi = iscsi_mount_flow(volname, tsmIP, vol_iqn, vol_mntPoint, 'ext3') endTime = ctime() if mnt_iscsi[0] == 'FAILED': logAndresult(testcase, 'BLOCKED', mnt_iscsi[1], startTime, endTime) logging.debug('%s', mnt_iscsi[1]) device, iqn = mnt_iscsi[3], mnt_iscsi[2] mount_point = getoutput('mount | grep %s | awk \'{print $3}\'' \ %(volume['name'])) 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 kill_process(volname) logging.info('waiting for 10s')
nfsMount = mountNFS(volume) if nfsMount == 'PASSED': logging.info('Mounted Nfs Share "%s" in "mount/%s" successfully',\ volume['name'], volume['mountPoint']) else: endTime = ctime() msg = 'failed to mount NFS share "%s"' % (volume['name']) logAndresult(testcase, 'FAILED', msg, startTime, endTime) # getting mountPoint path mount_point = getoutput('mount | grep %s | awk \'{print $3}\'' \ %(volume['mountPoint'])) mount_point = mount_point[0].strip('\n') # getting mountPoint details like size, used, available & so on mountDetails = mountPointDetails("-h", mount_point) if mountDetails[0] == 'FAILED': logAndresult(testcase, 'FAILED', mountDetails[1], startTime, endTime) totalSize, usedSize, availableSize, usepercentage = mountDetails[1], \ mountDetails[2], mountDetails[3], mountDetails[4] print 'Before adding file(s), the used space is' space_data = [[totalSize, usedSize, availableSize, usepercentage]] #initial_data = tabulate(space_data, \ # headers=['Size', 'Used', 'Avail', 'Use%'], tablefmt="psql") #returning o/p in the form of table #print initial_data #logging.info('Before adding file(s), the space details is shown below') #logging.debug('\n%s', initial_data)
final_result2 = addVol_client_Mount(vol2, stdurl, tsmID, tsmName, ClientIP) # writting 20GB of data vol_size = '20G' vol_size1 = vol_size.strip('G') vol_size1 = int(vol_size1) * 1024 exe = writingVDBfile(final_result1[0], VdbFile, vol_size) check_vdbench = is_vdbench_alive(vol1['name']) mount_point1 = getoutput('mount | grep %s | awk \'{print $3}\'' \ %(final_result1[0]['mountPoint'])) mount_point1 = mount_point1[0].strip('\n') startTime = ctime() while True: mountDetails = mountPointDetails('-m', mount_point1) Used = mountDetails[2] if int(Used) >= int(vol_size1): logging.info('Vdbench has filed large file of 20G, waiting for 30s') time.sleep(30) break else: check_vdbench = is_vdbench_alive(vol1['name']) if check_vdbench: continue else: endTime = ctime() msg = 'vdbench has stopped unexpectedly, File filed by vdbench '\ 'was : %sM' %Used logAndresult(testcase, 'FAILED', msg, startTime, endTime)