Commit 37e69ce0 authored by Gianluca Marotta's avatar Gianluca Marotta
Browse files

CT-215 Firt test implemented for re-initialization: after resourcing

parent d81c2696
Loading
Loading
Loading
Loading
Loading
+33 −1
Original line number Diff line number Diff line
@@ -189,6 +189,36 @@ class TestCspSubarray(TestBase):
        prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY")
        Poller(4, 0.2).check(prober_subarray_obsstate)
    
    def test_re_initialization_AFTER_resourcing(self):
        """
        Test for re-initialization of mid-csp device after killing the Tango device. 
        The CspSubarray align to the state/obsstate of CBFSubarray: ON/IDLE
        """
        self._setup_subarray()
        
        json_config= self._build_resources([1,2])
        self.midcsp_subarray01.AssignResources(json_config)

        prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.IDLE, f"CSP Subarray not IDLE")

        # open a proxy to the adminstrative server
        dserver_proxy = tango.DeviceProxy(self.midcsp_subarray01.adm_name())
        dserver_proxy. devrestart('mid_csp/elt/subarray_01')
        """
        timeout = 60
        starting_time = time.time()
        while (time.time() - starting_time)<timeout:
            try:
                dserver_proxy.state()
                break
            except:
                pass
        """
        prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.ON, f"CSP Subarray not ON after re-initialization")
        Poller(10, 0.2).check(prober_subarray_state)
        prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.IDLE, f"CSP Subarray not IDLE after re-initialization")
        Poller(4, 0.2).check(prober_subarray_obsstate)

    def test_subarray_state_AFTER_on_command_execution(self):

        """
@@ -218,6 +248,7 @@ class TestCspSubarray(TestBase):
        prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY")
        Poller(4, 0.2).check(prober_subarray_obsstate)
        receptors = self.midcsp_subarray01.assignedReceptors
        LOGGER.info(f'list of receptors{receptors}')
        assert not receptors.any(), f"CSP Subarray is not empty"

    def test_OffCommand_after_IDLE(self):
@@ -267,6 +298,7 @@ class TestCspSubarray(TestBase):
        receptors = self.midcsp_subarray01.assignedReceptors
        assert not receptors.any(), f"CSP Subarray is not empty"
   
    @pytest.mark.off
    def test_OffCommand_after_SCANNING(self):
        """
        Test that the Off command send the device in OFF-EMPTY