def __init__(self, test_session_coordinator):
        super().__init__(test_name=__name__.split(".")[-1],
                         ctx_test_session_coordinator=test_session_coordinator)

        # ------------------------------------------------------------------------------------------------
        # Step 3, waiting test accept: the test is waiting for test accepted app message in port 224.
        self.s3_actok_finalstep = lorawan_steps.ActokFinal(
            ctx_test_manager=self,
            step_name="S3ActokFinalStep",
            next_step=None)
        self.add_step_description(
            step_name="Step 3: S3ActokFinalStep",
            description=
            ("The test is expecting a Test Activation Ok message with the current\n"
             "downlink counter\n"
             "- Reception from DUT: TAOK message with the downlink counter."
             "- TAS sends: none"))

        # ------------------------------------------------------------------------------------------------
        # Step 2, waiting any: the test is waiting for any data packet to arrive in a port different from 0
        self.s2_data_to_activate = lorawan_steps.WaitDataToActivate(
            ctx_test_manager=self,
            step_name="S2DataToActivate",
            next_step=self.s3_actok_finalstep)
        self.add_step_description(
            step_name="Step 2: S2DataToActivate",
            description=(
                "Wait any data from the DUT to activate Test Mode.\n"
                "- Reception from DUT: DATA packet.\n"
                "- TAS sends: Test Mode activation message to the DUT"
                "(DL packet with payload 0x01010101 sent to port 224)\n"
                "The payload is encrypted with the AppSKey.\n"))

        # ------------------------------------------------------------------------------------------------
        # Step 1, waiting any message: deactivates the test mode.
        self.s1_any_to_deactivate = AnyToDeactivate(
            ctx_test_manager=self,
            step_name="S1AnyToDeactivate",
            next_step=self.s2_data_to_activate)
        self.add_step_description(
            step_name="Step 1: S1AnyToDeactivate",
            description=
            ("Sends the Test Mode deactivation message after any received message.\n"
             "- Reception from DUT: Any LoRaWAN message.\n"
             "- TAS sends:  Test Mode deactivation (payload 0x00).\n"))

        # ------------------------------------------------------------------------------------------------
        # Set Initial Step
        self.current_step = self.s1_any_to_deactivate
        self.add_step_description(
            step_name="Test ID: TD_LoRaWAN_RESET",
            description=
            ("Objective: Resets the DUT to a known state after a test fails, deactivating and "
             "activating again the Test Mode.\n"
             "References: LoRaWAN Specification v1.0.2.\n"
             "Pre-test conditions:\n"
             "The end device has a pre-configured DevAddr, NwkSKey and AppSKey.\n"
             "The Test Application Server has the end device registered in its ABP "
             "device list and knows its NwkSkey, AppSKey and DevAddr.\n"))
    def __init__(self, test_session_coordinator):
        super().__init__(test_name=__name__.split(".")[-1],
                         ctx_test_session_coordinator=test_session_coordinator)

        # -----------------------------------------------------------------------------------------
        # Step 2, TAOK: the test is waiting for test accepted app message in port 224.
        self.s2_actok_finalstep = lorawan_steps.ActokFinal(ctx_test_manager=self,
                                                           step_name="S2ActokFinalStep",
                                                           next_step=None)
        self.add_step_description(
            step_name="Step 2: S2ActokFinalStep",
            description=(
                "The test is expecting a Test Activation Ok message with the current "
                "downlink counter\n"
                "- Reception from DUT: TAOK message with the downlink counter.\n"
                "- TAS sends: none"))

        # -----------------------------------------------------------------------------------------
        # Step 1, waiting data: any port different from 0 (MAC commands) or 224 (test mode).
        self.s1_data_to_activate = lorawan_steps.WaitDataToActivate(
            ctx_test_manager=self,
            step_name="S1DataToActivate",
            next_step=self.s2_actok_finalstep)
        self.add_step_description(
            step_name="Step 1: S1DataToActivate",
            description=("Wait any data from the DUT to activate Test Mode.\n"
                         "- Reception from DUT: DATA packet.\n"
                         "- TAS sends: Test Mode activation message to the DUT "
                         "(DL packet with payload 0x01010101 sent to port 224). "
                         "The payload is encrypted with the AppSKey.\n"))

        # ------------------------------------------------------------------------------------------
        # Set Initial Step
        self.current_step = self.s1_data_to_activate
        self.add_step_description(
            step_name="Test ID: TD_LoRaWAN_ACT_01",
            description=(
                "Objective: Check that the node can join using ABP and enter "
                "Test Mode Activation.\n"
                "References: LoRaWAN Specification v1.0.2.\n"
                "Pre-test conditions:\n"
                "The end device has a pre-configured DevAddr, NwkSKey and AppSKey.\n"
                "The Test Application Server has the end device registered in its device list\n"
                "and knows its NwkSkey, AppSKey and DevAddr.\n"))
Пример #3
0
    def __init__(self, test_session_coordinator):
        super().__init__(test_name=__name__.split(".")[-1],
                         ctx_test_session_coordinator=test_session_coordinator)

        # ------------------------------------------------------------------------------------------------
        # Step 6, waiting pong.
        self.s6_pong_finalstep = lorawan_steps.PongFinalStep(
            ctx_test_manager=self, step_name="S6PongFinalStep", next_step=None)
        self.add_step_description(
            step_name="Step 6: S6PongFinalStep",
            description=("Checks the last PONG.\n"
                         "- Reception from DUT: PONG message.\n"
                         "- TAS sends:  none.\n"))

        # ------------------------------------------------------------------------------------------------
        # Step 5, waiting pong: Check ActOk and sends a ping.
        self.s5_pong_to_ping = lorawan_steps.PongToPing(
            ctx_test_manager=self,
            step_name="S5PongToPing",
            next_step=self.s6_pong_finalstep,
            default_rx1_window=False)
        self.add_step_description(
            step_name="Step 5: S5PongToPing",
            description=
            ("Waits for the PONG message and sends another PING, now using RX2.\n"
             "- Reception from DUT: PONG message.\n"
             "- TAS sends:  PING message using RX2.\n"))

        # ------------------------------------------------------------------------------------------------
        # Step 4, waiting new activation: Check the activation and send pong using specified new DR in RX1.
        self.s4_actok_to_ping = lorawan_steps.ActokToPing(
            ctx_test_manager=self,
            step_name="S4ActokToPing",
            next_step=self.s5_pong_to_ping,
            default_rx1_window=True)
        self.add_step_description(
            step_name="Step 4: S4ActokToPing",
            description=
            ("After receiving an Activation OK message with the current downlink "
             "counter, a PING message will be sent.\n"
             "- Reception from DUT: TAOK message with the downlink counter.\n"
             "- TAS sends:  PING message in RX1.\n"))

        # ------------------------------------------------------------------------------------------------
        # Step 3, session updated: waiting for a data message to activate again the test mode.
        self.s3_data_to_activate = lorawan_steps.WaitDataToActivate(
            ctx_test_manager=self,
            step_name="S3DataToActivate",
            next_step=self.s4_actok_to_ping,
            default_rx1_window=False)
        self.add_step_description(
            step_name="Step 3: S3DataToActivate",
            description=
            ("A data message is expected, and the Test Mode will be activated "
             "after its reception\n"
             "- Reception from DUT: DATA packet.\n"
             "- TAS sends: Test Mode activation message to the DUT"
             "(DL packet with payload 0x01010101 sent to port 224).\n"))

        # ------------------------------------------------------------------------------------------------
        # Step 2, join triggered: the test is waiting for the join request from the DUT.
        self.s2_joinrequest_to_accept = (lorawan_steps.JoinRequestHandlerStep(
            ctx_test_manager=self,
            step_name="S2JoinrequestToAccept",
            next_step=self.s3_data_to_activate,
            default_rx1_window=False))
        self.add_step_description(
            step_name="Step 2: S2JoinRequestToAccept",
            description=
            ("Waits for a join request message. "
             "A Join Accept will be sent in response with the default configuration.\n"
             "- Reception from DUT: Join Request message.\n"
             "- TAS sends: Join Accept message.\n"))

        # ------------------------------------------------------------------------------------------------
        # Step 1, waiting actok: the test is waiting for an Activation OK message with the downlink counter.
        self.s1_actok_to_triggerjoin = lorawan_steps.ActokToTriggerJoin(
            ctx_test_manager=self,
            step_name="S1ActokToTriggerJoin",
            next_step=self.s2_joinrequest_to_accept)
        self.add_step_description(
            step_name="Step 1: S1ActokToTriggerJoin",
            description=
            ("Waits and Activation Ok message with the current downlink counter of "
             "the session and, after it's received, a new session will be requested.\n"
             "- Reception from DUT: TAOK message with the downlink counter.\n"
             "- TAS sends: Trigger join request with test ID 6.\n"))

        # ------------------------------------------------------------------------------------------------
        # Set Initial Step
        self.current_step = self.s1_actok_to_triggerjoin
        self.add_step_description(
            step_name="Test ID: TD_LoRaWAN_ACT_05",
            description=(
                "Objective: Uses Join-accept message to initiate a new session "
                "restoring the default LoRaWAN MAC parameters.\n"
                "References: LoRaWAN Specification v1.0.2.\n"
                "Pre-test conditions: The DUT is in Test Mode and supports "
                "Over The Air Activation (OTAA).\n"))
Пример #4
0
    def __init__(self, test_session_coordinator):
        super().__init__(test_name=__name__.split(".")[-1],
                         ctx_test_session_coordinator=test_session_coordinator)
        # -----------------------------------------------------------------------------------------
        # Step 6, waiting pong.
        self.s6_pong_finalstep = lorawan_steps.PongFinalStep(
            ctx_test_manager=self, step_name="S6PongFinalStep", next_step=None)
        self.add_step_description(
            step_name="Step 6: S6PongFinalStep",
            description=("Checks the last PONG.\n"
                         "- Reception from DUT: PONG message.\n"
                         "- TAS sends:  none.\n"))
        # -----------------------------------------------------------------------------------------
        # Step 5, waiting pong: Checks PONG and sends a new PING.
        self.s5_pong_to_ping = lorawan_steps.PongToPing(
            ctx_test_manager=self,
            step_name="S5PongToPing",
            next_step=self.s6_pong_finalstep,
            default_rx1_window=False)
        self.add_step_description(
            step_name="Step 5: S5PongToPing",
            description=
            ("Waits for the PONG message and sends another PING, now using RX2.\n"
             "- Reception from DUT: PONG message.\n"
             "- TAS sends:  PING message using RX2.\n"))

        # -----------------------------------------------------------------------------------------
        # Step 4, waiting new activation: Check activation and send pong using new DR in RX1.
        self.s4_actok_to_ping = lorawan_steps.ActokToPing(
            ctx_test_manager=self,
            step_name="S4ActokToPing",
            next_step=self.s5_pong_to_ping)
        self.add_step_description(
            step_name="Step 4: S4ActokToPing",
            description=
            ("After receiving an TAOK (Activation OK) message with the current downlink "
             "counter, a PING message will be sent.\n"
             "- Reception from DUT: TAOK message with the downlink counter.\n"
             "- TAS sends:  PING message in RX1 using a DR offset of 2.\n"))

        # -----------------------------------------------------------------------------------------
        # Step 3, session updated: waiting for a data message to activate again the test mode.
        self.s3_data_to_activate = lorawan_steps.WaitDataToActivate(
            ctx_test_manager=self,
            step_name="S3DataToActivate",
            next_step=self.s4_actok_to_ping,
            accept_dlsettings=general_parameters.DLSETTINGS.RX1OFFSET2_RX2DR3)
        self.add_step_description(
            step_name="Step 3: S3DataToActivate",
            description=
            ("A data message is expected, and the Test Mode will be activated "
             "after its reception.\n"
             "- Reception from DUT: DATA packet.\n"
             "- TAS sends: Test Mode activation message to the DUT"
             "(DL packet with payload 0x01010101 sent to port 224).\n"))
        # -----------------------------------------------------------------------------------------
        # Step 2, join triggered: the test is waiting for the join request from the DUT.
        self.s2_joinrequest_to_accept = (lorawan_steps.JoinRequestHandlerStep(
            ctx_test_manager=self,
            step_name="S2JoinRequestToAccept",
            next_step=self.s3_data_to_activate,
            accept_dlsettings=general_parameters.DLSETTINGS.RX1OFFSET2_RX2DR3))
        self.add_step_description(
            step_name="Step 2: S2JoinRequestToAccept",
            description=(
                "Updates the session information of the device.\n"
                "- Reception from DUT: Join Request message.\n"
                "- TAS sends: Join Accept message configuring DLSettings "
                "(RX1DRoffset=2 and RX2DR=3).\n"))
        # -----------------------------------------------------------------------------------------
        # Step 1, waiting TAOK: Activation OK message with the downlink counter.
        self.s1_actok_to_triggerjoin = lorawan_steps.ActokToTriggerJoin(
            ctx_test_manager=self,
            step_name="S1ActokToTriggerJoin",
            next_step=self.s2_joinrequest_to_accept)
        self.add_step_description(
            step_name="Step 1: S1ActokToTriggerJoin",
            description=
            ("Waits a TAOK (Activation Ok) message with the current downlink counter of"
             "the session and, after it's received, a new session request will be triggered.\n"
             "- Reception from DUT: TAOK message with the downlink counter.\n"
             "- TAS sends: Trigger join request with Test ID 6.\n"))
        # -----------------------------------------------------------------------------------------
        # Set Initial Step
        self.current_step = self.s1_actok_to_triggerjoin
        self.add_step_description(
            step_name="Test ID: TD_LoRaWAN_ACT_02",
            description=
            ("Objective: Test Over the Air Activation, changing DR of RX windows. "
             "Check that the node can join using OTAA in RX1 and RX2.\n"
             "References: LoRaWAN Specification v1.0.2.\n"
             "Pre-test conditions: The DUT is in Test Mode and supports "
             "Over The Air Activation (OTAA).\n"))
    def __init__(self, test_session_coordinator):
        super().__init__(test_name=__name__.split(".")[-1],
                         ctx_test_session_coordinator=test_session_coordinator)
        # -----------------------------------------------------------------------------------------
        # Step 4, new activation: Check the activation and send pong using specified new DR in RX1.
        self.s4_verify_frequencies_final = lorawan_steps.FrequencyCheckFinal(
            ctx_test_manager=self,
            step_name="S4VerifyFrequencies",
            next_step=None,
            default_rx1_window=True)
        self.add_step_description(
            step_name="Step 4: S4VerifyFrequencies",
            description=(
                "The test stays in this step and verifies that all the frequencies "
                "are being used.\n"
                "- Reception from DUT: TAOK message with the downlink counter.\n"
                "- TAS sends: none.\n"))

        # -----------------------------------------------------------------------------------------
        # Step 3, session updated: waiting for a data message to activate again the test mode.
        self.s3_data_to_activate = lorawan_steps.WaitDataToActivate(
            ctx_test_manager=self,
            step_name="S3DataToActivate",
            next_step=self.s4_verify_frequencies_final,
            default_rx1_window=False,
            accept_cflist=general_parameters.get_cflist(
                general_parameters.VALID_FREQ[20],
                general_parameters.VALID_FREQ[21],
                general_parameters.VALID_FREQ[22],
                general_parameters.VALID_FREQ[23],
                general_parameters.VALID_FREQ[24]))
        self.add_step_description(
            step_name="Step 3: S3DataToActivate",
            description=(
                "A data message is expected, and the Test Mode will be activated "
                "after its reception.\n"
                "- Reception from DUT: DATA packet.\n"
                "- TAS sends: Test Mode activation message to the DUT"
                "(DL packet with payload 0x01010101 sent to port 224).\n"))

        # -----------------------------------------------------------------------------------------
        # Step 2, join triggered: the test is waiting for the join request from the DUT.
        self.s2_joinrequest_to_accept = (
            lorawan_steps.JoinRequestHandlerStep(ctx_test_manager=self,
                                                 step_name="S2JoinrequestToAccept",
                                                 next_step=self.s3_data_to_activate,
                                                 accept_cflist=general_parameters.get_cflist(
                                                     general_parameters.VALID_FREQ[20],
                                                     general_parameters.VALID_FREQ[21],
                                                     general_parameters.VALID_FREQ[22],
                                                     general_parameters.VALID_FREQ[23],
                                                     general_parameters.VALID_FREQ[24]))
        )
        self.add_step_description(
            step_name="Step 2: S2JoinRequestToAccept",
            description=(
                "Waits for a join request message. A Join Accept "
                "will be sent in response configuring new channels (using CFList).\n"
                "- Reception from DUT: Join Request message.\n"
                "- TAS sends: Join Accept message configuring CFList to add new channels.\n"))

        # -----------------------------------------------------------------------------------------
        # Step 1, TAOK: the test is waiting for an Activation OK message with the downlink counter.
        self.s1_actok_to_triggerjoin = lorawan_steps.ActokToTriggerJoin(
            ctx_test_manager=self,
            step_name="S1ActokToTriggerJoin",
            next_step=self.s2_joinrequest_to_accept)
        self.add_step_description(
            step_name="Step 1: S1ActokToTriggerJoin",
            description=(
                "Waits and Activation Ok message with the current downlink counter of"
                "the session and, after it's received, a new session will be requested\n"
                "- Reception from DUT: TAOK message with the downlink counter.\n"
                "- TAS sends: Trigger join request with test ID 6.\n"))

        # -----------------------------------------------------------------------------------------
        # Set Initial Step
        self.current_step = self.s1_actok_to_triggerjoin
        self.add_step_description(
            step_name="Test ID: TD_LoRaWAN_ACT_04",
            description=(
                "Objective: Test Over the Air Activation configuring 5 new channels.\n"
                "References: LoRaWAN Specification v1.0.2.\n"
                "Pre-test conditions: The DUT is in Test Mode and supports "
                "Over The Air Activation (OTAA).\n"))