def Trigger(tc): if len(tc.Nodes) > 0: n = tc.Nodes[0] common.PenctlGetTransitionPhaseStatus(n) common.SetNaplesModeOOB_Static(n, "5.5.4.1", "5.5.4.4/24") tc.before_reboot_status = common.PenctlGetTransitionPhaseStatus(n) #common.PenctlGetControllersStatus(n)[0] api.Logger.info("Going for first reboot") tc.TriggerResult = api.types.status.SUCCESS err = common.RebootHost(n) if err == api.types.status.FAILURE: tc.TriggerResult = api.types.status.FAILURE return api.types.status.FAILURE tc.after_first_reboot_status = common.PenctlGetTransitionPhaseStatus(n) api.Logger.info("The Status after first reboot is {}".format( tc.after_first_reboot_status)) #tc.controller_ip_penctl_after.append(common.PenctlGetControllersStatus(n)[0]) api.Logger.info("Going for second reboot") common.RebootHost(n) tc.after_second_reboot_status = common.PenctlGetTransitionPhaseStatus( n) api.Logger.info("The Status after second reboot is {}".format( tc.after_second_reboot_status)) return api.types.status.SUCCESS
def Trigger(tc): if len(tc.Nodes) > 0 : n = tc.Nodes[0] for i in range(0, len(tc.venice_ips)): common.PrepareDhcpConfig(tc.venice_ips[i]) common.SetupRemoteDhcp(n) common.ResetNMDState(n) common.RebootHost(n) common.SetNaplesModeOOB_Dynamic(n) time.sleep(10) api.Logger.info("NAPLES STATUS before reboot") tc.naples_status_before.append(common.PenctlGetTransitionPhaseStatus(n)) api.Logger.info("Controller IPs before reboot") tc.controller_ip_penctl_before.append(common.PenctlGetControllersStatus(n)[0]) common.RebootHost(n) api.Logger.info("NAPLES STATUS after reboot check every 5 seconds for 1 minute.") for j in range(0, 12): tc.naples_status_after.append(common.PenctlGetTransitionPhaseStatus(n)) tc.controller_ip_penctl_after.append(common.PenctlGetControllersStatus(n)[0]) time.sleep(5) return api.types.status.SUCCESS
def Teardown(tc): if len(tc.Nodes) > 0: n = tc.Nodes[0] common.ResetNMDState(n) common.RebootHost(n) return api.types.status.SUCCESS
def Trigger(tc): if len(tc.Nodes) > 0: n = tc.Nodes[0] for i in range(0, len(tc.venice_ips)): common.ResetNMDState(n) common.RebootHost(n) common.PrepareDhcpConfig(tc.venice_ips[i]) common.SetupRemoteDhcp(n) time.sleep(10) common.SetNaplesModeInband_Dynamic(n) tc.naples_status_before.append(common.PenctlGetTransitionPhaseStatus(n)) tc.controller_ip_penctl_before.append(common.PenctlGetControllersStatus(n)[0]) common.StopRemoteDhcp(n) common.RebootHost(n) tc.naples_status_after.append(common.PenctlGetTransitionPhaseStatus(n)) tc.controller_ip_penctl_after.append(common.PenctlGetControllersStatus(n)[0]) return api.types.status.SUCCESS
def Trigger(tc): for n in tc.Nodes: common.ResetNMDState(n) common.RebootHost(n) common.PrepareDhcpConfig(tc.venice_ips[0]) common.SetupRemoteDhcp(n) time.sleep(10) common.SetNaplesModeOOB_Dynamic(n) tc.naples_status_before.append(common.PenctlGetTransitionPhaseStatus(n)) tc.controller_ip_penctl_before.append(common.PenctlGetControllersStatus(n)) common.PrepareDhcpConfig(tc.venice_ips[1]) common.SetupRemoteDhcp(n) common.RebootHost(n) tc.naples_status_after.append(common.PenctlGetTransitionPhaseStatus(n)) tc.controller_ip_penctl_after.append(common.PenctlGetControllersStatus(n)) return api.types.status.SUCCESS
def Trigger(tc): if len(tc.Nodes) > 0: n = tc.Nodes[0] common.PenctlGetTransitionPhaseStatus(n) common.SetNaplesModeInband_Static(n, "1.1.1.1","1.1.1.2/24") tc.before_reboot_status = common.PenctlGetTransitionPhaseStatus(n) #common.PenctlGetControllersStatus(n)[0] api.Logger.info("Going for first reboot.") common.RebootHost(n) tc.after_first_reboot_status = common.PenctlGetTransitionPhaseStatus(n) #tc.controller_ip_penctl_after.append(common.PenctlGetControllersStatus(n)[0]) api.Logger.info("Going for second reboot.") common.RebootHost(n) tc.after_second_reboot_status = common.PenctlGetTransitionPhaseStatus(n) return api.types.status.SUCCESS
def Trigger(tc): if len(tc.Nodes) > 0: n = tc.Nodes[0] common.PrepareDhcpConfig(tc.venice_ips[0]) common.SetupRemoteDhcp(n) common.SetNaplesModeInband_Dynamic(n) api.Logger.info( "DHCP Server updated. Waiting 5 seconds for DHCP handshake between Naples and DHCP Server." ) time.sleep(5) common.PrepareDhcpConfig(tc.venice_ips[1]) common.SetupRemoteDhcp(n) common.RebootHost(n) tc.controller_ip_penctl.append(common.PenctlGetControllersStatus(n)[0]) return api.types.status.SUCCESS
def Verify(tc): for n in tc.Nodes: common.ResetNMDState(n) common.RebootHost(n) for i in range(0, len(tc.venice_ips)): if tc.controller_ip_penctl_before[i] != tc.controller_ip_penctl_after[i] \ or tc.controller_ip_penctl_before[i] != tc.venice_ips[i] \ or tc.naples_status_before[i] != "REBOOT_PENDING" \ or tc.naples_status_after[i] != "DHCP_SENT": api.Logger.info("FAILED - CNTRL EXPECTED {} RECEIVED {} \ - STATUS BEFORE EXPECTED [REBOOT_PENDING] RECEIVED [{}]] \ - STATUS AFTER EXPECTED [VENICE_REGISTRATION_DONE] RECEIVED [{}]" .format(tc.venice_ips[i],\ tc.controller_ip_penctl_after[i],\ tc.naples_status_before[i], \ tc.naples_status_after[i])) return api.types.status.FAILURE return api.types.status.SUCCESS
def Trigger(tc): if len(tc.Nodes) > 0 : n = tc.Nodes[0] common.SetNaplesModeInband_Dynamic(n) api.Logger.info("NAPLES STATUS before reboot") tc.naples_status_before.append(common.PenctlGetTransitionPhaseStatus(n)) api.Logger.info("Controller IPs before reboot") tc.controller_ip_penctl_before.append(common.PenctlGetControllersStatus(n)[0]) api.Logger.info("NAPLES STATUS after reboot check every 5 seconds for 1 minute.") for j in range(0, 5): tc.naples_status_after.append(common.PenctlGetTransitionPhaseStatus(n)) tc.controller_ip_penctl_after.append(common.PenctlGetControllersStatus(n)[0]) time.sleep(5) api.Logger.info("Going for Reboot.") common.RebootHost(n) tc.after_reboot_status = common.PenctlGetTransitionPhaseStatus(n) return api.types.status.SUCCESS
def Teardown(tc): for n in tc.Nodes: common.ResetNMDState(n) common.RebootHost(n) return api.types.status.SUCCESS