#! /usr/bin/python3
import iota.harness.api as api
import iota.protos.pygen.topo_svc_pb2 as topo_svc_pb2
import iota.test.iris.testcases.penctl.penctldefs as penctldefs
import iota.test.iris.testcases.penctl.common as common


def Setup(tc):
    tc.Nodes = api.GetNaplesHostnames()
    return api.types.status.SUCCESS

def Trigger(tc):
    for n in tc.Nodes:
        common.SetupRemoteDhcp(n)
        common.SetNaplesModeOOB_Static(n, "6.6.6.4,6.6.6.5.", "6.6.6.6/24")

    return api.types.status.SUCCESS

def Verify(tc):
    for n in tc.Nodes:
        mgmt_ip = common.PenctlGetNaplesMgtmIp(n)
        controllers = common.PenctlGetControllers(n)

        api.Logger.info("{} MODE : {} NETWORKMODE : {} CONTROLLER : {}".format(n, common.PenctlGetMode(n), common.PenctlGetNetworkMode(n), common.PenctlGetControllers(n)))
        api.Logger.info("Got controller : {}".format(common.AgentGetControllers(n)[0]))
        if mgmt_ip == "6.6.6.6/24" and common.AgentGetControllers(n)[0] == "4.4.4.4" and controllers[0] == "4.4.4.4":
            return api.types.status.SUCCESS

    return api.types.status.FAILURE

def Teardown(tc):
    return api.types.status.SUCCESS

9c347af0ad4c34317879e130e6763d0877207ac4
<mask token>


def Setup(tc):
    tc.Nodes = api.GetNaplesHostnames()
    return api.types.status.SUCCESS


<mask token>


def Verify(tc):
    for n in tc.Nodes:
        mgmt_ip = common.PenctlGetNaplesMgtmIp(n)
        controllers = common.PenctlGetControllers(n)
        api.Logger.info('{} MODE : {} NETWORKMODE : {} CONTROLLER : {}'.
            format(n, common.PenctlGetMode(n), common.PenctlGetNetworkMode(
            n), common.PenctlGetControllers(n)))
        api.Logger.info('Got controller : {}'.format(common.
            AgentGetControllers(n)[0]))
        if mgmt_ip == '6.6.6.6/24' and common.AgentGetControllers(n)[0
            ] == '4.4.4.4' and controllers[0] == '4.4.4.4':
            return api.types.status.SUCCESS
    return api.types.status.FAILURE


<mask token>

<mask token>


def Setup(tc):
    tc.Nodes = api.GetNaplesHostnames()
    return api.types.status.SUCCESS


def Trigger(tc):
    for n in tc.Nodes:
        common.SetupRemoteDhcp(n)
        common.SetNaplesModeOOB_Static(n, '6.6.6.4,6.6.6.5.', '6.6.6.6/24')
    return api.types.status.SUCCESS


def Verify(tc):
    for n in tc.Nodes:
        mgmt_ip = common.PenctlGetNaplesMgtmIp(n)
        controllers = common.PenctlGetControllers(n)
        api.Logger.info('{} MODE : {} NETWORKMODE : {} CONTROLLER : {}'.
            format(n, common.PenctlGetMode(n), common.PenctlGetNetworkMode(
            n), common.PenctlGetControllers(n)))
        api.Logger.info('Got controller : {}'.format(common.
            AgentGetControllers(n)[0]))
        if mgmt_ip == '6.6.6.6/24' and common.AgentGetControllers(n)[0
            ] == '4.4.4.4' and controllers[0] == '4.4.4.4':
            return api.types.status.SUCCESS
    return api.types.status.FAILURE


<mask token>

<mask token>


def Setup(tc):
    tc.Nodes = api.GetNaplesHostnames()
    return api.types.status.SUCCESS


def Trigger(tc):
    for n in tc.Nodes:
        common.SetupRemoteDhcp(n)
        common.SetNaplesModeOOB_Static(n, '6.6.6.4,6.6.6.5.', '6.6.6.6/24')
    return api.types.status.SUCCESS


def Verify(tc):
    for n in tc.Nodes:
        mgmt_ip = common.PenctlGetNaplesMgtmIp(n)
        controllers = common.PenctlGetControllers(n)
        api.Logger.info('{} MODE : {} NETWORKMODE : {} CONTROLLER : {}'.
            format(n, common.PenctlGetMode(n), common.PenctlGetNetworkMode(
            n), common.PenctlGetControllers(n)))
        api.Logger.info('Got controller : {}'.format(common.
            AgentGetControllers(n)[0]))
        if mgmt_ip == '6.6.6.6/24' and common.AgentGetControllers(n)[0
            ] == '4.4.4.4' and controllers[0] == '4.4.4.4':
            return api.types.status.SUCCESS
    return api.types.status.FAILURE


def Teardown(tc):
    return api.types.status.SUCCESS

import iota.harness.api as api
import iota.protos.pygen.topo_svc_pb2 as topo_svc_pb2
import iota.test.iris.testcases.penctl.penctldefs as penctldefs
import iota.test.iris.testcases.penctl.common as common


def Setup(tc):
    tc.Nodes = api.GetNaplesHostnames()
    return api.types.status.SUCCESS


def Trigger(tc):
    for n in tc.Nodes:
        common.SetupRemoteDhcp(n)
        common.SetNaplesModeOOB_Static(n, '6.6.6.4,6.6.6.5.', '6.6.6.6/24')
    return api.types.status.SUCCESS


def Verify(tc):
    for n in tc.Nodes:
        mgmt_ip = common.PenctlGetNaplesMgtmIp(n)
        controllers = common.PenctlGetControllers(n)
        api.Logger.info('{} MODE : {} NETWORKMODE : {} CONTROLLER : {}'.
            format(n, common.PenctlGetMode(n), common.PenctlGetNetworkMode(
            n), common.PenctlGetControllers(n)))
        api.Logger.info('Got controller : {}'.format(common.
            AgentGetControllers(n)[0]))
        if mgmt_ip == '6.6.6.6/24' and common.AgentGetControllers(n)[0
            ] == '4.4.4.4' and controllers[0] == '4.4.4.4':
            return api.types.status.SUCCESS
    return api.types.status.FAILURE


def Teardown(tc):
    return api.types.status.SUCCESS

#! /usr/bin/python3
import iota.harness.api as api
import iota.protos.pygen.topo_svc_pb2 as topo_svc_pb2
import iota.test.iris.testcases.penctl.penctldefs as penctldefs
import iota.test.iris.testcases.penctl.common as common


def Setup(tc):
    tc.Nodes = api.GetNaplesHostnames()
    return api.types.status.SUCCESS

def Trigger(tc):
    for n in tc.Nodes:
        common.SetupRemoteDhcp(n)
        common.SetNaplesModeOOB_Static(n, "6.6.6.4,6.6.6.5.", "6.6.6.6/24")

    return api.types.status.SUCCESS

def Verify(tc):
    for n in tc.Nodes:
        mgmt_ip = common.PenctlGetNaplesMgtmIp(n)
        controllers = common.PenctlGetControllers(n)

        api.Logger.info("{} MODE : {} NETWORKMODE : {} CONTROLLER : {}".format(n, common.PenctlGetMode(n), common.PenctlGetNetworkMode(n), common.PenctlGetControllers(n)))
        api.Logger.info("Got controller : {}".format(common.AgentGetControllers(n)[0]))
        if mgmt_ip == "6.6.6.6/24" and common.AgentGetControllers(n)[0] == "4.4.4.4" and controllers[0] == "4.4.4.4":
            return api.types.status.SUCCESS

    return api.types.status.FAILURE

def Teardown(tc):
    return api.types.status.SUCCESS
