Commit f46de3dd authored by Elisabetta Giani's avatar Elisabetta Giani
Browse files

CT-220: Add test for ADR22 support. Modified json configuration file

adding the 'delayModelSubscriptionPoint' entry (is not optional but needed
by mid-cbf)
parent d74a8ae5
Loading
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ def prepare_configuration_string(filename="test_ConfigureScan_ADR4.json"):
    """Create the config string for CSP-CBF"""
    try:
        file_to_load = file_path + '/../test_data/' + filename
        LOGGER.debug(f" Reading configuration from {file_to_load}")
        LOGGER.info(f" Reading configuration from {file_to_load}")
        json_file = open(file_to_load)
        configuration_string = json_file.read().replace("\n", "")
        return configuration_string
@@ -406,6 +406,27 @@ class TestCspSubarray(TestBase):
        #stored_id = self.midcsp_subarray01.configurationID
        #assert stored_id == configID

    @pytest.mark.csp_k8s
    def test_send_configure_WITH_ADR22_json(self):
        """
        Configure the CSP Subarray with a JSon string including
        the new ADR4 fields.
        """
        self._setup_subarray()
        self._assign_receptors()
        state = self.midcsp_subarray01.State()
        obs_state = self.midcsp_subarray01.obsState
        LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
        # exercise the device
        LOGGER.info(f"Configuring CSP subarray01")
        configuration_string = prepare_configuration_string("test_ConfigureScan_ADR22.json")
        (result_code, msg) = self.midcsp_subarray01.Configure(configuration_string)
        # check
        prober_subarray_obstate = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY,
                                        f"Wrong CSP Subarray obsState {self.midcsp_subarray01.obsState}")
        Poller(5, 0.2).check(prober_subarray_obstate)
        obs_state = self.midcsp_subarray01.obsState

    @pytest.mark.csp_k8s
    def test_start_end_scan(self):
        """
+4 −3
Original line number Diff line number Diff line
{
    "interface": "https://schema.skatelescope.org/ska-csp-configure/1.0",
    "common": {
        "id": "sbi-mvp01-20200325-00001-science_A",
        "frequencyBand": "1"
        "id": "sbi-mvp01-20200326-00001-science_B",
        "frequencyBand": "3"
    },
    "cbf": {
    	"delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel",
        "fsp": [
            {
                "fspID": 1, "functionMode": "CORR", "frequencySliceID": 1,