예제 #1
0
    def __init__(self):
        """
        Initialize the various classes required by the tests and setup.
        """
        self._s1_util = S1ApUtil()
        self._enBConfig()

        subscriber_client = SubscriberDbGrpc()
        mobility_client = MobilityServiceGrpc()
        magmad_client = MagmadServiceGrpc()
        self._sub_util = SubscriberUtil(subscriber_client)
        # Remove existing subscribers to start
        self._sub_util.cleanup()
        self._mobility_util = MobilityUtil(mobility_client)
        self._mobility_util.cleanup()
        self._magmad_util = MagmadUtil(magmad_client)
        # gateway tests don't require restart, just wait for healthy now
        self._gateway_services = GatewayServicesUtil()
        self.wait_gateway_healthy = True
        if not self.wait_gateway_healthy:
            self.init_s1ap_tester()

        self._configuredUes = []
        self._ue_idx = 0  # Index of UEs already used in test
        self._trf_util = TrafficUtil()
예제 #2
0
    def __init__(
        self,
        stateless_mode=MagmadUtil.stateless_cmds.ENABLE,
        apn_correction=MagmadUtil.apn_correction_cmds.DISABLE,
        health_service=MagmadUtil.health_service_cmds.DISABLE,
        federated_mode=False,
        ip_version=4,
    ):
        """
        Initialize the various classes required by the tests and setup.
        """
        t = time.localtime()
        current_time = time.strftime("%H:%M:%S", t)
        if TestWrapper.TEST_CASE_EXECUTION_COUNT != 0:
            print("\n**Running the test case again to identify flaky behavior")
        TestWrapper.TEST_CASE_EXECUTION_COUNT += 1
        print(
            "\nTest Case Execution Count:",
            TestWrapper.TEST_CASE_EXECUTION_COUNT,
            "[Start time: " + str(current_time) + "]",
        )

        self._s1_util = S1ApUtil()
        self._enBConfig(ip_version)

        federated_mode = (os.environ.get("FEDERATED_MODE") == "True")
        print(
            f"\n *** Running the test in {'Non-' if not federated_mode else ''}"
            "Federated Mode\n", )

        if self._test_oai_upstream:
            subscriber_client = SubscriberDbCassandra()
            self.wait_gateway_healthy = False
        elif federated_mode:
            subscriber_client = HSSGrpc()
            self.wait_gateway_healthy = True
        else:
            subscriber_client = SubscriberDbGrpc()
            self.wait_gateway_healthy = True

        mobility_client = MobilityServiceGrpc()
        magmad_client = MagmadServiceGrpc()
        self._sub_util = SubscriberUtil(subscriber_client)
        # Remove existing subscribers to start
        self._sub_util.cleanup()
        self._mobility_util = MobilityUtil(mobility_client)
        self._mobility_util.cleanup()
        self._magmad_util = MagmadUtil(magmad_client)
        self._magmad_util.config_stateless(stateless_mode)
        self._magmad_util.config_apn_correction(apn_correction)
        self._magmad_util.config_health_service(health_service)
        # gateway tests don't require restart, just wait for healthy now
        self._gateway_services = GatewayServicesUtil()
        if not self.wait_gateway_healthy:
            self.init_s1ap_tester()

        self._configuredUes = []
        self._ue_idx = 0  # Index of UEs already used in test
        self._trf_util = TrafficUtil()
예제 #3
0
    def __init__(
        self,
        stateless_mode=MagmadUtil.stateless_cmds.ENABLE,
        apn_correction=MagmadUtil.apn_correction_cmds.DISABLE,
        health_service=MagmadUtil.health_service_cmds.DISABLE,
    ):
        """
        Initialize the various classes required by the tests and setup.
        """
        if not TestWrapper.IS_TEST_RUNNING_FIRST_TIME:
            print("\n**Running the test case again to identify flaky behavior")

        TestWrapper.IS_TEST_RUNNING_FIRST_TIME = False
        t = time.localtime()
        current_time = time.strftime("%H:%M:%S", t)
        print("Start time", current_time)
        self._s1_util = S1ApUtil()
        self._enBConfig()

        if self._test_oai_upstream:
            subscriber_client = SubscriberDbCassandra()
            self.wait_gateway_healthy = False
        else:
            subscriber_client = SubscriberDbGrpc()
            self.wait_gateway_healthy = True

        mobility_client = MobilityServiceGrpc()
        magmad_client = MagmadServiceGrpc()
        self._sub_util = SubscriberUtil(subscriber_client)
        # Remove existing subscribers to start
        self._sub_util.cleanup()
        self._mobility_util = MobilityUtil(mobility_client)
        self._mobility_util.cleanup()
        self._magmad_util = MagmadUtil(magmad_client)
        self._magmad_util.config_stateless(stateless_mode)
        self._magmad_util.config_apn_correction(apn_correction)
        self._magmad_util.config_health_service(health_service)
        # gateway tests don't require restart, just wait for healthy now
        self._gateway_services = GatewayServicesUtil()
        if not self.wait_gateway_healthy:
            self.init_s1ap_tester()

        self._configuredUes = []
        self._ue_idx = 0  # Index of UEs already used in test
        self._trf_util = TrafficUtil()
예제 #4
0
    def __init__(self):
        """
        Initialize the various classes required by the tests and setup.
        """
        self._s1_util = S1ApUtil()
        self._enBConfig()

        # if self._test_cloud:
        #    self._cloud_manager = CloudManager()
        #    self._cloud_manager.clean_up()
        #    subscriber_client = SubscriberDbRest(self._cloud_manager)
        #    mobility_client = MobilityServiceRest(self._cloud_manager,
        #                                          self._gateway_services)
        #    self._sub_util = SubscriberUtil(subscriber_client)
        #    self._mobility_util = MobilityUtil(mobility_client)
        #    self._gateway_services = GatewayServicesUtil()
        #    self.wait_gateway_healthy = False
        if self._test_oai_upstream:
            subscriber_client = SubscriberDbMySQL()
            mobility_client = MobilityServiceOAI()
            self._sub_util = SubscriberUtil(subscriber_client)
            self._mobility_util = MobilityUtil(mobility_client)
            self.wait_gateway_healthy = False
        else:
            subscriber_client = SubscriberDbGrpc()
            mobility_client = MobilityServiceGrpc()
            self._sub_util = SubscriberUtil(subscriber_client)
            # Remove existing subscribers to start
            self._sub_util.clean_up()
            self._mobility_util = MobilityUtil(mobility_client)
            # gateway tests don't require restart, just wait for healthy now
            self._gateway_services = GatewayServicesUtil()
            self.wait_gateway_healthy = True
        if not self.wait_gateway_healthy:
            self.init_s1ap_tester()

        self._configuredUes = []
        self._ue_idx = 0  # Index of UEs already used in test
        self._trf_util = TrafficUtil()
예제 #5
0
    def __init__(
        self,
        stateless_mode=MagmadUtil.stateless_cmds.DISABLE,
        apn_correction=MagmadUtil.apn_correction_cmds.DISABLE,
    ):
        """
        Initialize the various classes required by the tests and setup.
        """
        self._s1_util = S1ApUtil()
        self._enBConfig()

        if self._test_oai_upstream:
            subscriber_client = SubscriberDbCassandra()
            self.wait_gateway_healthy = False
        else:
            subscriber_client = SubscriberDbGrpc()
            self.wait_gateway_healthy = True

        mobility_client = MobilityServiceGrpc()
        magmad_client = MagmadServiceGrpc()
        self._sub_util = SubscriberUtil(subscriber_client)
        # Remove existing subscribers to start
        self._sub_util.cleanup()
        self._mobility_util = MobilityUtil(mobility_client)
        self._mobility_util.cleanup()
        self._magmad_util = MagmadUtil(magmad_client)
        self._magmad_util.config_stateless(stateless_mode)
        self._magmad_util.config_apn_correction(apn_correction)
        # gateway tests don't require restart, just wait for healthy now
        self._gateway_services = GatewayServicesUtil()
        if not self.wait_gateway_healthy:
            self.init_s1ap_tester()

        self._configuredUes = []
        self._ue_idx = 0  # Index of UEs already used in test
        self._trf_util = TrafficUtil()