Ejemplo n.º 1
0
def start_simulators():
    global mme_console
    global mme_console2
    global mme_console3

    global mme
    global mme2
    global mme3

    try:
        # import pdb; pdb.set_trace()
        mme_console = itc_pexpect.Itc(sim_expect)
        mme_console2 = itc_pexpect.Itc(sim_expect2)
        mme_console3 = itc_pexpect.Itc(sim_expect3)

        mme = itc.Itc(sim)
        mme2 = itc.Itc(sim2)
        mme3 = itc.Itc(sim3)

        itc.getItcLib().netowl.pyapi_print_stats()
        import pdb
        pdb.set_trace()

    except Exception as e:
        logger.error("Exception from startup : {}".format(e))
        traceback.print_tb(e.__traceback__)
        exit2(3)
Ejemplo n.º 2
0
def start_simulators():
    global sim_list
    global sim_expect_list
    global mme_console_list
    global mme_list

    try:
        mme_console_list = []
        mme_list = []
        for i in range(0, 15):
            mme_console_list.append(itc_pexpect.Itc(sim_expect_list[i]))
            mme_list.append(itc.Itc(sim_list[i]))

    except Exception as e:
        logger.error("Exception from startup : {}".format(e))
        traceback.print_tb(e.__traceback__)

        exit2(3)
Ejemplo n.º 3
0
def prepare_interfaces():
    global bash
    try:
        bash = itc_pexpect.Itc(bash_expect)
    except Exception as e:
        logger.error("Exception from shell startup : {}".format(e))
        traceback.print_tb(e.__traceback__)
        exit2(3)
    try:
        # import pdb; pdb.set_trace()
        res = bash.cmd(["echo $PS1", "hostname", "pwd"])
        logger.info("bash expect: %s" % res.data)

    except Exception as e:
        logger.error(
            "Exception while executing intial shell commands : {}".format(e))
        traceback.print_tb(e.__traceback__)
        exit2(3)
Ejemplo n.º 4
0
def prepare_interfaces():
    global bash
    try:
        bash = itc_pexpect.Itc(bash_expect)
    except Exception as e:
        logger.error("Exception from shell startup : {}".format(e))
        traceback.print_tb(e.__traceback__)
        exit2(3)
    try:
        # import pdb; pdb.set_trace()
        res = bash.cmd(["echo $PS1", "hostname", "pwd"])
        logger.info("bash expect: %s" % res.data)

#        with open("%s/bash_veth.txt" % myPath) as f:
#            lines = f.read().splitlines()
#            f.close()
#            res = bash.cmd(lines)
#            logger.info(res.data)
    except Exception as e:
        logger.error(
            "Exception while executing intial shell commands : {}".format(e))
        traceback.print_tb(e.__traceback__)
        exit2(3)
Ejemplo n.º 5
0
def test():
    logger.info("TEST START")

    try:
        #        import pdb; pdb.set_trace()
        mme_console = itc_pexpect.Itc(sim_expect)
        res = mme_console.cmd(["show version", "show log-level", "show log"])
        logger.info("mme_console: %s" % res.data)

        mme = itc.Itc(sim)
        ###attach a session###
        mme.cmd(["create profile 1"])
        mme.cmd(["set profile 1 apn ipd.alcatel-lucent.com"])
        mme.cmd(["set profile 1 imsi 123456789012915"])
        mme.cmd(["set profile 1 pdn-type 6"])
        mme.cmd(["set profile 1 bearer-context 6,15,8,1000000,1000000,0,0"])
        mme.cmd(["set profile 1 mei 987654321012399"])
        mme.cmd(["set profile 1 timezone 32"])
        mme.cmd(["set profile 1 apn-ambr 5000,5000"])
        mme.cmd(["set profile 1 pco 8080210a0144000a810600000000"])
        mme.cmd(["set profile 1 cbresp-cause 16"])
        mme.cmd(["set profile 1 dbresp-cause 16"])
        mme.cmd(["set profile 1 retry-count 1"])
        mme.cmd(["set profile 1 retry-time 5"])
        mme.cmd(["set profile 1 hrpd-attach false"])
        mme.cmd(["set profile 1 max-burst-rate 50"])
        mme.cmd(["set profile 1 piggyback-flag false"])
        mme.cmd(["set profile 1 selection-mode 0"])
        mme.cmd(["set profile 1 apn-restriction-type 0"])
        mme.cmd(["set profile 1 break-piggyback-resp false"])
        mme.cmd(["set profile 1 ignore-piggyback-req false"])
        mme.cmd(["set profile 1 static-paa false"])
        mme.cmd(["set profile 1 ipv4-address-pool-prefix 100.0.0.0/24"])
        mme.cmd(["set profile 1 ipv6-address-pool-prefix 4ffe:6400::0/64"])
        mme.cmd(["set profile 1 ipv6-address-pool-size 1024"])
        mme.cmd([
            "set profile 1 default-bearer-context 5,15,9,1000000,1000000,0,0"
        ])
        mme.cmd(["set profile 1 no-imsi false"])
        mme.cmd(["set profile 1 unauth-imsi false"])
        mme.cmd(["set profile 1 ipv4-address-pool-size 256"])
        mme.cmd(["set profile 1 csg-cr-support true"])
        mme.cmd(["set profile 1 auto-failed-reattach-delay 0"])
        mme.cmd(["set profile 1 uli-mcc-mnc-ecgi 123456,0x1234567"])
        mme.cmd(["set profile 1 msisdn 12345098761"])
        mme.cmd(["set profile 1 uli-cr-support true"])
        mme.cmd(["create session-group 1 1 1"])
        mme.cmd(["proc attach group 1"])
        mme.cmd(["show session-group 1 count"])
        mme.cmd(["show session-group 1 count"])
        import pdb
        pdb.set_trace()
        res = mme.cmd([
            "show log", "show session-group 1", "show profile 1",
            "show version", "show log-level"
        ])
        logger.info("mme: %s" % res.data)

    except Exception as e:
        logger.error("Exception from startup : {}".format(e))

        traceback.print_tb(e.__traceback__)
        exit2(2)
Ejemplo n.º 6
0
def start_simulators():
    global mme_console
    global mme_console2
    global mme_console3
    global mme_console4
    global mme_console5
    global mme_console6
    global mme_console7
    global mme_console8
    global mme_console9
    global mme_console10
    global mme_console11
    global mme_console12
    global mme_console13
    global mme_console14
    global mme_console15
    #    global mme_console16

    global mme
    global mme2
    global mme3
    global mme4
    global mme5
    global mme6
    global mme7
    global mme8
    global mme9
    global mme10
    global mme11
    global mme12
    global mme13
    global mme14
    global mme15
    #    global mme16

    try:
        # import pdb; pdb.set_trace()
        mme_console = itc_pexpect.Itc(sim_expect)
        mme_console2 = itc_pexpect.Itc(sim_expect2)
        mme_console3 = itc_pexpect.Itc(sim_expect3)
        mme_console4 = itc_pexpect.Itc(sim_expect4)
        mme_console5 = itc_pexpect.Itc(sim_expect5)
        mme_console6 = itc_pexpect.Itc(sim_expect6)
        mme_console7 = itc_pexpect.Itc(sim_expect7)
        mme_console8 = itc_pexpect.Itc(sim_expect8)
        mme_console9 = itc_pexpect.Itc(sim_expect9)
        mme_console10 = itc_pexpect.Itc(sim_expect10)
        mme_console11 = itc_pexpect.Itc(sim_expect11)
        mme_console12 = itc_pexpect.Itc(sim_expect12)
        mme_console13 = itc_pexpect.Itc(sim_expect13)
        mme_console14 = itc_pexpect.Itc(sim_expect14)
        mme_console15 = itc_pexpect.Itc(sim_expect15)
        #        mme_console16 = itc_pexpect.Itc(sim_expect16)

        mme = itc.Itc(sim)
        mme2 = itc.Itc(sim2)
        mme3 = itc.Itc(sim3)
        mme4 = itc.Itc(sim4)
        mme5 = itc.Itc(sim5)
        mme6 = itc.Itc(sim6)
        mme7 = itc.Itc(sim7)
        mme8 = itc.Itc(sim8)
        mme9 = itc.Itc(sim9)
        mme10 = itc.Itc(sim10)
        mme11 = itc.Itc(sim11)
        mme12 = itc.Itc(sim12)
        mme13 = itc.Itc(sim13)
        mme14 = itc.Itc(sim14)
        mme15 = itc.Itc(sim15)


#        mme16 = itc.Itc(sim16)

    except Exception as e:
        logger.error("Exception from startup : {}".format(e))
        traceback.print_tb(e.__traceback__)
        exit2(3)