Loading csp-lmc-mid/tests/integration/MidCspSubarray_test.py +63 −8 Original line number Diff line number Diff line Loading @@ -176,7 +176,6 @@ class TestCspSubarray(TestBase): 'dish': { 'receptorIDList': list(map(str, argin))}} return json.dumps(param) @pytest.mark.csp_k8s def test_AFTER_initialization(self): """ Test for State after CSP startup. Loading @@ -190,7 +189,6 @@ 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) @pytest.mark.csp_k8s def test_subarray_state_AFTER_on_command_execution(self): """ Loading @@ -206,7 +204,6 @@ class TestCspSubarray(TestBase): prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.ON, f"CSP Subarray not OFF") Poller(4, 0.2).check(prober_subarray_state) @pytest.mark.csp_k8s def test_OffCommand_after_RESOURCING(self): self._setup_subarray json_config= self._build_resources([1,2]) Loading @@ -216,8 +213,9 @@ class TestCspSubarray(TestBase): Poller(4, 0.2).check(prober_subarray_state) 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 assert not receptors.any(), f"CSP Subarray is not empty" @pytest.mark.csp_k8s def test_OffCommand_after_IDLE(self): self._setup_subarray() self._assign_receptors() Loading @@ -226,9 +224,10 @@ class TestCspSubarray(TestBase): Poller(4, 0.2).check(prober_subarray_state) 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 assert not receptors.any(), f"CSP Subarray is not empty" @pytest.mark.cps_k8s def test_OffCommand_after_CONFIGURE(self): def test_OffCommand_after_CONFIGURING(self): self._setup_subarray() self._configure_scan() self.midcsp_subarray01.Off() Loading @@ -236,8 +235,65 @@ class TestCspSubarray(TestBase): Poller(10, 0.2).check(prober_subarray_state) prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY") Poller(10, 0.2).check(prober_subarray_obsstate) receptors = self.midcsp_subarray01.assignedReceptors assert not receptors.any(), f"CSP Subarray is not empty" def test_OffCommand_after_READY(self): self._setup_subarray() self._configure_scan() prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.READY, f'CSP Subarray not READY') Poller(10, 0.2).check(prober_subarray_obsstate) self.midcsp_subarray01.Off() prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Subarray not OFF") Poller(10, 0.2).check(prober_subarray_state) prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY") Poller(10, 0.2).check(prober_subarray_obsstate) receptors = self.midcsp_subarray01.assignedReceptors assert not receptors.any(), f"CSP Subarray is not empty" def test_OffCommand_after_SCAN(self): self._setup_subarray() self._configure_scan() prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.READY, f'CSP Subarray not READY') Poller(10, 0.2).check(prober_subarray_obsstate) self.midcsp_subarray01.Scan('2') prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.SCANNING, f'CSP Subarray not SCANNING') Poller(10, 0.2).check(prober_subarray_obsstate) self.midcsp_subarray01.Off() prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Subarray not OFF") Poller(10, 0.2).check(prober_subarray_state) prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY") Poller(10, 0.2).check(prober_subarray_obsstate) receptors = self.midcsp_subarray01.assignedReceptors assert not receptors.any(), f"CSP Subarray is not empty" def test_OffCommand_after_ABORTED(self): self._setup_subarray() self._assign_receptors() self.midcsp_subarray01.Abort() prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.ABORTED, f'CSP Subarray not ABORTED') Poller(10, 0.2).check(prober_subarray_obsstate) self.midcsp_subarray01.Off() prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Subarray not OFF") Poller(4, 0.2).check(prober_subarray_state) 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 assert not receptors.any(), f"CSP Subarray is not empty" @pytest.mark.fault def test_OffCommand_after_FAULT(self): self._setup_subarray() self._assign_receptors() self.midcsp_subarray01.Configure('{"input":"failed"}') prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.FAULT, f'CSP Subarray not FAULT') Poller(10, 0.2).check(prober_subarray_obsstate) self.midcsp_subarray01.Off() prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Subarray not OFF") Poller(4, 0.2).check(prober_subarray_state) 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 assert not receptors.any(), f"CSP Subarray is not empty" @pytest.mark.csp_k8s def test_add_receptors_WITH_invalid_id(self): """ Test the assignment of a number of invalid receptor IDs to Loading @@ -256,7 +312,6 @@ class TestCspSubarray(TestBase): invalid_receptor_to_assign.append(id_num) if len(invalid_receptor_to_assign) > 3: break param = { 'subarrayID': 1, 'dish': { 'receptorIDList': list(map(str, invalid_receptor_to_assign))}} Loading Loading
csp-lmc-mid/tests/integration/MidCspSubarray_test.py +63 −8 Original line number Diff line number Diff line Loading @@ -176,7 +176,6 @@ class TestCspSubarray(TestBase): 'dish': { 'receptorIDList': list(map(str, argin))}} return json.dumps(param) @pytest.mark.csp_k8s def test_AFTER_initialization(self): """ Test for State after CSP startup. Loading @@ -190,7 +189,6 @@ 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) @pytest.mark.csp_k8s def test_subarray_state_AFTER_on_command_execution(self): """ Loading @@ -206,7 +204,6 @@ class TestCspSubarray(TestBase): prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.ON, f"CSP Subarray not OFF") Poller(4, 0.2).check(prober_subarray_state) @pytest.mark.csp_k8s def test_OffCommand_after_RESOURCING(self): self._setup_subarray json_config= self._build_resources([1,2]) Loading @@ -216,8 +213,9 @@ class TestCspSubarray(TestBase): Poller(4, 0.2).check(prober_subarray_state) 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 assert not receptors.any(), f"CSP Subarray is not empty" @pytest.mark.csp_k8s def test_OffCommand_after_IDLE(self): self._setup_subarray() self._assign_receptors() Loading @@ -226,9 +224,10 @@ class TestCspSubarray(TestBase): Poller(4, 0.2).check(prober_subarray_state) 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 assert not receptors.any(), f"CSP Subarray is not empty" @pytest.mark.cps_k8s def test_OffCommand_after_CONFIGURE(self): def test_OffCommand_after_CONFIGURING(self): self._setup_subarray() self._configure_scan() self.midcsp_subarray01.Off() Loading @@ -236,8 +235,65 @@ class TestCspSubarray(TestBase): Poller(10, 0.2).check(prober_subarray_state) prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY") Poller(10, 0.2).check(prober_subarray_obsstate) receptors = self.midcsp_subarray01.assignedReceptors assert not receptors.any(), f"CSP Subarray is not empty" def test_OffCommand_after_READY(self): self._setup_subarray() self._configure_scan() prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.READY, f'CSP Subarray not READY') Poller(10, 0.2).check(prober_subarray_obsstate) self.midcsp_subarray01.Off() prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Subarray not OFF") Poller(10, 0.2).check(prober_subarray_state) prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY") Poller(10, 0.2).check(prober_subarray_obsstate) receptors = self.midcsp_subarray01.assignedReceptors assert not receptors.any(), f"CSP Subarray is not empty" def test_OffCommand_after_SCAN(self): self._setup_subarray() self._configure_scan() prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.READY, f'CSP Subarray not READY') Poller(10, 0.2).check(prober_subarray_obsstate) self.midcsp_subarray01.Scan('2') prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.SCANNING, f'CSP Subarray not SCANNING') Poller(10, 0.2).check(prober_subarray_obsstate) self.midcsp_subarray01.Off() prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Subarray not OFF") Poller(10, 0.2).check(prober_subarray_state) prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY") Poller(10, 0.2).check(prober_subarray_obsstate) receptors = self.midcsp_subarray01.assignedReceptors assert not receptors.any(), f"CSP Subarray is not empty" def test_OffCommand_after_ABORTED(self): self._setup_subarray() self._assign_receptors() self.midcsp_subarray01.Abort() prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.ABORTED, f'CSP Subarray not ABORTED') Poller(10, 0.2).check(prober_subarray_obsstate) self.midcsp_subarray01.Off() prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Subarray not OFF") Poller(4, 0.2).check(prober_subarray_state) 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 assert not receptors.any(), f"CSP Subarray is not empty" @pytest.mark.fault def test_OffCommand_after_FAULT(self): self._setup_subarray() self._assign_receptors() self.midcsp_subarray01.Configure('{"input":"failed"}') prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.FAULT, f'CSP Subarray not FAULT') Poller(10, 0.2).check(prober_subarray_obsstate) self.midcsp_subarray01.Off() prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Subarray not OFF") Poller(4, 0.2).check(prober_subarray_state) 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 assert not receptors.any(), f"CSP Subarray is not empty" @pytest.mark.csp_k8s def test_add_receptors_WITH_invalid_id(self): """ Test the assignment of a number of invalid receptor IDs to Loading @@ -256,7 +312,6 @@ class TestCspSubarray(TestBase): invalid_receptor_to_assign.append(id_num) if len(invalid_receptor_to_assign) > 3: break param = { 'subarrayID': 1, 'dish': { 'receptorIDList': list(map(str, invalid_receptor_to_assign))}} Loading