def test_0_0_3(ibmsnet): test_header = inspect.getframeinfo(inspect.currentframe()).function phase = 'Bounce Master SM port' rch_global_dict['test_description'][test_header] = phase status = 0 sm0 = ssa_tools_utils.core(rch_global_dict['core_nodes'][0]) sm1 = ssa_tools_utils.core(rch_global_dict['core_nodes'][1]) sm1.stop() start_test = time.strftime("%b %d %H:%M:%S") print '%s Bouncing Master SM port' % start_test sw_guid_port = ssa_utils.node_port_state_change(rch_global_dict['core_nodes'][0], 'disable') print 'Wait' time.sleep(1) o = commands.getoutput('ibportstate -G %s enable' % sw_guid_port) print '[%s] ibportstate -G %s enable \n%s' % ( time.strftime("%b %d %H:%M:%S"), sw_guid_port, o ) stop_time = time.strftime("%b %d %H:%M:%S") print '%s Collecting logs' % stop_time status = ssa_utils.check_errors(rch_global_dict) print '%s Starting Standby SM' % time.strftime("%b %d %H:%M:%S") sm1.start() print "Relevant test time interval %s - %s" % (start_test, stop_time) return status
def test_0_0_0(ibmsnet): test_header = inspect.getframeinfo(inspect.currentframe()).function phase = 'Restart Master SM' rch_global_dict['test_description'][test_header] = phase status = 0 #sm0 should be Master SM sm0 = ssa_tools_utils.core(rch_global_dict['core_nodes'][0]) sm1 = ssa_tools_utils.core(rch_global_dict['core_nodes'][1]) print '[%s] Stopping Standby SM' % time.strftime("%b %d %H:%M:%S") sm1.stop() start_test = time.strftime("%b %d %H:%M:%S") print '%s Restarting Master SM' % start_test sm0.restart() print 'Wait 2m' time.sleep(120) stop_time = time.strftime("%b %d %H:%M:%S") print '%s Collecting logs' % stop_time status = ssa_utils.check_errors(rch_global_dict) print '%s Starting Standby SM' % time.strftime("%b %d %H:%M:%S") sm1.start() print "Relevant test time interval %s - %s" % (start_test, stop_time) return status
def test_0_0_2(ibmsnet): test_header = inspect.getframeinfo(inspect.currentframe()).function phase = 'Change SM from Master to Standby by priority' rch_global_dict['test_description'][test_header] = phase status = 0 sm0 = ssa_tools_utils.core(rch_global_dict['core_nodes'][0]) sm1 = ssa_tools_utils.core(rch_global_dict['core_nodes'][1]) print '[%s] Change Standby SM priority' % time.strftime("%b %d %H:%M:%S") start_test = time.strftime("%b %d %H:%M:%S") sm1.set_value('sm_priority', 1) print 'Wait' time.sleep(120) stop_time = time.strftime("%b %d %H:%M:%S") print '%s Collecting logs' % stop_time status = ssa_utils.check_errors(rch_global_dict) print '%s Change SM priority back to 0' % time.strftime("%b %d %H:%M:%S") sm1.set_value('sm_priority', 0) print "Relevant test time interval %s - %s" % (start_test, stop_time) return status
def stop_services(core, access, acm): status = 0 sm_master = ssa_tools_utils.core(core) access_svc = ssa_tools_utils.access(access) acm_svc = ssa_tools_utils.acm(acm) print '[%s] Stop MASTER SM' % time.strftime("%b %d %H:%M:%S") sm_master.stop() print '[%s] Stop ACCESS layer' % time.strftime("%b %d %H:%M:%S") access_svc.stop() print '[%s] Stop ACM layer' % time.strftime("%b %d %H:%M:%S") acm_svc.stop() return status