Exemplo n.º 1
0
    def setUpClass(cls):
        cls.text = "00000000000000000"
        setup_test_redis()
        os.system("mkdir -p /tmp/crash/")
        global_dispatcher = Dispatcher()
        CrashFileStatusInfo.MAX_IDX = 20
        crashFileStatusInfo = CrashFileStatusInfo()
        CrashFileCtrlHandler.CORE_FILE_PATH = "/tmp/crash/"
        crashFileStatusInfo.CORE_FILE_PATH = "/tmp/crash/"
        currentPath = os.path.dirname(os.path.realpath(__file__))
        dirs = currentPath.split("/")
        rpd_index = dirs.index("testing") - 2
        cls.rootpath = "/".join(dirs[:rpd_index])
        cls.halClient = RpdResHalClient("RpdRes_hal",
                                        "This is RPD HostRes hal client",
                                        "1.0.0", global_dispatcher,
                                        (MsgTypeHostResources, MsgTypeRpdCtrl, ),
                                        ())
        cls.crashCtrlHandler = cls.halClient.crashFileCtrlHandler
        cls.crashCtrlHandler.CORE_FILE_PATH = "/tmp/crash/"

        cls.start_tftp_cmd = \
            "coverage run --parallel-mode --rcfile=" + \
            cls.rootpath + "/.coverage.rc " + \
            cls.rootpath + \
            "/rpd/resource/testing/tftp_server_sim.py --root " + \
            cls.rootpath + " --server 127.0.0.1 --port " + \
            str(cls.TFTP_PORT)
        cls.tftp_pid = subprocess.Popen(cls.start_tftp_cmd, executable='bash', shell=True)
        print(cls.tftp_pid)
Exemplo n.º 2
0
 def setUp(self):
     setup_test_redis()
     CCAPCoreOrchestrator.NO_PRINCIPAL_CORE_FOUND_TIMEOUT = 60
     CCAPCore.ccap_core_db = {}
     self.fake_cb_cnt = 0
     self.mgr = ManagerProcess(simulator=True, test_flag=True)
     ManagerProcess.SYSTEM_TIME_CONFIRM = "None"
Exemplo n.º 3
0
 def setUpClass(cls):
     setup_test_redis()
     global_dispatcher = Dispatcher()
     cls.rpdhostres = RpdResHalClient("RpdHostRes_hal",
                                      "This is RPD HostRes hal client",
                                      "1.0.0", global_dispatcher, (
                                          MsgTypeHostResources,
                                          MsgTypeRpdCtrl,
                                      ), ())
Exemplo n.º 4
0
    def setUpClass(cls):
        setup_logging("L2TP")
        setup_test_redis()

        # Construct the API transport path
        ApiPath = L2tpv3GlobalSettings.L2tpv3GlobalSettings.APITransportPath
        print ApiPath
        cls.api = L2tpv3API(ApiPath)
        for key in Mcast.McastDb.keys():
            Mcast.McastDb[key].close()
Exemplo n.º 5
0
 def setUp(self):
     # try to find the l2tp agent
     setup_test_redis()
     currentPath = os.path.dirname(os.path.realpath(__file__))
     dirs = currentPath.split("/")
     rpd_index = dirs.index("testing") - 2
     self.rootpath = "/".join(dirs[:rpd_index])
     self.pid = subprocess.Popen(
         "coverage run --parallel-mode --rcfile=" + self.rootpath +
         "/.coverage.rc " + "/".join(dirs[:rpd_index]) +
         "/rpd/provision/process_agent/l2tp/l2tp_agent.py -s",
         executable='bash',
         shell=True)
Exemplo n.º 6
0
 def setUpClass(cls):
     cls.conn_address = '127.0.0.1'
     setup_test_redis()
     global_dispatcher = Dispatcher()
     dispatcher = L2tpv3Dispatcher(global_dispatcher, cls.conn_address, False, None)
     L2tpv3GlobalSettings.Dispatcher = dispatcher
     # setup the halclient
     cls.hal_client = L2tpHalClient("L2TP_HAL_CLIENT",
                                    "the HAL client of L2TP feature",
                                    "1.0", tuple(L2tpHalClient.notification_list.keys()), global_dispatcher)
     cls.hal_client.handler = dispatcher.receive_hal_message
     L2tpv3GlobalSettings.l2tp_hal_client = cls.hal_client
     pass
Exemplo n.º 7
0
    def setUpClass(cls):
        # open logger
        setup_logging("L2TP")
        setup_test_redis()

        cls.conn_address = '127.0.0.1'
        global_dispatcher = Dispatcher()
        dispatcher = L2tpv3Dispatcher(
            global_dispatcher, cls.conn_address, False, None)
        L2tpv3GlobalSettings.Dispatcher = dispatcher
        # setup the halclient

        notification_list = list()
        notification_list.append(
            HalConfigMsg.MsgTypeL2tpv3SessionStatusNotification)

        cls.hal_client = L2tpHalClient("L2TP_HAL_CLIENT",
                                       "the HAL client of L2TP feature",
                                       "1.0", tuple(L2tpHalClient.notification_list.keys()), global_dispatcher)

        cls.hal_client.handler = dispatcher.receive_hal_message
        cls.conn = L2tpConnection(
            6661, 6662, cls.conn_address, cls.conn_address)
        cls.session = L2tpv3Session(6661, 6662, 'receiver', cls.conn)
        cls.conn.addSession(cls.session)
        localSessionId = L2tpv3RFC3931AVPs.LocalSessionID(6661)
        remoteSessionId = L2tpv3RFC3931AVPs.RemoteSessionID(6662)
        remoteEnd = L2tpv3RFC3931AVPs.RemoteEndID(
            (((0, 3, 0), 0), ((0, 3, 1), 1), ((0, 3, 2), 2)))
        remoteEnd_1 = L2tpv3RFC3931AVPs.RemoteEndID(
            (((0, 3, 3), 3), ((0, 3, 4), 4), ((0, 3, 5), 5)))
        pw_type = L2tpv3RFC3931AVPs.L2SpecificSublayer(3)
        DepiL2SpecificSublayerSubtype = L2tpv3CableLabsAvps.DepiL2SpecificSublayerSubtype(3)
        LocalMTUCableLabs = L2tpv3CableLabsAvps.LocalMTUCableLabs(1500)
        DepiRemoteMulticastJoin = L2tpv3CableLabsAvps.DepiRemoteMulticastJoin(("5.5.5.1", "229.1.1.255"))
        DepiResourceAllocReq = L2tpv3CableLabsAvps.DepiResourceAllocReq(((0, 1), (1, 2)))
        UpstreamFlow = L2tpv3CableLabsAvps.UpstreamFlow(((0, 1), (1, 2)))

        cls.session.avps_icrq.append(localSessionId)
        cls.session.avps_icrq.append(remoteSessionId)
        cls.session.avps_icrq.append(remoteEnd)
        cls.session.avps_icrq.append(remoteEnd_1)
        cls.session.avps_icrq.append(DepiL2SpecificSublayerSubtype)
        cls.session.avps_icrq.append(LocalMTUCableLabs)
        cls.session.avps_icrq.append(pw_type)
        cls.session.avps_icrq.append(DepiRemoteMulticastJoin)
        cls.session.avps_icrq.append(DepiResourceAllocReq)
        cls.session.avps_icrq.append(UpstreamFlow)
Exemplo n.º 8
0
    def setUp(self):
        setup_test_redis()
        self.local_addr = "127.0.0.1"
        self.global_dispatcher = Dispatcher()
        self.l2tp_dispatcher = L2tpv3Dispatcher(
            dispatcher=self.global_dispatcher,
            create_global_listen=False,
            local_addr=self.local_addr)
        L2tpv3GlobalSettings.Dispatcher = self.l2tp_dispatcher

        self.local_addr = "::1"
        self.global_dispatcher = Dispatcher()
        self.l2tp_dispatcher = L2tpv3Dispatcher(
            dispatcher=self.global_dispatcher,
            create_global_listen=False,
            local_addr=self.local_addr)
        L2tpv3GlobalSettings.Dispatcher = self.l2tp_dispatcher
Exemplo n.º 9
0
 def setUpClass(cls):
     setup_logging("GCPP Unit test")
     setup_test_redis()
     cls.fwdCfg = StaticL2tpProvision()
     cls.ApiPath = \
         L2tpv3GlobalSettings.L2tpv3GlobalSettings.APITransportPath
     cls.api = L2tpv3API(cls.ApiPath)
     global_dispatcher = Dispatcher()
     cls.hal_client = L2tpHalClient("L2TP_HAL_CLIENT",
                                    "the HAL client of L2TP feature", "1.0",
                                    tuple(
                                        L2tpHalClient.notification_list.keys()),
                                    global_dispatcher)
     cls.hal_client.pushSock = HalTransport(
         HalTransport.HalTransportClientAgentPull,
         HalTransport.HalClientMode, index=19,
         socketMode=HalTransport.HalSocketPushMode,
         disconnectHandlerCb=None)
Exemplo n.º 10
0
 def setUpClass(cls):
     cls.ircq_buf = struct.pack('!130B',
                                0xc8, 0x03, 0x0, 130,
                                0x0, 0x0, 0x0, 0x12,
                                0x0, 0x3, 0x0, 0x4,
                                0xc, 8, 0x0, 0x0,
                                0x0, 0x0, 0x0, 10,
                                0xc, 10, 0x0, 0x0,
                                0, 15, 0, 0,
                                0, 0,
                                0xc, 10, 0x0, 0x0,
                                0, 63, 0x40, 0x00,
                                0x00, 0x01,
                                0xc, 10, 0x0, 0x0,
                                0, 64, 0x0, 0x0,
                                0x0, 0x0,
                                0xc, 40, 0x0, 0x0,
                                0x0, 66, 0x0, 0x0,
                                0x00, 0x03, 0x00, 0x00,
                                0x00, 0x03, 0x01, 0x01,
                                0x00, 0x03, 0x02, 0x02,
                                0x00, 0x03, 0x03, 0x03,
                                0x00, 0x03, 0x04, 0x04,
                                0x00, 0x03, 0x05, 0x05,
                                0x00, 0x03, 0x06, 0x06,
                                0x00, 0x03, 0x07, 0x07,
                                0xc, 8, 0, 0,
                                0, 68, 0, 12,
                                0xc, 8, 0, 0,
                                0, 69, 0, 3,
                                0xc, 8, 0, 0,
                                0, 71, 0, 2,
                                0xc, 8, 0x11, 0x8b,
                                0x0, 0x2, 0x1, 0x0,
                                0xc, 8, 0x11, 0x8b,
                                0x0, 0x4, 0x7, 0xD0,
                                )
     setup_test_redis()
Exemplo n.º 11
0
 def setUpClass(cls):
     setup_logging("GCP", "gcp.log")
     setup_test_redis()
     # clear db records
     sessRec = DepiMcastSessionRecord()
     sessRec.delete_all()
Exemplo n.º 12
0
 def setUp(self):
     setup_test_redis()
     dhcpRecord = DhcpInfoRecord()
     dhcpRecord.deleteAll()
Exemplo n.º 13
0
 def setUpClass(cls):
     setup_logging('MCAST', filename="Mcast.log")
     setup_test_redis()
     for key in Mcast.McastDb.keys():
         Mcast.McastDb[key].close()
Exemplo n.º 14
0
 def setUp(self):
     setup_test_redis()
     # clear db records
     rec = IpNettophyRec()
     rec.delete_all()
Exemplo n.º 15
0
 def setUp(self):
     setup_test_redis()
     # clear db records
     sessRec = DepiMcastSessionRecord()
     sessRec.delete_all()
Exemplo n.º 16
0
 def setUp(self):
     setup_test_redis()
     # clear db records
     rec = RpdEnetRec()
     rec.delete_all()
Exemplo n.º 17
0
    def setUpClass(cls):
        conn_address = '127.0.0.1'

        for key in Mcast.McastDb.keys():
            Mcast.McastDb.pop(key)

        global_dispatcher = Dispatcher()
        dispatcher = L2tpv3Dispatcher(global_dispatcher, conn_address, False,
                                      None)
        L2tpv3GlobalSettings.Dispatcher = dispatcher
        L2tpv3GlobalSettings.MustAvpsCheck = False
        L2tpv3GlobalSettings.LocalIPAddress = '127.0.0.2'
        cls.conn = L2tpConnection(
            1, 1, conn_address, localAddr=L2tpv3GlobalSettings.LocalIPAddress)

        cls.icrq_buf = struct.pack(
            '!206B',
            0xc8,
            0x03,
            0x0,
            206,
            0x0,
            0x0,
            0x0,
            0x0,
            0x0,
            0x3,
            0x0,
            0x4,
            0xc,
            8,
            0x0,
            0x0,
            0x0,
            0x0,
            0x0,
            10,
            0xc,
            10,
            0x0,
            0x0,
            0,
            15,
            0,
            0,
            0,
            0,
            0xc,
            10,
            0x0,
            0x0,
            0,
            63,
            0x40,
            0x01,
            0x00,
            0x01,
            0xc,
            10,
            0x0,
            0x0,
            0,
            64,
            0x0,
            0x0,
            0x0,
            0x0,
            0xc,
            40,
            0x0,
            0x0,
            0x0,
            66,
            0x0,
            0x0,
            0x00,
            0x03,
            0x00,
            0x00,
            0x00,
            0x03,
            0x01,
            0x01,
            0x00,
            0x03,
            0x02,
            0x02,
            0x00,
            0x03,
            0x03,
            0x03,
            0x00,
            0x03,
            0x04,
            0x04,
            0x00,
            0x03,
            0x05,
            0x05,
            0x00,
            0x03,
            0x06,
            0x06,
            0x00,
            0x03,
            0x07,
            0x07,
            0xc,
            8,
            0,
            0,
            0,
            68,
            0,
            12,
            0xc,
            8,
            0,
            0,
            0,
            69,
            0,
            3,
            0xc,
            8,
            0,
            0,
            0,
            71,
            0,
            2,
            0xc,
            8,
            0x11,
            0x8b,
            0x0,
            0x2,
            0x1,
            0x0,
            0xc,
            8,
            0x11,
            0x8b,
            0x0,
            0x4,
            0x7,
            0xD0,
            0xc,
            20,
            0x11,
            0x8b,
            0x0,
            15,
            0x0,
            0x1,
            0x0,
            0x2,
            0x0,
            0x3,
            0x0,
            0x6,
            0x0,
            0x8,
            0x0,
            11,
            0x0,
            13,
            0xc,
            8,
            0x11,
            0x8b,
            0x0,
            16,
            0x0,
            0x3,
            0xc,
            8,
            0x11,
            0x8b,
            0x0,
            17,
            0x0,
            0x3,
            0xc,
            40,
            0x11,
            0x8b,
            0x0,
            11,
            0,
            0,
            0x5,
            0x6,
            0x7,
            0x8,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            229,
            1,
            1,
            255,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
        )
        setup_test_redis()
Exemplo n.º 18
0
 def setUp(self):
     setup_test_redis()
     self.process = RcpHalProcess("ipc:///tmp/_test_rcp.tmp",
                                  notify_mgr_cb=notification_mgr_cb)
Exemplo n.º 19
0
 def setUp(self):
     setup_test_redis()
Exemplo n.º 20
0
 def setUp(self):
     setup_test_redis()
     sessRecord = L2tpSessionRecord()
     sessRecord.deleteAll()