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 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()
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')
logging.debug('volume_id: %s and mountpoint: %s', vol_id, mnt_point) volume_dir = {'mountPoint': mnt_point, 'TSMIPAddress': VSM_IP, 'name': \ volumeDict['name']} add_client_result = addNFSclient(STDURL, vol_id, 'ALL') verify_ddNFSclient(add_client_result, 'ALL', volumeDict['name']) mount_result = mountNFS_new(volume_dir) if mount_result[0] == 'PASSED': print 'Mount NFS when Network set to ALL: Able to mount, PASSED' logging.debug('Mount NFS when Network set ALL: Able to mount, PASSED') resultCollection('Mount NFS when Network set to ALL test case:', \ ['PASSED', ''], startTime, endTime) else: print 'Mount NFS when Network set to ALL: Not able to mount, FAILED' logging.error('Mount NFS when Network set to ALL: Not Able to mount, '\ 'FAILED') resultCollection('Mount NFS when Network set to ALL test case:', \ ['FAILED', ''], startTime, endTime) logging.debug('Going to umount the NFS share...%s', volumeDict['name']) time.sleep(5) result = umountVolume_new(volume_dir) print 'going to delete NFS share created for final test for Authorization(ALL)' logging.debug( 'going to delete NFS share %s created for final test for ' 'Authorization (ALL)', volumeDict['name']) delete_volume(vol_id, STDURL) #------------------------------------------------------------------------------ get_logger_footer('NFS Authorization (ALL, None, Network) test case completed')
# sleeping for 20 seconds after killing vdbench, #it wil take some time to erlease the mount point time.sleep(20) # 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.error('iSCSI login with CHAP method test case is failed Error:%s', \ login_result[1]) resultCollection('iSCSI login with CHAP method test case is', \ ['FAILED', ''], startTime, endTime) if LUN_logged: logging.debug('getting iSCSI LUN legged device...') time.sleep(2) result = getDiskAllocatedToISCSI(VSM_IP, mnt_point) print result logging.debug('iSCSI LUN logged in device: %s', result) #--------------------------------------------------------------------- #updating iscsid.conf to original file-------------------------------- make_iscsid_conf_original(backup_filename, fileName) #removing configuration----------------------------------------------- logging.debug('iSCSI login CHAP execution done, removing configuration...') if LUN_logged: iscsi_login_logout(iqn, VSM_IP, 'logout') result = assign_iniator_gp_to_LUN(STDURL, vol_id, account_id, 'None') if result[0] == 'PASSED': logging.debug('Go and delete the volume') delete_volume(vol_id, STDURL) get_logger_footer('iSCSI login with CHAP method test case is completed') else: logging.error('Not able to set auth group to None, do not delete volume') get_logger_footer('iSCSI login with CHAP method test case is completed') #configuration removed-------------------------------------------------------
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() logging.debug('gracefull HA test case(NFS) completed, removing configuration') umount_result = executeCmd('umount %s' %(mount_dir)) if umount_result[0] == 'FAILED': logging.error('Not able to umount %s, trying again..', mount_dir) umount_result = executeCmd('umount -l %s' %(mount_dir)) else: logging.debug('NFS share %s umounted successfully', mount_dir) logging.debug('Go and delete the volume') delete_volume(vol_id, STDURL) get_logger_footer('gracefull HA test case(NFS) completed')
# --------- cleaning all the configuration created for this test case --------- # 1 killing vdbench kill_vdbench() # umount the NFS share UMain(CLIENT_NFS_MOUNT_PNT) # going to delete the nfs share delete_vol = delete_volume(vol_id, 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('Multiple_Sighups_During_File_IO 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(vsm_id, STDURL) if delete_vsm[0] == 'FAILED': print 'VSM deleetion failed after running multiple sighup test case' logging.debug('VSM deletion failed after running multiple sighup '\ 'test case, error is : %s', delete_vsm[1]) logging.debug('Since VSM is not deleted, not going to delete pool') get_logger_footer('Multiple_Sighups_During_File_IO test case is completed') exit() # VSM deleted successfully, oging to delete pool logging.debug('VSM deleted successfully, going to delete pool')
def is_blocked(): endTime = ctime() get_logger_footer('snapshot on iSCSI test completed') resultCollection('Snapshot functionality on iSCSI LUN test case is',\ ['BLOCKED', ''], startTime, endTime) exit()
listVolumeWithTSMId_new from utils import get_logger_footer, assign_iniator_gp_to_LUN, \ discover_iscsi_lun, iscsi_login_logout, get_iscsi_device, execute_mkfs, \ copy_file, get_node_ip logging.basicConfig(format = '%(asctime)s %(message)s', filename = \ 'logs/automation_execution.log', filemode = 'a', level=logging.DEBUG) logging.info('------------------------------snapshot on iSCSI LUN test started'\ '------------------------------') #please make sure you have a file name as 'textfile' for executing this test if len(sys.argv) < 2: print 'Arguments are not correct, Please provide as follows...' print 'python snpISCSIVol.py conf.txt' logging.error('Arguments are not correct...') get_logger_footer('snapshot on iSCSI LUN test completed') exit() startTime = ctime() #getting configuration file conf = configFile(sys.argv) #in future, if required will change it as given parameter FILE_TO_COPY = 'textfile' #FILE_TO_COPY = 'copy1.txt' DEVMAN_IP = conf['host'] USER = conf['username'] PASSWORD = conf['password'] VSM_IP = conf['ipVSM1'] APIKEY = get_apikey(conf) NODE_IP = None PASSWD = 'test' # node password
logging.debug('verifying IOPS at peer Node IP: %s', NODE2_IP) verify_IOPS_afterHA(NODE2_IP, PASSWD) time.sleep(170) logging.debug( 'partial fail over test case(iSCSI) completed, removing configuration') umount_result = executeCmd('umount /dev/%s1' % (iscsi_device)) if umount_result[0] == 'FAILED': logging.error('Not able to umount /dev/%s1, still go ahead and logout '\ 'the iSCSI LUN, since test case is complete', iscsi_device) else: logging.debug('LUN /dev/%s1 umounted successfully', iscsi_device) logout_result = iscsi_login_logout(iqn, VSM_IP, 'logout') if logout_result[0] == 'FAILED': logging.error('Not able to logged out iSCSI LUN, still go ahead and set '\ 'auth group to None, since test case is complete') else: logging.debug('iSCSI LUN logged out successfully') logging.debug( 'sleeping for 1 second before setting initiator group to None...') time.sleep(1) add_auth_group = assign_iniator_gp_to_LUN(STDURL, vol_id, account_id, 'None') if add_auth_group[0] == 'FAILED': logging.error('Not able to set auth group to None, do not delete volume') get_logger_footer('partial fail over test case(iSCSI) completed') exit() else: logging.debug('Go and delete the volume') delete_volume(vol_id, STDURL) get_logger_footer('partial fail over test case(iSCSI) completed')