def is_blocked(): endTime = ctime() get_logger_footer('Working of LUN attributes on HA failover/HA availability'\ 'test completed') resultCollection('Working of LUN attributes on HA failover/HA availability'\ 'test case is', ['BLOCKED', ''], startTime, endTime) exit()
def verify_IOPS_afterHA(NODE2_IP, PASSWD, iops_datapath): endTime = ctime() cmd = 'reng stats access dataset %s qos | head -n 4 ; sleep 2 ;\ echo "-----------------"; reng stats access dataset %s qos |\ head -n 4' % (iops_datapath, iops_datapath) logging.debug('executing the command %s in controller', str(cmd)) iops_res = getControllerInfo(NODE2_IP, PASSWD, cmd, 'afterHAIO1.txt') print iops_res logging.debug('iops result is %s', (iops_res)) logging.debug('sleeping for 3 seconds before fatching new IOPS value...') time.sleep(3) logging.debug('executing the command %s in controller', str(cmd)) iops_res = getControllerInfo(NODE2_IP, PASSWD, cmd, 'afterHAIO2.txt') print iops_res logging.debug('iops result is %s', (iops_res)) io_output = executeCmdNegative('diff afterHAIO1.txt afterHAIO2.txt') if io_output[0] == 'FAILED': msg = 'IOPS are not running after HA failover...' logging.debug('Compared result: %s, Error: %s', io_output[0], msg) logging.debug('IOPS Error: ungracefull HA test case(iSCSI) failed...') resultCollection('Ungracefull HA test case(iSCSI) failed', \ ['FAILED', ''], startTime, endTime) elif io_output[0] == 'PASSED': msg = "IOPS are running fine after ungracefull HA" logging.debug('Compared result: %s', msg) resultCollection('Ungracefull HA test case(iSCSI) passed', \ ['PASSED', ''], startTime, endTime) print msg else: print "problem in comparing files" logging.error('problem in comparing files') is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG)
def is_blocked(): endTime = ctime() get_logger_footer( 'Modifying QOS attributes on iSCSI volume, test completed') resultCollection('Modifying QOS functionality on iSCSI LUN, test case is',\ ['BLOCKED', ''], startTime, endTime) exit()
def verify_create_snapshot(create_snp_result): if create_snp_result[0] == 'PASSED': endTime = ctime() resultCollection('Snapshot created successfully on iSCSI LUN', ['PASSED', ''], startTime, endTime) return is_blocked()
def logAndresult(testcase, failed, parameter, startTime, endTime): logging.debug('"%s" testcase is %s due to: "%s"', testcase, failed, parameter) logging.debug('----Ending script because this testcase is %s----\n', failed) resultCollection('"%s" testcase is ' %testcase, ['%s' %failed, ' '], \ startTime, endTime) exit()
def snapshot_conclusion(condition, ls1, ls2, mkdir1, msg): endTime = ctime() logging.debug('files or directory created before taking snapshot should '\ 'be there: %s', ls1) logging.debug('files or directory created after taking snapshot should '\ 'not be be there: %s', ls2) logging.debug('files or directory create after revert snapshot should '\ 'create: %s', mkdir1) logging.debug('%s', msg) if condition == 'PASSED': resultCollection('snapshot functionality on iSCSI LUN is working ' 'fine...', ['PASSED', ''], startTime, endTime) else: resultCollection('Snapshot functionality is not working...', \ ['FAILED', ''], startTime, endTime)
def calling_edit_thread(tsm_id, nfsThread, stdurl): startTime = ctime() edit_threads = editNFSthreads(tsm_id, nfsThread, stdurl) if edit_threads[0] == 'FAILED': endTime = ctime() logging.debug('Failed to update nfs threads while IOs are '\ 'running due to: %s', edit_threads[1]) resultCollection('%s ,testcase is' %testcase, ['BLOCKED', ''], \ startTime, endTime) return 'BLOCKED' else: endTime = ctime() print 'Successfully updated nfs threads for volume "%s" to %s'\ ' while IOs are running' %(volname, nfsThread) logging.debug('Successfully updated nfs threads for volume "%s" to %s'\ ' while IOs are running' ,volname, nfsThread) return 'PASSED'
def check_mendatory_arguments(argvs, numbers, syntax, footer_msg, blocked_msg, \ startTime): #numbers means total parameters try: if len(argvs) < int(numbers): print 'Arguments are not correct, Please provide as follows...' print '%s' %(syntax) logging.error('Arguments are not correct, provide as follows...') logging.debug('%s', syntax) get_logger_footer('%s' %(footer_msg)) exit() except ValueError: endTime = ctime() print 'Value for numbers is not integer' logging.error('Value for number of arguments is not integer ...') get_logger_footer('%s' %(footer_msg)) resultCollection('%s' %blocked_msg, ['BLOCKED', ''], startTime, endTime) exit() return
executeCmd('cp %s mount/cifs3/%s' % (filename3, config['volCifsMountpoint%d' % (x)])) mountres1 = executeCmd('ls mount/cifs1/%s | grep %s' % (config['volCifsMountpoint%d' % (x)], filename1)) mountres2 = executeCmd('ls mount/cifs1/%s | grep %s' % (config['volCifsMountpoint%d' % (x)], filename2)) mountres3 = executeCmd('ls mount/cifs1/%s | grep %s' % (config['volCifsMountpoint%d' % (x)], filename3)) endTime = ctime() if mountres1[0] == 'PASSED' and mountres2[0] == 'PASSED' and mountres3[ 0] == 'PASSED': resultCollection( "Mount is passed of volume \"%s\", and able to see file copied by other clients : " % (config['volCifsMountpoint%d' % (x)]), ['PASSED', ''], startTime, endTime) else: resultCollection( "Mount is passed of volume \"%s\", but not able to see files copied by other clients : " % (config['volCifsMountpoint%d' % (x)]), ['FAILED', ''], startTime, endTime) else: endTime = ctime() resultCollection( "Mount of NFS Volume \"%s\" at multiple places test case is : " % (config['volCifsMountpoint%d' % (x)]), ['FAILED', ''], startTime, endTime) ### umount executeCmd('umount mount/cifs1/%s' % (config['volCifsMountpoint%d' % (x)]))
volumes = listVolume(config) endTime = ctime() # checking volumes are there or not if volumes[0] == 'PASSED': volumes = volumes[1] elif volumes[0] == 'BLOCKED': print 'There is no volume for list' resuleCollection( 'There is no volume, So skippping test case for enabling cifs on nfs enabled volume', ['BLOCKED', ''], startTime, endTime) exit() else: print 'Faile to list volumes due to: ' + volumes[1] resultCollection( 'Failed to list volumes, So skipping test case for enabling cifs on nfs enabled volume', ['BLOCKED', volumes[1]], startTime, endTime) exit() # Enabling cifs on nfs enabled volumes for x in range(1, int(config['Number_of_NFSVolumes']) + 1): for volume in volumes: # getting volume id if volume['name'] == "%s" % (config['volDatasetname%d' % (x)]): vol_id = volume['id'] if vol_id is not None: startTime = ctime() # enabling cifs result = enabledDisableCIFS(config, vol_id, operation) endTime = ctime() # checking for cifs enable successful or not
resp_listHAPool = sendrequest(stdurl, querycommand) filesave("logs/listHAPool.txt", "w", resp_listHAPool) data = json.loads(resp_listHAPool.text) hapools = data["listHAPoolResponse"]["hapool"] for hapool in hapools: pool_id = hapool['id'] pool_name = hapool['name'] for x in range(1, int(config['Number_of_Pools']) + 1): if pool_name == "%s" % (config['poolName%d' % (x)]): id = pool_id querycommand = 'command=updateHAPool&id=%s&deduplication=%s&' % ( id, dedupvalue) startTime = ctime() resp_updateHAPool = sendrequest(stdurl, querycommand) filesave("logs/updateHAPool.txt", "w", resp_updateHAPool) data = json.loads(resp_updateHAPool.text) if "errortext" in data['updateHAPoolResponse']: print "\nError : " + data['updateHAPoolResponse']['errortext'] endTime = ctime() resultCollection( "Failed to update deduplication as \"%s\" on pool \"%s\"" % (dedupvalue, pool_name), ["FAILED", ''], startTime, endTime) else: print "deduplication for %s updated" % (pool_name) endTime = ctime() resultCollection( "PASS to update deduplication as \"%s\" on pool \"%s\"" % (dedupvalue, pool_name), ["PASSED", ''], startTime, endTime)
if len(sys.argv) < 2: print 'Please provide correct arguments, as follows...' print 'python verifyAuthOnSubFilesystem.py configurationfole.txt' exit() startTime = ctime() config = configFile(sys.argv) stdurl = getURL(config) volumes = listVolume(config) subVolName = None tsm_id = None if volumes[0] == 'BLOCKED': endTime = ctime() resultCollection( 'There is no CIFS filesystem to run \"Verify authentication on sub filesystem\" test case: ', ['BLOCKED', ''], startTime, endTime) elif volumes[0] == 'FAILED': endTime = ctime() resultCollection( 'Failed to list filesystem, \"Verify authentication on sub filesystem\" test case:', ['BLOCKED', volumes[1]]) else: volumes = volumes[1] for x in range(1, int(config['Number_of_CIFSVolumes']) + 1): for volume in volumes: if volume['name'] == "%s" % (config['volCifsDatasetname%d' % (x)]): try: vol_id = volume['id'] tsm_id = volume['Tsmid'] except:
tsmid = None if listTsm['name'] == "%s" %(config['tsmName%d' %(x)]): tsm_name = listTsm['name'] tsm_dataset_id = listTsm['datasetid'] if tsm_dataset_id is not None: ### Create TSM level snapshot if createSnp: querycommand = 'command=createStorageSnapshot&id=%s&name=%s' %(tsm_dataset_id, Name) resp_tsm_create_snp = sendrequest(stdurl, querycommand) filesave("logs/create_tsm_snapshot.txt", "w",resp_tsm_create_snp) tsmSnpResp = json.loads(resp_tsm_create_snp.text) if 'errortext' in str(tsmSnpResp): endTime = ctime() errorstatus = str(tsmSnpResp['createStorageSnapshotResponse']['errortext']) resultCollection("Result for snapshot \"%s\" creation on TSM %s is: " %(Name, config['tsmName%d' %(x)]), ['FAILED', errorstatus], startTime, endTime) else: getControllerInfo(IP, passwd, 'zfs list -t snapshot | grep %s' %(Name), "tsm_snapshot_result.txt") ## verifying snapshot for cifs volumes for p in range(1, int(config['Number_of_CIFSVolumes'])+1): cifsresult = executeCmd('cat tsm_snapshot_result.txt | grep %s@%s > tsm_snapshot_result2.txt' %(config['volCifsDatasetname%d' %(p)], Name)) if cifsresult[0] == 'FAILED': tsmFlag = 0 endTime = ctime() resultCollection("Result for snapshot \"%s\" creation on volume %s is: " %(Name, config['volCifsDatasetname%d' %(p)]), cifsresult, startTime, endTime) ## verifying snapshot for nfs volumes for q in range(1, int(config['Number_of_NFSVolumes'])+1): nfsresult = executeCmd('cat tsm_snapshot_result.txt | grep %s@%s > tsm_snapshot_result2.txt' %(config['volDatasetname%d' %(q)], Name))
for vlan in vlans: if vlan['name'] == "vlan%s" % (config['vlanTag%d' % x]): #vlan_id = data['listSharedNICsResponse']['nic'][0]['id'] vlan_id = vlan['id'] break ###TO Delete VLAN Interface querycommand = 'command=deleteVLAN&id=%s' % (vlan_id) resp_deleteVLAN = sendrequest(stdurl, querycommand) filesave("logs/deleteVLAN.txt", "w", resp_deleteVLAN) data = json.loads(resp_deleteVLAN.text) if not "errortext" in str(data): endTime = ctime() print "VLAN deleteed successfully" resultCollection( "VLAN deletion %s Verification from Devman" % (config['vlanTag%d' % (x)]), ["PASSED", ""], startTime, endTime) else: print "VLAN deleteition Failed " errorstatus = str(data['deleteVLANResponse']['errortext']) endTime = ctime() resultCollection( "VLAN deletion %s Verification from Devman" % (config['vlanTag%d' % (x)]), ["FAILED", errorstatus], startTime, endTime) routput = getControllerInfo( IP, Password, "ifconfig vlan%s | grep parent" % (config['vlanTag%d' % (x)]), "logs/test")
def is_blocked(startTime, footer_msg, blocked_msg): endTime = ctime() get_logger_footer('%s' %(footer_msg)) resultCollection('%s' %(blocked_msg), ['BLOCKED', ''], startTime, endTime) exit()
print ratio2 cr2 = float(ratio2[0:-2]) print cr2 ############### Compare size ############### fs = getoutput(" du -b %s | awk '{print $1}' " % (testfile)) print "testfile size is" print fs[0] filesize = float(fs[0]) print filesize diffsize = float(size2) - float(size1) endTime = ctime() if diffsize < filesize and cr2 > cr1 and compvalue == "on": print "Compression is enabled on %s and working" % ( config['volDatasetname%d' % (x)]) resultCollection( "Compression is enabled on %s and working" % (config['volDatasetname%d' % (x)]), ("PASSED", ' '), startTime, endTime) elif diffsize >= filesize and cr2 == cr1 and compvalue == "off": print "Compression is disabled on %s and working" % ( config['volDatasetname%d' % (x)]) resultCollection( "Compression is disabled on %s and working" % (config['volDatasetname%d' % (x)]), ("PASSED", ' '), startTime, endTime) else: print "Compression Feature is not working on %s" % ( config['volDatasetname%d' % (x)]) resultCollection( "Compression feature is not working on %s when comression is \"%s\" " % (config['volDatasetname%d' % (x)], compvalue), ("FAILED", ' '), startTime, endTime)
for y in range(1, int(config['Number_of_Interfaces%d' % x]) + 1): if listSharedNICs['name'] == config['laggInterface%d%d' % (y, x)]: nic_id += listSharedNICs['id'] nic_id += "," ###TO Add Lagg Interface querycommand = 'command=addLagg&name=lagg%s&clusterid=%s&protocoltype=%s&portslist=%s' % ( config['laggTag%d' % (x)], cluster_id, config['laggType%d' % (x)], nic_id) resp_addLagg = sendrequest(stdurl, querycommand) filesave("logs/addLagg.txt", "w", resp_addLagg) data = json.loads(resp_addLagg.text) if not "errortext" in str(data): print "Lagg added successfully" resultCollection( "Lagg Addition %s Verification from Devman" % (config['laggTag%d' % (x)]), ["PASSED", ""]) else: print "Lagg addition Failed " errorstatus = str(data['addLaggResponse']['errortext']) resultCollection( "Lagg Addition %s Verification from Devman" % (config['LaggTag%d' % (x)]), ["FAILED", errorstatus]) routput = getControllerInfo( IP, Password, "ifconfig lagg%s| grep status | awk '{print $2}'" % (config['laggTag%d' % (x)]), "logs/test") if "active" in routput: resultCollection( "Lagg Addition lagg%s Verification from Node" %
errorstatus = str( response['updateqosresponse']['errortext']) print errorstatus cmd1 = 'reng list | grep -A 6 %s | grep \'Renegade IO limit\' | awk \'{print $4}\' ' % ( searchname) iops = getControllerInfo(nodeip, nodepasswd, cmd1, "output.txt") print "volIops=" print volIops print "rengiops=" + iops endTime = ctime() if int(volIops) != int(iops) and 'errortext' in str( response): print "Changing IOPS more than pool failed on " + datasetname + ": PASSED" resultCollection( "Changing IOPS more than pool on\'%s\' failed." % (datasetname), ["PASSED", ' '], startTime, endTime) elif int(volIops) == int(iops) and 'errortext' not in str( response): print "Changing IOPS more than pool Possible on " + datasetname + ": FAILED" resultCollection( "Changing IOPS more than pool Possible on\'%s\'" % (datasetname), ["FAILED", ' '], startTime, endTime) filesave("logs/resp_updateNFS.txt", "w", resp_listFileSystem) print ">>>> NFS >>>>updated %s" % (filesystem_name) elif iopscontrolled == "false" and throughputcontrolled == "true": print "inside throughput loop" volcmd2 = 'reng list | grep -A 6 %s | grep \'Renegade throughput limit\' | awk \'{print $4}\' ' % ( searchname) volthroughput = getControllerInfo(nodeip, nodepasswd,
run_workload_cmd = 'python %s %s %s' % (src_file, CLIENT_NFS_MOUNT_PNT_1, CLIENT_NFS_MOUNT_PNT_2) # Note the time when the workload starts startTime = ctime() # Run the File Create Read ModifyWrite Delete Ops on the NFS mount point for 5 iterations sshToOtherClient(CLIENT1_IP, CLIENT1_USER, CLIENT1_PASSWORD, run_workload_cmd) # Note the time when the workload execution has completed endTime = ctime() # Grep the workload script's log file to verify successful run test_result = sshToOtherClient(CLIENT1_IP, CLIENT1_USER, CLIENT1_PASSWORD, \ 'grep -w "CREATED\|MODIFIED\|BACKED\|DELETED" RSync.log | wc -l') if int(test_result) > 4: print "Workload has run successfully" logging.info('Testcase %s is successfully completed', tcName) resultCollection('Testcase %s is:' %tcName, \ ['PASSED', ''], startTime, endTime) else: logging.error('Testcase %s is failed,' \ 'look at client logs', tcName) resultCollection('Testcase %s is :' %tcName, \ ['FAILED', ''], startTime, endTime)
querycommand = 'command=listAlerts' resp_listAlerts = sendrequest(stdurl, querycommand) filesave("logs/ListAlerts.txt", "w", resp_listAlerts) data = json.loads(resp_listAlerts.text) #### Finding TP Alert for volume if volumeFlag == 1: alerts = data["listalertsresponse"]["alert"] print alerts for alert in alerts: if "space" in alert['subject'] and alert[ 'description'] == "Volume Capacity": if alert['severity'] == int(x): print "Thin provisioning alert for volume, severity is %s" % x endTime = ctime() resultCollection(alert['subject'], ["PASSED", ""], startTime, endTime) ### Acknowledge that TP alert for volume querycommand = 'command=acknowledgeAlerts&id=%s' % ( alert['id']) resp_acknowledgeAlerts = sendrequest(stdurl, querycommand) exit() else: print "Thin provisioning alert severity for volume is not same,severity is %s" % alert[ 'severity'] exit() print "No Thin provisioning alert for volume received " endTime = ctime() resultCollection("No Thin provisioning alert for volume received", ["FAILED", ""], startTime, endTime)
searchname) voliops = getControllerInfo(nodeip, nodepasswd, volcmd1, "output.txt") volIops = int(voliops) print "volumeusediops=" print volIops querycommand = 'command=deleteFileSystem&id=%s' % (id) resp_deleteNFS = sendrequest(stdurl, querycommand) filesave("logs/updateQosGroup.txt", "w", resp_deleteNFS) response = json.loads(resp_deleteNFS.text) if 'errortext' in str(response): errorstatus = str( response['deleteFileSystemResponse']['errortext']) print errorstatus resultCollection( "Deletion of Dataset \'%s\' failed not able to test Pool QoS change Post Dataset Deletion " % (datasetname), ["FAILED", ' '], startTime, endTime) else: print "Dataset \'%s\' deleted which had \'%s\' iops" % ( datasetname, volIops) poolfunction() poolrengiops2 = int(poolrengiops) print "poolrengiops2= " print poolrengiops2 endTime = ctime() finalpoolrengiops = int(poolrengiops1) + volIops print "finalpoolrengiops=" print finalpoolrengiops if poolrengiops2 == finalpoolrengiops: print "Pool QoS change Post Dataset Deletion passed" resultCollection(
filesave("logs/createdelegatedadmin.txt", "w" , resp_createdelegatedadmin) data = json.loads(resp_createdelegatedadmin.text) #print data #pprint.pprint(data) # resp_data = data["createdelegatedadminresponse"]["delegatedadmin"] # print resp_data print "creating site-admin" endTime = ctime() if not "errortext" in str(data): print "Create Site Admin successfully" user_id = data["createdelegatedadminresponse"]["delegatedadmin"]["userid"] else: print "Create Site Admin Failed " errorstatus= str(data['createdelegatedadminresponse']['errortext']) resultCollection("Site Admin %s Creation Verification from Devman" %(config['siteAdminUsername%d' %(x)]), ["FAILED", errorstatus],startTime,endTime) continue ###To update Delegated Admin querycommand = 'command=updateDelegatedAdmin&accounttype=2&%s&userid=%s' %(sites_list_id, user_id ) resp_updateDelegatedAdmin = sendrequest(stdurl,querycommand) filesave("logs/updateDelegatedAdmin.txt", "w" , resp_updateDelegatedAdmin) data = json.loads(resp_updateDelegatedAdmin.text) if not "errortext" in str(data): print "Create Site Admin successfully" resultCollection("Site Admin %s Creation Verification from Devman" %(config['siteAdminUsername%d' %(x)]), ["PASSED", ""],startTime,endTime) else: print "Create Site Admin Failed " errorstatus= str(data['updateDelegatedAdminResponse']['errortext'])
filesystem_id) respListSnapshot = sendrequest(stdurl, querycommand) filesave("logs/ListSnapshot.txt", "w", respListSnapshot) data2 = json.loads(respListSnapshot.text) snapshots = data2["listDatasetSnapshotsResponse"][ "snapshot"] for snapshot in snapshots: if snapshot['name'] == snapshotName: path = snapshot[ 'path'] ### path is the zfs name of the snapshot break if path == None: endTime = ctime() resultCollection( "No snapshot is available for volume \"%s\" with provided name:" % (filesystem_name), "FAILED", startTime, endTime) print 'No snapshot is available' # create clone dataset else: querycommand = 'command=cloneDatasetSnapshot&id=%s&path=%s&clonename=%s&mountpoint=%s' % ( filesystem_id, path, cloneName, cloneName) out = sendrequest(stdurl, querycommand) filesave("logs/ListSnapshot.txt", "w", out) data3 = json.loads(out.text) fsAvlSpace = getControllerInfo( IP, passwd, "zfs list | grep %s | awk \'{print $3}\'" % (filesystem_name), "dataset_result.txt") cloneAvlSpace = getControllerInfo(
filesave("logs/ListAccount.txt", "w", resp_listAccount) data = json.loads(resp_listAccount.text) #print data accounts = data['listAccountResponse']['account'] for x in range(1, int(config['Number_of_Accounts']) + 1): startTime = ctime() for account in accounts: if account['name'] == "%s" % (config['accountName%d' % (x)]): acc_id = account['id'] authgrp_name = "AuthGrp" + "%d" % (x) comment = "Auth%20Group%20Info." querycommand = 'command=addiSCSIAuthGroup&accountid=%s&name=%s&comment=%s&chapusername=ChapUser&chappassword=ChapPassword&mutualchapusername=MutualUser&mutualchappassword=MutualPassword' % ( acc_id, authgrp_name, comment) resp_tsmiSCSIAuthGroupResponse = sendrequest(stdurl, querycommand) filesave("logs/tsmiSCSIAuthGroupResponse.txt", "w", resp_tsmiSCSIAuthGroupResponse) data = json.loads(resp_tsmiSCSIAuthGroupResponse.text) endTime = ctime() if not "errortext" in str(data): resultCollection( "sucessfully created iscsi authentication group in %s" % account['name'], ["PASSED", " "], startTime, endTime) else: errorstatus = str( data['tsmiSCSIAuthGroupResponse']['errortext']) resultCollection( "failed to created iscsi authentication group in %s" % account['name'], ["FAILED", errorstatus], startTime, endTime)
logging.debug('mount/umount 100 NFS volumes test case is blocked...') is_blocked(startTime, FOOTER_MSG, BLOCKED_MSG) update_volid_mntpoint(volumes) #------------------------------------------------------------------------------ ###Updating network to access the share---------------------------------------- for x in range(1, 101): result = addNFSclient(STDURL, VOLUME_IDs[x - 1], 'ALL') if result[0] == 'FAILED' and 'already exists' in str(result[1]): pass elif result[0] == 'FAILED': endTime = ctime() print 'Not able to update network ALL to access NFS share' logging.error('Not able to update network ALL, Error: %s', result[1]) logging.debug('mount/umount 100 NFS volumes test case is failed...') resultCollection('mount/umount 100 NFS volumes test case', \ ['FAILED', ''], startTime, endTime) exit() #------------------------------------------------------------------------------ def umount_all(): if len(MOUNTED_SHARE) == 0: print 'There is no volume mounted...' logging.debug('There is no volume mounted...') return for x in range(1, (len(MOUNTED_SHARE) + 1)): result = umount_with_dir(MOUNTED_SHARE[x - 1]) if result[0] == 'FAILED': print 'Not able to umount volume with mountpoint %s' \ %(MOUNTED_SHARE[x-1]) logging.error('Not able to umount volume with mountpoint %s, '\
querycommand = 'command=listTsm' resp_listTsm = sendrequest(stdurl, querycommand) filesave("logs/ListTsm.txt", "w", resp_listTsm) dataTsm = json.loads(resp_listTsm.text) tsms = dataTsm['listTsmResponse']['listTsm'] for x in range(1, int(config['Number_of_TSMs'])+1): startTime = ctime() for listTsm in tsms: tsmid = None if listTsm['name'] == "%s" %(config['tsmName%d' %(x)]): tsmid = listTsm['id'] print tsmid if tsmid is not None: querycommand = 'command=updateTsmNfsOptions&nfsworkerthreads=%s&tsmid=%s' %(No_of_threads, tsmid) change_NFSThread_resp = sendrequest(stdurl, querycommand) filesave("logs/changeNFSThreads.txt", "w", change_NFSThread_resp) changeThreadResp = json.loads(change_NFSThread_resp.text) if 'errortext' in str(changeThreadResp): errorstatus = str((changeThreadResp)['updateTsmNfsOptionsResponse']['errortext']) endTime = ctime() resultCollection("Failed to change nfs threads", ['FAILED', errorstatus], startTime, endTime) else: endTime = ctime() resultCollection("Successfully changed NFS threads to %s" %(No_of_threads), ['PASSED', ''], startTime, endTime) else: endTime = ctime() resultCollection("not able to get TSM_ID", ['FAILED', ''], startTime, endTime)
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)
config['volCifsDatasetname%d' % (x)]) + '%d' % (i) if filesystem['name'] == cloneName: filesystem_id = filesystem['id'] filesystem_name = filesystem['name'] if filesystem_id is not None: querycommand = 'command=deleteFileSystem&id=%s' % ( filesystem_id) deleteCloneResp = sendrequest(stdurl, querycommand) filesave("logs/ListSnapshot.txt", "w", deleteCloneResp) data2 = json.loads(deleteCloneResp.text) job_id = data2["deleteFileSystemResponse"]["jobid"] rstatus = queryAsyncJobResult(stdurl, job_id) print rstatus endTime = ctime() resultCollection( "CIFS Clones %s Deletion" % (cloneName), rstatus, startTime, endTime) print "\n%s is deleted\n" % (filesystem_name) print "All CIFS Clones are Deleted" time.sleep(2) ### NFS if nfsFlag == 1 or allFlag == 1: for x in range(1, int(config['Number_of_NFSVolumes']) + 1): for i in range(1, int(No_of_Clones) + 1): startTime = ctime() for filesystem in filesystems: filesystem_id = None cloneName = prefixName + '%s' % (config['volDatasetname%d' % (x)]) + '%d' % (i) if filesystem['name'] == cloneName:
if nfsUnmount == 'FAILED': 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)
print tsmname print accountname print searchname print "iopscontrolled = "+iopscontrolled print "throughputcontrolled = "+throughputcontrolled if iopscontrolled == "true" and throughputcontrolled == "false": querycommand='command=updateQosGroup&id=%s&iops=%s' %(id, volIops) resp_updateNFS = sendrequest(stdurl, querycommand) cmd1 ='reng list | grep -A 6 %s | grep \'Renegade IO limit\' | awk \'{print $4}\' ' %(searchname) iops= getControllerInfo(ip, passwd,cmd1,"output.txt") print "volIops="+ volIops print "rengiops="+ iops endTime=ctime() if int(volIops) == int(iops): print "Changing IOPS updated in Reng list on "+ datasetname +": PASSED" resultCollection("Changing IOPS updated in Reng list on\'%s\'" %(datasetname),["PASSED", ' '],startTime, endTime) elif int(volIops) != int(rengiops): print "Changing IOPS updated in Reng list on "+ datasetname +": FAILED" resultCollection("Changing IOPS updated in Reng list on\'%s\'" %(datasetname),["FAILED", ' '],startTime, endTime) filesave("logs/resp_updateNFS.txt", "w", resp_listFileSystem) print ">>>> NFS >>>>updated %s" %(filesystem_name) elif iopscontrolled == "false" and throughputcontrolled == "true": querycommand='command=updateQosGroup&id=%s&throughput=%s' %(id, tpvalue) resp_updateNFS = sendrequest(stdurl, querycommand) cmd2 = 'reng list | grep -A 6 %s | grep \'Renegade throughput limit\' | awk \'{print $4}\' ' %(searchname) throughput= getControllerInfo(ip, passwd,cmd2,"output.txt") print "throughput="+ tpvalue print "rengthroughput="+ throughput endTime=ctime() if int(tpvalue) == int(throughput): print "Changing throughput updated in Reng list on "+ datasetname +": PASSED"