diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index dd330dce1226048d59332702870b7601336fcde6..c06e198043a4ff2a787c45f255ee3be21411df6b 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -6,3 +6,6 @@ # black entire repo 4402797422cf9e01687e34786b94cbf2674f05e1 + +#rename "master" to "controller" +8134138fd614b8308dd14a2a9940870f1b2c63cf diff --git a/.release b/.release index b8cad3a06ad5dd71d35dacb6434a2951deba451a..ad32ca72c7bc14aa7e85a5d709a4885b615ac56c 100644 --- a/.release +++ b/.release @@ -1,2 +1,2 @@ -release=0.11.0 -tag=ska_tango_base-0.11.0 +release=0.11.1 +tag=ska_tango_base-0.11.1 diff --git a/README.md b/README.md index 4a4e4d2b74d0fe0bd267f2116c8bf7a97b8cc792..e1a557c1d67e735224d5cdd6e98f7c5336f933e5 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The ska-tango-base repository includes a set of eight classes as mentioned in SK - SKACapability: This is generic base class for any element to provide common functionality of a capability of an SKA device. - SKAAlarmHandler: This is the generic class meant to handle the alarms and alerts. - SKALogger: This is the generic class for logging. -- SKAMaster: This is the generic base class to provide common functionality required for any SKA Element Master device. +- SKAController: This is the generic base class to provide common functionality required for any SKA Element Controller device. - SKAObsDevice: This is the generic base classs meant to provide common functionality of a device which is directly going to be a part of an observation. - SKASubarray: This is the generic base class which provides common functionality required in a subarray device. - SKATelState: This is the generic base class to provide common functionality of a TelState device of any SKA Element. @@ -247,6 +247,9 @@ Tango devices can be launched with a `-v` parameter to set the logging level. Fo ## Version History +#### 0.11.1 +- Minor breaking change: rename of "Master" devices to "Controller" + #### 0.11.0 - Breaking change: state models and component managers - Re-implementation of operational state model to better model diff --git a/docs/source/api/controller_device.rst b/docs/source/api/controller_device.rst new file mode 100644 index 0000000000000000000000000000000000000000..5783cc62bc9269a7b09575c467995c8ec44abb97 --- /dev/null +++ b/docs/source/api/controller_device.rst @@ -0,0 +1,6 @@ +================= +Controller Device +================= + +.. automodule:: ska_tango_base.controller_device + :members: diff --git a/docs/source/api/csp/controller_device.rst b/docs/source/api/csp/controller_device.rst new file mode 100644 index 0000000000000000000000000000000000000000..57ee87a7827f737822d0c605a8310045d255242b --- /dev/null +++ b/docs/source/api/csp/controller_device.rst @@ -0,0 +1,6 @@ +================================ +CSP Subelement Controller device +================================ + +.. automodule:: ska_tango_base.csp.controller_device + :members: diff --git a/docs/source/api/csp/index.rst b/docs/source/api/csp/index.rst index d0da45933e9e73fb17401149b083a6500fdd8433..e7987c7e8ff686f9aa0c0efd1175520b0d6fa4e0 100644 --- a/docs/source/api/csp/index.rst +++ b/docs/source/api/csp/index.rst @@ -17,4 +17,4 @@ CSP subpackage :caption: Other modules :maxdepth: 2 - Master device<master_device> + Controller device<controller_device> diff --git a/docs/source/api/csp/master_device.rst b/docs/source/api/csp/master_device.rst deleted file mode 100644 index 75bdaa7ee7359cd68732a640808820cb37f85327..0000000000000000000000000000000000000000 --- a/docs/source/api/csp/master_device.rst +++ /dev/null @@ -1,6 +0,0 @@ -============================ -CSP Subelement Master device -============================ - -.. automodule:: ska_tango_base.csp.master_device - :members: diff --git a/docs/source/api/index.rst b/docs/source/api/index.rst index 7e57486ff398ed64b98af1bca195e85fd10b1134..fc226495739e260ae76a8428f0a6ba17c88b9fdb 100644 --- a/docs/source/api/index.rst +++ b/docs/source/api/index.rst @@ -19,7 +19,7 @@ API Alarm Handler device<alarm_handler_device> Capability device<capability_device> Logger device<logger_device> - Master device<master_device> + Controller device<controller_device> Tel State device<tel_state_device> diff --git a/docs/source/api/master_device.rst b/docs/source/api/master_device.rst deleted file mode 100644 index ec74fa4c2121398bd6e034620fa664a7daa253c6..0000000000000000000000000000000000000000 --- a/docs/source/api/master_device.rst +++ /dev/null @@ -1,6 +0,0 @@ -============= -Master Device -============= - -.. automodule:: ska_tango_base.master_device - :members: diff --git a/docs/source/guide/getting_started.rst b/docs/source/guide/getting_started.rst index 0b67fedfefddd4108b1a15f5baf9a88ff0b5cba6..0a7c21a228fff047afa3ee60b4de00807bca791b 100644 --- a/docs/source/guide/getting_started.rst +++ b/docs/source/guide/getting_started.rst @@ -231,12 +231,12 @@ Writing the Tango device involves the following steps: ska_tango_base.SKAAlarmHandler ska_tango_base.SKACapability ska_tango_base.SKALogger - ska_tango_base.SKAMaster + ska_tango_base.SKAController ska_tango_base.SKATelState ska_tango_base.base.SKABaseDevice ska_tango_base.obs.SKAObsDevice ska_tango_base.subarray.SKASubarray - ska_tango_base.csp.CspSubElementMaster + ska_tango_base.csp.CspSubElementController ska_tango_base.csp.CspSubElementObsDevice ska_tango_base.csp.CspSubElementSubarray :top-classes: ska_tango_base.base.SKABaseDevice diff --git a/pogo/CspSubElementMaster.xmi b/pogo/CspSubElementController.xmi similarity index 97% rename from pogo/CspSubElementMaster.xmi rename to pogo/CspSubElementController.xmi index ad01e7eea323228cfd805e30a0652767a4fe4cc4..28c32200a8b6420322df2ef8b359294c497a165d 100644 --- a/pogo/CspSubElementMaster.xmi +++ b/pogo/CspSubElementController.xmi @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="ASCII"?> <pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl"> - <classes name="CspSubElementMaster" pogoRevision="9.6"> - <description description="Master device for SKA CSP Subelement." title="CspSubElementMaster" sourcePath="/home/toor/ska-git/ska-tango-base/pogo" language="PythonHL" filestogenerate="XMI file,Code files,Protected Regions" license="BSD3" copyright="" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false"> + <classes name="CspSubElementController" pogoRevision="9.6"> + <description description="Controller device for SKA CSP Subelement." title="CspSubElementController" sourcePath="/home/toor/ska-git/ska-tango-base/pogo" language="PythonHL" filestogenerate="XMI file,Code files,Protected Regions" license="BSD3" copyright="" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false"> <inheritances classname="Device_Impl" sourcePath=""/> <inheritances classname="SKABaseDevice" sourcePath="./"/> - <inheritances classname="SKAMaster" sourcePath="/home/toor/ska-git/ska-tango-base/pogo"/> + <inheritances classname="SKAController" sourcePath="/home/toor/ska-git/ska-tango-base/pogo"/> <identification contact="at inaf.it - elisabetta.giani" author="elisabetta.giani" emailDomain="inaf.it" classFamily="SkaBase" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="none" reference=""/> </description> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="true" concrete="true"/> <DefaultPropValue>4</DefaultPropValue> @@ -129,7 +129,7 @@ </argout> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> </commands> - <commands name="ReInitDevices" description="The exact functionality may vary for different devices 
and sub-systems, each Tango Device/Server
should define what does ReinitDevices means.
Ex:
ReInitDevices FPGA → reset
ReInitDevices Master → Restart
ReInitDevices Leaf PC → reboot" execMethod="re_init_devices" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false"> + <commands name="ReInitDevices" description="The exact functionality may vary for different devices 
and sub-systems, each Tango Device/Server
should define what does ReinitDevices means.
Ex:
ReInitDevices FPGA → reset
ReInitDevices Controller → Restart
ReInitDevices Leaf PC → reboot" execMethod="re_init_devices" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false"> <argin description="List of devices to re-initialize"> <type xsi:type="pogoDsl:StringArrayType"/> </argin> diff --git a/pogo/CspSubElementObsDevice.xmi b/pogo/CspSubElementObsDevice.xmi index e00bcbb9f962d0fe319259d50eb520dc5a7d0887..0ea9648f1f44dbbdfce9eb0867c8c2edffd17e9c 100644 --- a/pogo/CspSubElementObsDevice.xmi +++ b/pogo/CspSubElementObsDevice.xmi @@ -7,7 +7,7 @@ <inheritances classname="SKAObsDevice" sourcePath="/home/toor/ska-git/ska-tango-base/pogo"/> <identification contact="at inaf.it - elisabetta.giani" author="elisabetta.giani" emailDomain="inaf.it" classFamily="SkaBase" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="none" reference=""/> </description> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="true" concrete="true"/> <DefaultPropValue>4</DefaultPropValue> diff --git a/pogo/CspSubElementSubarray.xmi b/pogo/CspSubElementSubarray.xmi index aef57c91833c7c850e05f6d9d05ee550b860f310..9a1242e1d9822c00c6339f7de7ccb2a007592609 100644 --- a/pogo/CspSubElementSubarray.xmi +++ b/pogo/CspSubElementSubarray.xmi @@ -24,7 +24,7 @@ <type xsi:type="pogoDsl:StringVectorType"/> <status abstract="false" inherited="true" concrete="true"/> </deviceProperties> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="true" concrete="true"/> <DefaultPropValue>4</DefaultPropValue> diff --git a/pogo/SKAAlarmHandler.xmi b/pogo/SKAAlarmHandler.xmi index 2a6b5b834bf1268f259d3ce7311ebcb0c7413706..758fd54c5ab00c80b3a6c52e210c0f127b22e9ef 100644 --- a/pogo/SKAAlarmHandler.xmi +++ b/pogo/SKAAlarmHandler.xmi @@ -14,7 +14,7 @@ <type xsi:type="pogoDsl:StringType"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> </deviceProperties> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="true" concrete="true"/> <DefaultPropValue>4</DefaultPropValue> diff --git a/pogo/SKABaseDevice.xmi b/pogo/SKABaseDevice.xmi index 4d5e1f2787a11ae53216d9feada346389a25f82f..b6468605e5622e87f447ac39a7c19bfd7b0e99b5 100644 --- a/pogo/SKABaseDevice.xmi +++ b/pogo/SKABaseDevice.xmi @@ -5,7 +5,7 @@ <inheritances classname="Device_Impl" sourcePath=""/> <identification contact="at ska.ac.za - cam" author="cam" emailDomain="ska.ac.za" classFamily="OtherInstruments" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="SKASA" reference="SKA-SKABaseDevice"/> </description> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <DefaultPropValue>4</DefaultPropValue> diff --git a/pogo/SKACapability.xmi b/pogo/SKACapability.xmi index 0273b3bc7f0a5cd0395f5c55f9d2313af07a814d..d198834d0798d7d368eeb092e253048e335232c3 100644 --- a/pogo/SKACapability.xmi +++ b/pogo/SKACapability.xmi @@ -6,7 +6,7 @@ <inheritances classname="SKAObsDevice" sourcePath="./"/> <identification contact="at ska.ac.za - cam" author="cam" emailDomain="ska.ac.za" classFamily="SkaBase" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="none" reference=""/> </description> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="true" concrete="true"/> <DefaultPropValue>4</DefaultPropValue> diff --git a/pogo/SKAMaster.xmi b/pogo/SKAController.xmi similarity index 97% rename from pogo/SKAMaster.xmi rename to pogo/SKAController.xmi index 4d9a8bdcc72bccbfef674fdd1e6f86ad06216beb..23f632642ccc1f10ec313c4ffa828816121bbedb 100644 --- a/pogo/SKAMaster.xmi +++ b/pogo/SKAController.xmi @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="ASCII"?> <pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl"> - <classes name="SKAMaster" pogoRevision="9.6"> - <description description="A master test" title="SKAMaster" sourcePath="/home/tango/src/ska-tango-base/pogo" language="PythonHL" filestogenerate="XMI file,Code files,Python Package,Protected Regions" license="none" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false"> + <classes name="SKAController" pogoRevision="9.6"> + <description description="A controller test" title="SKAController" sourcePath="/home/tango/src/ska-tango-base/pogo" language="PythonHL" filestogenerate="XMI file,Code files,Python Package,Protected Regions" license="none" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false"> <inheritances classname="Device_Impl" sourcePath=""/> <inheritances classname="SKABaseDevice" sourcePath="./"/> <identification contact="at ska.ac.za - cam" author="cam" emailDomain="ska.ac.za" classFamily="SkaBase" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="none" reference=""/> </description> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="true" concrete="true"/> <DefaultPropValue>4</DefaultPropValue> diff --git a/pogo/SKALogger.xmi b/pogo/SKALogger.xmi index e4ca24ea7a0ef5148d9220adaa469d0346e07590..b569130099561eb9c6e29296a0b85db416757f13 100644 --- a/pogo/SKALogger.xmi +++ b/pogo/SKALogger.xmi @@ -6,7 +6,7 @@ <inheritances classname="SKABaseDevice" sourcePath="./"/> <identification contact="at gmail.com - lochanb.ska" author="lochanb.ska" emailDomain="gmail.com" classFamily="SKA Base Class" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="SKA" reference="SKA-SKALogger"/> </description> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="true" concrete="true"/> <DefaultPropValue>4</DefaultPropValue> diff --git a/pogo/SKAObsDevice.xmi b/pogo/SKAObsDevice.xmi index 1e4a08b052eec4a74762164ec7163ee22aaf8e5f..a13f255fabebddbdca1a4f68ead0b1ddd5281d4e 100644 --- a/pogo/SKAObsDevice.xmi +++ b/pogo/SKAObsDevice.xmi @@ -6,7 +6,7 @@ <inheritances classname="SKABaseDevice" sourcePath="./"/> <identification contact="at ska.ac.za - cam" author="cam" emailDomain="ska.ac.za" classFamily="OtherInstruments" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="SKASA" reference="SKA-SKAObsDevice"/> </description> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="true" concrete="true"/> <DefaultPropValue>4</DefaultPropValue> diff --git a/pogo/SKASubarray.xmi b/pogo/SKASubarray.xmi index b4f607491a71427a0aecdd7f87701aafd9ea2c8d..1d21f74d37a2889d45f5d4508bac04fdc79d7d6d 100644 --- a/pogo/SKASubarray.xmi +++ b/pogo/SKASubarray.xmi @@ -23,7 +23,7 @@ <type xsi:type="pogoDsl:StringVectorType"/> <status abstract="false" inherited="true" concrete="true"/> </deviceProperties> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="true" concrete="true"/> <DefaultPropValue>4</DefaultPropValue> diff --git a/pogo/SKATelState.xmi b/pogo/SKATelState.xmi index 5c3716d0bbd631ff69d425646c72776bb6690615..498c045f011d33d206393827dc326d60c47980a3 100644 --- a/pogo/SKATelState.xmi +++ b/pogo/SKATelState.xmi @@ -10,7 +10,7 @@ <type xsi:type="pogoDsl:StringType"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> </deviceProperties> - <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltController, EltAlarms, EltTelState = 1
SubEltController = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> <type xsi:type="pogoDsl:ShortType"/> <status abstract="false" inherited="true" concrete="true"/> <DefaultPropValue>4</DefaultPropValue> diff --git a/scripts/purge_xmi_tree.py b/scripts/purge_xmi_tree.py index 90c728c7904640e4b2ed3296ae3503f84d51a067..621846261253d522fa54e2f0770791073bb421de 100755 --- a/scripts/purge_xmi_tree.py +++ b/scripts/purge_xmi_tree.py @@ -4,8 +4,8 @@ Utility to purge orphaned elements from the XMI file tree. The base classes have a hierarchy. If the API in a parent device is changed (e.g., removing a command from SKABaseDevice), child classes, -e.g., SKAMaster, need to change too. However, after regenerating the -Pogo XMI file for SKAMaster, it will still have the old command in its +e.g., SKAController, need to change too. However, after regenerating the +Pogo XMI file for SKAController, it will still have the old command in its XMI file, even though it no longer exists in the parent. This tool runs through all the XMI files and find elements that are marked as "inherited", but no longer exist higher up in the hierarchy. diff --git a/setup.py b/setup.py index 6a8425260745ff5adff921c62cca8d3e350f5797..d544c2ea40a484885142781d5ea275aa8301a55f 100644 --- a/setup.py +++ b/setup.py @@ -50,11 +50,11 @@ setuptools.setup( "SKACapability=ska_tango_base.capability_device:main", "SKAExampleDevice=ska_tango_base.example_device:main", "SKALogger=ska_tango_base.logger_device:main", - "SKAMaster=ska_tango_base.master_device:main", + "SKAController=ska_tango_base.controller_device:main", "SKAObsDevice=ska_tango_base.obs.obs_device:main", "SKASubarray=ska_tango_base.subarray.subarray_device:main", "SKATelState=ska_tango_base.tel_state_device:main", - "CspSubelementMaster=ska_tango_base.csp_subelement_master:main", + "CspSubelementController=ska_tango_base.csp_subelement_controller:main", "CspSubelementObsDevice=ska_tango_base.csp_subelement_obsdevice:main", "CspSubelementSubarray=ska_tango_base.csp_subelement_subarray:main", ] diff --git a/src/ska_tango_base/__init__.py b/src/ska_tango_base/__init__.py index 58b441bbf97cc358dc1d5cc7663faadcfe42a3a5..cbc93f80c682d0fa7d04cf8fc0706abfad041ff0 100644 --- a/src/ska_tango_base/__init__.py +++ b/src/ska_tango_base/__init__.py @@ -15,11 +15,11 @@ __all__ = ( "SKABaseDevice", "SKACapability", "SKALogger", - "SKAMaster", + "SKAController", "SKAObsDevice", "SKASubarray", "SKATelState", - "CspSubElementMaster", + "CspSubElementController", "CspSubElementObsDevice", "CspSubElementSubarray", ) @@ -30,7 +30,7 @@ __all__ = ( from .base import SKABaseDevice from .alarm_handler_device import SKAAlarmHandler from .logger_device import SKALogger -from .master_device import SKAMaster +from .controller_device import SKAController from .tel_state_device import SKATelState # SKAObsDevice, and then classes that inherit from it @@ -39,6 +39,6 @@ from .capability_device import SKACapability from .subarray import SKASubarray # CspSubElement classes -from .csp import CspSubElementMaster +from .csp import CspSubElementController from .csp import CspSubElementSubarray from .csp import CspSubElementObsDevice diff --git a/src/ska_tango_base/master_device.py b/src/ska_tango_base/controller_device.py similarity index 74% rename from src/ska_tango_base/master_device.py rename to src/ska_tango_base/controller_device.py index c6c85943d65e4006ce2d2417578a5636d25468dc..c8ec813f7d8e17fb2aa26668e25f051be6560c22 100644 --- a/src/ska_tango_base/master_device.py +++ b/src/ska_tango_base/controller_device.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- # -# This file is part of the SKAMaster project +# This file is part of the SKAController project # # # -""" SKAMaster +""" SKAController -Master device +Controller device """ -# PROTECTED REGION ID(SKAMaster.additionnal_import) ENABLED START # +# PROTECTED REGION ID(SKAController.additionnal_import) ENABLED START # # Tango imports from tango import DebugIt from tango.server import run, attribute, command, device_property @@ -24,14 +24,14 @@ from ska_tango_base.utils import ( ) -# PROTECTED REGION END # // SKAMaster.additionnal_imports +# PROTECTED REGION END # // SKAController.additionnal_imports -__all__ = ["SKAMaster", "main"] +__all__ = ["SKAController", "main"] -class SKAMaster(SKABaseDevice): +class SKAController(SKABaseDevice): """ - Master device + Controller device """ def init_command_objects(self): @@ -46,7 +46,7 @@ class SKAMaster(SKABaseDevice): class InitCommand(SKABaseDevice.InitCommand): """ - A class for the SKAMaster's init_device() "command". + A class for the SKAController's init_device() "command". """ def do(self): @@ -79,12 +79,12 @@ class SKAMaster(SKABaseDevice): ) device._available_capabilities = device._max_capabilities.copy() - message = "SKAMaster Init command completed OK" + message = "SKAController Init command completed OK" self.logger.info(message) return (ResultCode.OK, message) - # PROTECTED REGION ID(SKAMaster.class_variable) ENABLED START # - # PROTECTED REGION END # // SKAMaster.class_variable + # PROTECTED REGION ID(SKAController.class_variable) ENABLED START # + # PROTECTED REGION END # // SKAController.class_variable # ----------------- # Device Properties @@ -148,54 +148,54 @@ class SKAMaster(SKABaseDevice): # --------------- def always_executed_hook(self): - # PROTECTED REGION ID(SKAMaster.always_executed_hook) ENABLED START # + # PROTECTED REGION ID(SKAController.always_executed_hook) ENABLED START # pass - # PROTECTED REGION END # // SKAMaster.always_executed_hook + # PROTECTED REGION END # // SKAController.always_executed_hook def delete_device(self): - # PROTECTED REGION ID(SKAMaster.delete_device) ENABLED START # + # PROTECTED REGION ID(SKAController.delete_device) ENABLED START # pass - # PROTECTED REGION END # // SKAMaster.delete_device + # PROTECTED REGION END # // SKAController.delete_device # ------------------ # Attributes methods # ------------------ def read_elementLoggerAddress(self): - # PROTECTED REGION ID(SKAMaster.elementLoggerAddress_read) ENABLED START # + # PROTECTED REGION ID(SKAController.elementLoggerAddress_read) ENABLED START # """Reads FQDN of Element Logger device""" return self._element_logger_address - # PROTECTED REGION END # // SKAMaster.elementLoggerAddress_read + # PROTECTED REGION END # // SKAController.elementLoggerAddress_read def read_elementAlarmAddress(self): - # PROTECTED REGION ID(SKAMaster.elementAlarmAddress_read) ENABLED START # + # PROTECTED REGION ID(SKAController.elementAlarmAddress_read) ENABLED START # """Reads FQDN of Element Alarm device""" return self._element_alarm_address - # PROTECTED REGION END # // SKAMaster.elementAlarmAddress_read + # PROTECTED REGION END # // SKAController.elementAlarmAddress_read def read_elementTelStateAddress(self): - # PROTECTED REGION ID(SKAMaster.elementTelStateAddress_read) ENABLED START # + # PROTECTED REGION ID(SKAController.elementTelStateAddress_read) ENABLED START # """Reads FQDN of Element TelState device""" return self._element_tel_state_address - # PROTECTED REGION END # // SKAMaster.elementTelStateAddress_read + # PROTECTED REGION END # // SKAController.elementTelStateAddress_read def read_elementDatabaseAddress(self): - # PROTECTED REGION ID(SKAMaster.elementDatabaseAddress_read) ENABLED START # + # PROTECTED REGION ID(SKAController.elementDatabaseAddress_read) ENABLED START # """Reads FQDN of Element Database device""" return self._element_database_address - # PROTECTED REGION END # // SKAMaster.elementDatabaseAddress_read + # PROTECTED REGION END # // SKAController.elementDatabaseAddress_read def read_maxCapabilities(self): - # PROTECTED REGION ID(SKAMaster.maxCapabilities_read) ENABLED START # + # PROTECTED REGION ID(SKAController.maxCapabilities_read) ENABLED START # """Reads maximum number of instances of each capability type""" return convert_dict_to_list(self._max_capabilities) - # PROTECTED REGION END # // SKAMaster.maxCapabilities_read + # PROTECTED REGION END # // SKAController.maxCapabilities_read def read_availableCapabilities(self): - # PROTECTED REGION ID(SKAMaster.availableCapabilities_read) ENABLED START # + # PROTECTED REGION ID(SKAController.availableCapabilities_read) ENABLED START # """Reads list of available number of instances of each capability type""" return convert_dict_to_list(self._available_capabilities) - # PROTECTED REGION END # // SKAMaster.availableCapabilities_read + # PROTECTED REGION END # // SKAController.availableCapabilities_read # -------- # Commands @@ -203,7 +203,7 @@ class SKAMaster(SKABaseDevice): class IsCapabilityAchievableCommand(BaseCommand): """ - A class for the SKAMaster's IsCapabilityAchievable() command. + A class for the SKAController's IsCapabilityAchievable() command. """ def do(self, argin): @@ -238,7 +238,7 @@ class SKAMaster(SKABaseDevice): ) @DebugIt() def isCapabilityAchievable(self, argin): - # PROTECTED REGION ID(SKAMaster.isCapabilityAchievable) ENABLED START # + # PROTECTED REGION ID(SKAController.isCapabilityAchievable) ENABLED START # """ Checks of provided capabilities can be achieved by the resource(s). @@ -257,16 +257,16 @@ class SKAMaster(SKABaseDevice): """ command = self.get_command_object("IsCapabilityAchievable") return command(argin) - # PROTECTED REGION END # // SKAMaster.isCapabilityAchievable + # PROTECTED REGION END # // SKAController.isCapabilityAchievable # ---------- # Run server # ---------- def main(args=None, **kwargs): - # PROTECTED REGION ID(SKAMaster.main) ENABLED START # - return run((SKAMaster,), args=args, **kwargs) - # PROTECTED REGION END # // SKAMaster.main + # PROTECTED REGION ID(SKAController.main) ENABLED START # + return run((SKAController,), args=args, **kwargs) + # PROTECTED REGION END # // SKAController.main if __name__ == "__main__": diff --git a/src/ska_tango_base/csp/__init__.py b/src/ska_tango_base/csp/__init__.py index d2fbc2fba3d565184182be7c395583ad9a018b73..2aabb983d234ae4634670365eadb287d0838a0a9 100644 --- a/src/ska_tango_base/csp/__init__.py +++ b/src/ska_tango_base/csp/__init__.py @@ -8,12 +8,12 @@ __all__ = ( "CspSubarrayComponentManager", "ReferenceCspObsComponentManager", "ReferenceCspSubarrayComponentManager", - "CspSubElementMaster", + "CspSubElementController", "CspSubElementObsDevice", "CspSubElementSubarray", ) -from .master_device import CspSubElementMaster +from .controller_device import CspSubElementController from .obs import ( CspSubElementObsStateModel, diff --git a/src/ska_tango_base/csp/master_device.py b/src/ska_tango_base/csp/controller_device.py similarity index 79% rename from src/ska_tango_base/csp/master_device.py rename to src/ska_tango_base/csp/controller_device.py index 10bdd82599c0a5193aa568d258c53240668f88b9..d711d5bc41a44057f4f3a6f14f5ae8cd88afc801 100644 --- a/src/ska_tango_base/csp/master_device.py +++ b/src/ska_tango_base/csp/controller_device.py @@ -1,17 +1,17 @@ # -*- coding: utf-8 -*- # -# This file is part of the CspSubElementMaster project +# This file is part of the CspSubElementController project # # # # Distributed under the terms of the GPL license. # See LICENSE.txt for more info. -""" CspSubElementMaster +""" CspSubElementController -Master device for SKA CSP Subelement. +Controller device for SKA CSP Subelement. """ -# PROTECTED REGION ID(CspSubElementMaster.additionnal_import) ENABLED START # +# PROTECTED REGION ID(CspSubElementController.additionnal_import) ENABLED START # # Python standard library from collections import defaultdict @@ -22,19 +22,19 @@ from tango.server import run, attribute, command, device_property # SKA specific imports -from ska_tango_base import SKAMaster +from ska_tango_base import SKAController from ska_tango_base.commands import ResultCode, ResponseCommand, StateModelCommand from ska_tango_base.control_model import AdminMode from ska_tango_base.faults import CommandError -# PROTECTED REGION END # // CspSubElementMaster.additionnal_import +# PROTECTED REGION END # // CspSubElementController.additionnal_import -__all__ = ["CspSubElementMaster", "main"] +__all__ = ["CspSubElementController", "main"] -class CspSubElementMaster(SKAMaster): +class CspSubElementController(SKAController): """ - Master device for SKA CSP Subelement. + Controller device for SKA CSP Subelement. **Properties:** @@ -48,8 +48,8 @@ class CspSubElementMaster(SKAMaster): - Type:'DevFloat' """ - # PROTECTED REGION ID(CspSubElementMaster.class_variable) ENABLED START # - # PROTECTED REGION END # // CspSubElementMaster.class_variable + # PROTECTED REGION ID(CspSubElementController.class_variable) ENABLED START # + # PROTECTED REGION END # // CspSubElementController.class_variable # ----------------- # Device Properties @@ -219,9 +219,9 @@ class CspSubElementMaster(SKAMaster): "ReInitDevices", self.ReInitDevicesCommand(*device_args) ) - class InitCommand(SKAMaster.InitCommand): + class InitCommand(SKAController.InitCommand): """ - A class for the CspSubElementMaster's init_device() "command". + A class for the CspSubElementController's init_device() "command". """ def do(self): @@ -261,14 +261,14 @@ class CspSubElementMaster(SKAMaster): device._power_delay_standy_on = device.PowerDelayStandbyOn device._power_delay_standy_off = device.PowerDelayStandbyOff - message = "CspSubElementMaster Init command completed OK" + message = "CspSubElementController Init command completed OK" device.logger.info(message) return (ResultCode.OK, message) def always_executed_hook(self): """Method always executed before any Tango command is executed.""" - # PROTECTED REGION ID(CspSubElementMaster.always_executed_hook) ENABLED START # - # PROTECTED REGION END # // CspSubElementMaster.always_executed_hook + # PROTECTED REGION ID(CspSubElementController.always_executed_hook) ENABLED START # + # PROTECTED REGION END # // CspSubElementController.always_executed_hook def delete_device(self): """Hook to delete resources allocated in init_device. @@ -277,138 +277,138 @@ class CspSubElementMaster(SKAMaster): init_device method to be released. This method is called by the device destructor and by the device Init command. """ - # PROTECTED REGION ID(CspSubElementMaster.delete_device) ENABLED START # - # PROTECTED REGION END # // CspSubElementMaster.delete_device + # PROTECTED REGION ID(CspSubElementController.delete_device) ENABLED START # + # PROTECTED REGION END # // CspSubElementController.delete_device # ------------------ # Attributes methods # ------------------ def read_powerDelayStandbyOn(self): - # PROTECTED REGION ID(CspSubElementMaster.powerDelayStandbyOn_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.powerDelayStandbyOn_read) ENABLED START # """Return the powerDelayStandbyOn attribute.""" return self._power_delay_standy_on - # PROTECTED REGION END # // CspSubElementMaster.powerDelayStandbyOn_read + # PROTECTED REGION END # // CspSubElementController.powerDelayStandbyOn_read def write_powerDelayStandbyOn(self, value): - # PROTECTED REGION ID(CspSubElementMaster.powerDelayStandbyOn_write) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.powerDelayStandbyOn_write) ENABLED START # """Set the powerDelayStandbyOn attribute.""" self._power_delay_standy_on = value - # PROTECTED REGION END # // CspSubElementMaster.powerDelayStandbyOn_write + # PROTECTED REGION END # // CspSubElementController.powerDelayStandbyOn_write def read_onProgress(self): - # PROTECTED REGION ID(CspSubElementMaster.onProgress_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.onProgress_read) ENABLED START # """Return the onProgress attribute.""" return self._cmd_progress["on"] - # PROTECTED REGION END # // CspSubElementMaster.onProgress_read + # PROTECTED REGION END # // CspSubElementController.onProgress_read def read_onMaximumDuration(self): - # PROTECTED REGION ID(CspSubElementMaster.onMaximumDuration_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.onMaximumDuration_read) ENABLED START # """Return the onMaximumDuration attribute.""" return self._cmd_maximum_duration["on"] - # PROTECTED REGION END # // CspSubElementMaster.onMaximumDuration_read + # PROTECTED REGION END # // CspSubElementController.onMaximumDuration_read def write_onMaximumDuration(self, value): - # PROTECTED REGION ID(CspSubElementMaster.onMaximumDuration_write) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.onMaximumDuration_write) ENABLED START # """Set the onMaximumDuration attribute.""" self._cmd_maximum_duration["on"] = value - # PROTECTED REGION END # // CspSubElementMaster.onMaximumDuration_write + # PROTECTED REGION END # // CspSubElementController.onMaximumDuration_write def read_onMeasuredDuration(self): - # PROTECTED REGION ID(CspSubElementMaster.onMeasuredDuration_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.onMeasuredDuration_read) ENABLED START # """Return the onMeasuredDuration attribute.""" return self._cmd_measured_duration["on"] - # PROTECTED REGION END # // CspSubElementMaster.onMeasuredDuration_read + # PROTECTED REGION END # // CspSubElementController.onMeasuredDuration_read def read_standbyProgress(self): - # PROTECTED REGION ID(CspSubElementMaster.standbyProgress_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.standbyProgress_read) ENABLED START # """Return the standbyProgress attribute.""" return self._cmd_progress["standby"] - # PROTECTED REGION END # // CspSubElementMaster.standbyProgress_read + # PROTECTED REGION END # // CspSubElementController.standbyProgress_read def read_standbyMaximumDuration(self): - # PROTECTED REGION ID(CspSubElementMaster.standbyMaximumDuration_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.standbyMaximumDuration_read) ENABLED START # """Return the standbyMaximumDuration attribute.""" return self._cmd_maximum_duration["standby"] - # PROTECTED REGION END # // CspSubElementMaster.standbyMaximumDuration_read + # PROTECTED REGION END # // CspSubElementController.standbyMaximumDuration_read def write_standbyMaximumDuration(self, value): - # PROTECTED REGION ID(CspSubElementMaster.standbyMaximumDuration_write) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.standbyMaximumDuration_write) ENABLED START # """Set the standbyMaximumDuration attribute.""" self._cmd_maximum_duration["standby"] = value - # PROTECTED REGION END # // CspSubElementMaster.standbyMaximumDuration_write + # PROTECTED REGION END # // CspSubElementController.standbyMaximumDuration_write def read_standbyMeasuredDuration(self): - # PROTECTED REGION ID(CspSubElementMaster.standbyMeasuredDuration_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.standbyMeasuredDuration_read) ENABLED START # """Return the standbyMeasuredDuration attribute.""" return self._cmd_measured_duration["standby"] - # PROTECTED REGION END # // CspSubElementMaster.standbyMeasuredDuration_read + # PROTECTED REGION END # // CspSubElementController.standbyMeasuredDuration_read def read_offProgress(self): - # PROTECTED REGION ID(CspSubElementMaster.offProgress_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.offProgress_read) ENABLED START # """Return the offProgress attribute.""" return self._cmd_progress["off"] - # PROTECTED REGION END # // CspSubElementMaster.offProgress_read + # PROTECTED REGION END # // CspSubElementController.offProgress_read def read_offMaximumDuration(self): - # PROTECTED REGION ID(CspSubElementMaster.offMaximumDuration_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.offMaximumDuration_read) ENABLED START # """Return the offMaximumDuration attribute.""" return self._cmd_maximum_duration["off"] - # PROTECTED REGION END # // CspSubElementMaster.offMaximumDuration_read + # PROTECTED REGION END # // CspSubElementController.offMaximumDuration_read def write_offMaximumDuration(self, value): - # PROTECTED REGION ID(CspSubElementMaster.offMaximumDuration_write) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.offMaximumDuration_write) ENABLED START # """Set the offMaximumDuration attribute.""" self._cmd_maximum_duration["off"] = value - # PROTECTED REGION END # // CspSubElementMaster.offMaximumDuration_write + # PROTECTED REGION END # // CspSubElementController.offMaximumDuration_write def read_offMeasuredDuration(self): - # PROTECTED REGION ID(CspSubElementMaster.offMeasuredDuration_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.offMeasuredDuration_read) ENABLED START # """Return the offMeasuredDuration attribute.""" return self._cmd_measured_duration["off"] - # PROTECTED REGION END # // CspSubElementMaster.offMeasuredDuration_read + # PROTECTED REGION END # // CspSubElementController.offMeasuredDuration_read def read_totalOutputDataRateToSdp(self): - # PROTECTED REGION ID(CspSubElementMaster.totalOutputDataRateToSdp_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.totalOutputDataRateToSdp_read) ENABLED START # """Return the totalOutputDataRateToSdp attribute.""" return self._total_output_rate_to_sdp - # PROTECTED REGION END # // CspSubElementMaster.totalOutputDataRateToSdp_read + # PROTECTED REGION END # // CspSubElementController.totalOutputDataRateToSdp_read def read_powerDelayStandbyOff(self): - # PROTECTED REGION ID(CspSubElementMaster.powerDelayStandbyOff_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.powerDelayStandbyOff_read) ENABLED START # """Return the powerDelayStandbyOff attribute.""" return self._power_delay_standy_off - # PROTECTED REGION END # // CspSubElementMaster.powerDelayStandbyOff_read + # PROTECTED REGION END # // CspSubElementController.powerDelayStandbyOff_read def write_powerDelayStandbyOff(self, value): - # PROTECTED REGION ID(CspSubElementMaster.powerDelayStandbyOff_write) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.powerDelayStandbyOff_write) ENABLED START # """Set the powerDelayStandbyOff attribute.""" self._power_delay_standy_off = value - # PROTECTED REGION END # // CspSubElementMaster.powerDelayStandbyOff_write + # PROTECTED REGION END # // CspSubElementController.powerDelayStandbyOff_write def read_loadFirmwareProgress(self): - # PROTECTED REGION ID(CspSubElementMaster.loadFirmwareProgress_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.loadFirmwareProgress_read) ENABLED START # """Return the loadFirmwareProgress attribute.""" return self._cmd_progress["loadfirmware"] - # PROTECTED REGION END # // CspSubElementMaster.loadFirmwareProgress_read + # PROTECTED REGION END # // CspSubElementController.loadFirmwareProgress_read def read_loadFirmwareMaximumDuration(self): - # PROTECTED REGION ID(CspSubElementMaster.loadFirmwareMaximumDuration_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.loadFirmwareMaximumDuration_read) ENABLED START # """Return the loadFirmwareMaximumDuration attribute.""" return self._cmd_maximum_duration["loadfirmware"] - # PROTECTED REGION END # // CspSubElementMaster.loadFirmwareMaximumDuration_read + # PROTECTED REGION END # // CspSubElementController.loadFirmwareMaximumDuration_read def write_loadFirmwareMaximumDuration(self, value): - # PROTECTED REGION ID(CspSubElementMaster.loadFirmwareMaximumDuration_write) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.loadFirmwareMaximumDuration_write) ENABLED START # """Set the loadFirmwareMaximumDuration attribute.""" self._cmd_maximum_duration["loadfirmware"] = value - # PROTECTED REGION END # // CspSubElementMaster.loadFirmwareMaximumDuration_write + # PROTECTED REGION END # // CspSubElementController.loadFirmwareMaximumDuration_write def read_loadFirmwareMeasuredDuration(self): - # PROTECTED REGION ID(CspSubElementMaster.loadFirmwareMeasuredDuration_read) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.loadFirmwareMeasuredDuration_read) ENABLED START # """Return the loadFirmwareMeasuredDuration attribute.""" return self._cmd_measured_duration["loadfirmware"] - # PROTECTED REGION END # // CspSubElementMaster.loadFirmwareMeasuredDuration_read + # PROTECTED REGION END # // CspSubElementController.loadFirmwareMeasuredDuration_read # -------- # Commands @@ -463,7 +463,7 @@ class CspSubElementMaster(SKAMaster): """ Check if the command is in the proper state (State/adminMode) to be executed. - The master device has to be in OFF/MAINTENACE to process the + The controller device has to be in OFF/MAINTENACE to process the LoadFirmware command. :param raise_if_disallowed: whether to raise an error or @@ -488,7 +488,7 @@ class CspSubElementMaster(SKAMaster): class PowerOnDevicesCommand(StateModelCommand, ResponseCommand): """ - A class for the CspSubElementMaster's PowerOnDevices command. + A class for the CspSubElementController's PowerOnDevices command. """ def __init__(self, target, op_state_model, *args, logger=None, **kwargs): @@ -513,7 +513,7 @@ class CspSubElementMaster(SKAMaster): def is_allowed(self, raise_if_disallowed=False): """ Check if the command is in the proper state to be executed. - The master device has to be in ON to process the + The controller device has to be in ON to process the PowerOnDevices command. :param raise_if_disallowed: whether to raise an error or @@ -533,7 +533,7 @@ class CspSubElementMaster(SKAMaster): class PowerOffDevicesCommand(StateModelCommand, ResponseCommand): """ - A class for the CspSubElementMaster's PowerOffDevices command. + A class for the CspSubElementController's PowerOffDevices command. """ def __init__(self, target, op_state_model, *args, logger=None, **kwargs): @@ -558,7 +558,7 @@ class CspSubElementMaster(SKAMaster): def is_allowed(self, raise_if_disallowed=False): """ Check if the command is in the proper state to be executed. - The master device has to be in ON to process the + The controller device has to be in ON to process the PowerOffDevices command. :param raise_if_disallowed: whether to raise an error or @@ -578,7 +578,7 @@ class CspSubElementMaster(SKAMaster): class ReInitDevicesCommand(StateModelCommand, ResponseCommand): """ - A class for the CspSubElementMaster's ReInitDevices command. + A class for the CspSubElementController's ReInitDevices command. """ def __init__(self, target, op_state_model, *args, logger=None, **kwargs): @@ -603,7 +603,7 @@ class CspSubElementMaster(SKAMaster): def is_allowed(self, raise_if_disallowed=False): """ Check if the command is in the proper state to be executed. - The master device has to be in ON to process the + The controller device has to be in ON to process the ReInitDevices command. :param raise_if_disallowed: whether to raise an error or @@ -641,7 +641,7 @@ class CspSubElementMaster(SKAMaster): ) @DebugIt() def LoadFirmware(self, argin): - # PROTECTED REGION ID(CspSubElementMaster.LoadFirmware) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.LoadFirmware) ENABLED START # """ Deploy new versions of software and firmware and trigger a restart so that a Component initializes using a newly @@ -662,7 +662,7 @@ class CspSubElementMaster(SKAMaster): command = self.get_command_object("LoadFirmware") (return_code, message) = command(argin) return [[return_code], [message]] - # PROTECTED REGION END # // CspSubElementMaster.LoadFirmware + # PROTECTED REGION END # // CspSubElementController.LoadFirmware def is_PowerOnDevices_allowed(self): """ @@ -683,7 +683,7 @@ class CspSubElementMaster(SKAMaster): ) @DebugIt() def PowerOnDevices(self, argin): - # PROTECTED REGION ID(CspSubElementMaster.PowerOnDevices) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.PowerOnDevices) ENABLED START # """ Power-on a selected list of devices. @@ -698,7 +698,7 @@ class CspSubElementMaster(SKAMaster): command = self.get_command_object("PowerOnDevices") (return_code, message) = command(argin) return [[return_code], [message]] - # PROTECTED REGION END # // CspSubElementMaster.PowerOnDevices + # PROTECTED REGION END # // CspSubElementController.PowerOnDevices def is_PowerOffDevices_allowed(self): """ @@ -719,7 +719,7 @@ class CspSubElementMaster(SKAMaster): ) @DebugIt() def PowerOffDevices(self, argin): - # PROTECTED REGION ID(CspSubElementMaster.PowerOffDevices) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.PowerOffDevices) ENABLED START # """ Power-off a selected list of devices. @@ -735,7 +735,7 @@ class CspSubElementMaster(SKAMaster): (return_code, message) = command(argin) return [[return_code], [message]] - # PROTECTED REGION END # // CspSubElementMaster.PowerOffDevices + # PROTECTED REGION END # // CspSubElementController.PowerOffDevices def is_ReInitDevices_allowed(self): """ @@ -756,7 +756,7 @@ class CspSubElementMaster(SKAMaster): ) @DebugIt() def ReInitDevices(self, argin): - # PROTECTED REGION ID(CspSubElementMaster.ReInitDevices) ENABLED START # + # PROTECTED REGION ID(CspSubElementController.ReInitDevices) ENABLED START # """ Reinitialize the devices passed in the input argument. The exact functionality may vary for different devices @@ -764,7 +764,7 @@ class CspSubElementMaster(SKAMaster): what does ReInitDevices means. Ex: ReInitDevices FPGA -> reset - ReInitDevices Master -> Restart + ReInitDevices Controller -> Restart ReInitDevices Leaf PC -> reboot :param argin: List of devices (FQDNs) to re-initialize. @@ -778,7 +778,7 @@ class CspSubElementMaster(SKAMaster): command = self.get_command_object("ReInitDevices") (return_code, message) = command(argin) return [[return_code], [message]] - # PROTECTED REGION END # // CspSubElementMaster.ReInitDevices + # PROTECTED REGION END # // CspSubElementController.ReInitDevices # ---------- @@ -788,16 +788,16 @@ class CspSubElementMaster(SKAMaster): def main(args=None, **kwargs): """ - Entry point for the CspSubElementMaster module. + Entry point for the CspSubElementController module. :param args: str :param kwargs: str :return: exit code """ - # PROTECTED REGION ID(CspSubElementMaster.main) ENABLED START # - return run((CspSubElementMaster,), args=args, **kwargs) - # PROTECTED REGION END # // CspSubElementMaster.main + # PROTECTED REGION ID(CspSubElementController.main) ENABLED START # + return run((CspSubElementController,), args=args, **kwargs) + # PROTECTED REGION END # // CspSubElementController.main if __name__ == "__main__": diff --git a/src/ska_tango_base/release.py b/src/ska_tango_base/release.py index 3c3cc0aa4a425aba06fc35ad234eab21f81c1a32..63494f37884de2dd989092ed17442429e438cb99 100644 --- a/src/ska_tango_base/release.py +++ b/src/ska_tango_base/release.py @@ -7,7 +7,7 @@ """Release information for ska_tango_base Python Package""" name = """ska_tango_base""" -version = "0.11.0" +version = "0.11.1" version_info = version.split(".") description = """A set of generic base devices for SKA Telescope.""" author = "SKA India and SARAO and CSIRO and INAF" diff --git a/tests/test_controller_device.py b/tests/test_controller_device.py new file mode 100644 index 0000000000000000000000000000000000000000..c12e55cd06858298ca901465e4f0517e7498e394 --- /dev/null +++ b/tests/test_controller_device.py @@ -0,0 +1,233 @@ +######################################################################################### +# -*- coding: utf-8 -*- +# +# This file is part of the SKAController project +# +# +# +######################################################################################### +"""Contain the tests for the SKAController.""" + +import re +import pytest +from tango import DevState + +# PROTECTED REGION ID(SKAController.test_additional_imports) ENABLED START # +from ska_tango_base import SKAController +from ska_tango_base.base import ReferenceBaseComponentManager +from ska_tango_base.control_model import ( + AdminMode, + ControlMode, + HealthState, + SimulationMode, + TestMode, +) + +# PROTECTED REGION END # // SKAController.test_additional_imports + + +# PROTECTED REGION ID(SKAController.test_SKAController_decorators) ENABLED START # +@pytest.mark.usefixtures("tango_context") +# PROTECTED REGION END # // SKAController.test_SKAController_decorators +class TestSKAController(object): + """ + Test class for tests of the SKAController device class. + """ + + # capabilities = ['BAND1:1', 'BAND2:1', 'BAND3:0', 'BAND4:0', 'BAND5:0'] + + @pytest.fixture(scope="class") + def device_properties(self): + """ + Fixture that returns device_properties to be provided to the + device under test. + """ + return { + "SkaLevel": "4", + "LoggingTargetsDefault": "", + "GroupDefinitions": "", + "NrSubarrays": "16", + "CapabilityTypes": "", + "MaxCapabilities": ["BAND1:1", "BAND2:1"], + } + + @pytest.fixture(scope="class") + def device_test_config(self, device_properties): + """ + Fixture that specifies the device to be tested, along with its + properties and memorized attributes. + + This implementation provides a concrete subclass of the device + class under test, some properties, and a memorized value for + adminMode. + """ + return { + "device": SKAController, + "component_manager_patch": lambda self: ReferenceBaseComponentManager( + self.op_state_model, logger=self.logger + ), + "properties": device_properties, + "memorized": {"adminMode": str(AdminMode.ONLINE.value)}, + } + + @pytest.mark.skip("Not implemented") + def test_properties(self, tango_context): + # Test the properties + # PROTECTED REGION ID(SKAController.test_properties) ENABLED START # + # PROTECTED REGION END # // SKAController.test_properties + pass + + # PROTECTED REGION ID(SKAController.test_State_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_State_decorators + def test_State(self, tango_context): + """Test for State""" + # PROTECTED REGION ID(SKAController.test_State) ENABLED START # + assert tango_context.device.State() == DevState.OFF + # PROTECTED REGION END # // SKAController.test_State + + # PROTECTED REGION ID(SKAController.test_Status_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_Status_decorators + def test_Status(self, tango_context): + """Test for Status""" + # PROTECTED REGION ID(SKAController.test_Status) ENABLED START # + assert tango_context.device.Status() == "The device is in OFF state." + # PROTECTED REGION END # // SKAController.test_Status + + # PROTECTED REGION ID(SKAController.test_GetVersionInfo_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_GetVersionInfo_decorators + def test_GetVersionInfo(self, tango_context): + """Test for GetVersionInfo""" + # PROTECTED REGION ID(SKAController.test_GetVersionInfo) ENABLED START # + versionPattern = re.compile( + f"{tango_context.device.info().dev_class}, ska_tango_base, [0-9]+.[0-9]+.[0-9]+, " + "A set of generic base devices for SKA Telescope." + ) + versionInfo = tango_context.device.GetVersionInfo() + assert (re.match(versionPattern, versionInfo[0])) is not None + # PROTECTED REGION END # // SKAController.test_GetVersionInfo + + # PROTECTED REGION ID(SKAController.test_isCapabilityAchievable_failure_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_isCapabilityAchievable_failure_decorators + def test_isCapabilityAchievable_failure(self, tango_context): + """Test for isCapabilityAchievable to test failure condition""" + # PROTECTED REGION ID(SKAController.test_isCapabilityAchievable_failure) ENABLED START # + assert tango_context.device.isCapabilityAchievable([[2], ["BAND1"]]) is False + # PROTECTED REGION END # // SKAController.test_isCapabilityAchievable_failure + + # PROTECTED REGION ID(SKAController.test_isCapabilityAchievable_success_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_isCapabilityAchievable_success_decorators + + def test_isCapabilityAchievable_success(self, tango_context): + """Test for isCapabilityAchievable to test success condition""" + # PROTECTED REGION ID(SKAController.test_isCapabilityAchievable_success) ENABLED START # + assert tango_context.device.isCapabilityAchievable([[1], ["BAND1"]]) is True + # PROTECTED REGION END # // SKAController.test_isCapabilityAchievable_success + + # PROTECTED REGION ID(SKAController.test_elementLoggerAddress_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_elementLoggerAddress_decorators + def test_elementLoggerAddress(self, tango_context): + """Test for elementLoggerAddress""" + # PROTECTED REGION ID(SKAController.test_elementLoggerAddress) ENABLED START # + assert tango_context.device.elementLoggerAddress == "" + # PROTECTED REGION END # // SKAController.test_elementLoggerAddress + + # PROTECTED REGION ID(SKAController.test_elementAlarmAddress_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_elementAlarmAddress_decorators + def test_elementAlarmAddress(self, tango_context): + """Test for elementAlarmAddress""" + # PROTECTED REGION ID(SKAController.test_elementAlarmAddress) ENABLED START # + assert tango_context.device.elementAlarmAddress == "" + # PROTECTED REGION END # // SKAController.test_elementAlarmAddress + + # PROTECTED REGION ID(SKAController.test_elementTelStateAddress_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_elementTelStateAddress_decorators + def test_elementTelStateAddress(self, tango_context): + """Test for elementTelStateAddress""" + # PROTECTED REGION ID(SKAController.test_elementTelStateAddress) ENABLED START # + assert tango_context.device.elementTelStateAddress == "" + # PROTECTED REGION END # // SKAController.test_elementTelStateAddress + + # PROTECTED REGION ID(SKAController.test_elementDatabaseAddress_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_elementDatabaseAddress_decorators + def test_elementDatabaseAddress(self, tango_context): + """Test for elementDatabaseAddress""" + # PROTECTED REGION ID(SKAController.test_elementDatabaseAddress) ENABLED START # + assert tango_context.device.elementDatabaseAddress == "" + # PROTECTED REGION END # // SKAController.test_elementDatabaseAddress + + # PROTECTED REGION ID(SKAController.test_buildState_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_buildState_decorators + def test_buildState(self, tango_context): + """Test for buildState""" + # PROTECTED REGION ID(SKAController.test_buildState) ENABLED START # + buildPattern = re.compile( + r"ska_tango_base, [0-9]+.[0-9]+.[0-9]+, " + r"A set of generic base devices for SKA Telescope" + ) + assert (re.match(buildPattern, tango_context.device.buildState)) is not None + # PROTECTED REGION END # // SKAController.test_buildState + + # PROTECTED REGION ID(SKAController.test_versionId_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_versionId_decorators + def test_versionId(self, tango_context): + """Test for versionId""" + # PROTECTED REGION ID(SKAController.test_versionId) ENABLED START # + versionIdPattern = re.compile(r"[0-9]+.[0-9]+.[0-9]+") + assert (re.match(versionIdPattern, tango_context.device.versionId)) is not None + # PROTECTED REGION END # // SKAController.test_versionId + + # PROTECTED REGION ID(SKAController.test_healthState_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_healthState_decorators + def test_healthState(self, tango_context): + """Test for healthState""" + # PROTECTED REGION ID(SKAController.test_healthState) ENABLED START # + assert tango_context.device.healthState == HealthState.OK + # PROTECTED REGION END # // SKAController.test_healthState + + # PROTECTED REGION ID(SKAController.test_adminMode_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_adminMode_decorators + def test_adminMode(self, tango_context): + """Test for adminMode""" + # PROTECTED REGION ID(SKAController.test_adminMode) ENABLED START # + assert tango_context.device.adminMode == AdminMode.ONLINE + # PROTECTED REGION END # // SKAController.test_adminMode + + # PROTECTED REGION ID(SKAController.test_controlMode_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_controlMode_decorators + def test_controlMode(self, tango_context): + """Test for controlMode""" + # PROTECTED REGION ID(SKAController.test_controlMode) ENABLED START # + assert tango_context.device.controlMode == ControlMode.REMOTE + # PROTECTED REGION END # // SKAController.test_controlMode + + # PROTECTED REGION ID(SKAController.test_simulationMode_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_simulationMode_decorators + def test_simulationMode(self, tango_context): + """Test for simulationMode""" + # PROTECTED REGION ID(SKAController.test_simulationMode) ENABLED START # + assert tango_context.device.simulationMode == SimulationMode.FALSE + # PROTECTED REGION END # // SKAController.test_simulationMode + + # PROTECTED REGION ID(SKAController.test_testMode_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_testMode_decorators + def test_testMode(self, tango_context): + """Test for testMode""" + # PROTECTED REGION ID(SKAController.test_testMode) ENABLED START # + assert tango_context.device.testMode == TestMode.NONE + # PROTECTED REGION END # // SKAController.test_testMode + + # PROTECTED REGION ID(SKAController.test_maxCapabilities_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_maxCapabilities_decorators + def test_maxCapabilities(self, tango_context): + """Test for maxCapabilities""" + # PROTECTED REGION ID(SKAController.test_maxCapabilities) ENABLED START # + assert tango_context.device.maxCapabilities == ("BAND1:1", "BAND2:1") + # PROTECTED REGION END # // SKAController.test_maxCapabilities + + # PROTECTED REGION ID(SKAController.test_availableCapabilities_decorators) ENABLED START # + # PROTECTED REGION END # // SKAController.test_availableCapabilities_decorators + def test_availableCapabilities(self, tango_context): + """Test for availableCapabilities""" + # PROTECTED REGION ID(SKAController.test_availableCapabilities) ENABLED START # + assert tango_context.device.availableCapabilities == ("BAND1:1", "BAND2:1") + # PROTECTED REGION END # // SKAController.test_availableCapabilities diff --git a/tests/test_csp_controller.py b/tests/test_csp_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..6b4217c4f74b4dc6bf981b7244e7099ab527ce9c --- /dev/null +++ b/tests/test_csp_controller.py @@ -0,0 +1,392 @@ +######################################################################################### +# -*- coding: utf-8 -*- +# +# This file is part of the CspSubelementController project +# +# +# +######################################################################################### +"""Contain the tests for the CspSubelementController.""" + +# Imports +import re +import pytest + +from tango import DevState, DevFailed +from tango.test_context import MultiDeviceTestContext + +# PROTECTED REGION ID(CspSubelementController.test_additional_imports) ENABLED START # +from ska_tango_base import SKAController, CspSubElementController +from ska_tango_base.base import ReferenceBaseComponentManager +from ska_tango_base.commands import ResultCode +from ska_tango_base.control_model import ( + AdminMode, + ControlMode, + HealthState, + SimulationMode, + TestMode, +) + +# PROTECTED REGION END # // CspSubElementController.test_additional_imports + + +# Device test case +# PROTECTED REGION ID(CspSubElementController.test_CspSubelementController_decorators) ENABLED START # +# PROTECTED REGION END # // CspSubelementController.test_CspSubelementController_decorators +class TestCspSubElementController(object): + """Test case for CSP SubElement Controller class.""" + + @pytest.fixture(scope="class") + def device_properties(self): + """ + Fixture that returns device_properties to be provided to the + device under test. + """ + return {"PowerDelayStandbyOn": "1.5", "PowerDelayStandbyOff": "1.0"} + + @pytest.fixture(scope="class") + def device_test_config(self, device_properties): + """ + Fixture that specifies the device to be tested, along with its + properties and memorized attributes. + + This implementation provides a concrete subclass of the device + class under test, some properties, and a memorized value for + adminMode. + """ + return { + "device": CspSubElementController, + "component_manager_patch": lambda self: ReferenceBaseComponentManager( + self.op_state_model, logger=self.logger + ), + "properties": device_properties, + "memorized": {"adminMode": str(AdminMode.ONLINE.value)}, + } + + @pytest.mark.skip("Not implemented") + def test_properties(self, tango_context): + # Test the properties + # PROTECTED REGION ID(CspSubelementController.test_properties) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_properties + pass + + # PROTECTED REGION ID(CspSubelementController.test_State_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_State_decorators + def test_State(self, tango_context): + """Test for State""" + # PROTECTED REGION ID(CspSubelementController.test_State) ENABLED START # + assert tango_context.device.State() == DevState.OFF + # PROTECTED REGION END # // CspSubelementController.test_State + + # PROTECTED REGION ID(CspSubelementController.test_Status_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_Status_decorators + def test_Status(self, tango_context): + """Test for Status""" + # PROTECTED REGION ID(CspSubelementController.test_Status) ENABLED START # + assert tango_context.device.Status() == "The device is in OFF state." + # PROTECTED REGION END # // CspSubelementController.test_Status + + # PROTECTED REGION ID(CspSubelementController.test_GetVersionInfo_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_GetVersionInfo_decorators + def test_GetVersionInfo(self, tango_context): + """Test for GetVersionInfo""" + # PROTECTED REGION ID(CspSubelementController.test_GetVersionInfo) ENABLED START # + versionPattern = re.compile( + f"{tango_context.device.info().dev_class}, ska_tango_base, [0-9]+.[0-9]+.[0-9]+, " + "A set of generic base devices for SKA Telescope." + ) + versionInfo = tango_context.device.GetVersionInfo() + assert (re.match(versionPattern, versionInfo[0])) is not None + # PROTECTED REGION END # // CspSubelementController.test_GetVersionInfo + + # PROTECTED REGION ID(CspSubelementController.test_configurationProgress_decorators) ENABLED START # + def test_buildState(self, tango_context): + """Test for buildState""" + # PROTECTED REGION ID(CspSubelementController.test_buildState) ENABLED START # + buildPattern = re.compile( + r"ska_tango_base, [0-9]+.[0-9]+.[0-9]+, " + r"A set of generic base devices for SKA Telescope" + ) + assert (re.match(buildPattern, tango_context.device.buildState)) is not None + # PROTECTED REGION END # // CspSubelementController.test_buildState + + # PROTECTED REGION ID(CspSubelementController.test_versionId_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_versionId_decorators + def test_versionId(self, tango_context): + """Test for versionId""" + # PROTECTED REGION ID(CspSubelementController.test_versionId) ENABLED START # + versionIdPattern = re.compile(r"[0-9]+.[0-9]+.[0-9]+") + assert (re.match(versionIdPattern, tango_context.device.versionId)) is not None + # PROTECTED REGION END # // CspSubelementController.test_versionId + + # PROTECTED REGION ID(CspSubelementController.test_healthState_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_healthState_decorators + def test_healthState(self, tango_context): + """Test for healthState""" + # PROTECTED REGION ID(CspSubelementController.test_healthState) ENABLED START # + assert tango_context.device.healthState == HealthState.OK + # PROTECTED REGION END # // CspSubelementController.test_healthState + + # PROTECTED REGION ID(CspSubelementController.test_adminMode_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_adminMode_decorators + def test_adminMode(self, tango_context): + """Test for adminMode""" + # PROTECTED REGION ID(CspSubelementController.test_adminMode) ENABLED START # + assert tango_context.device.adminMode == AdminMode.ONLINE + # PROTECTED REGION END # // CspSubelementController.test_adminMode + + # PROTECTED REGION ID(CspSubelementController.test_controlMode_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_controlMode_decorators + def test_controlMode(self, tango_context): + """Test for controlMode""" + # PROTECTED REGION ID(CspSubelementController.test_controlMode) ENABLED START # + assert tango_context.device.controlMode == ControlMode.REMOTE + # PROTECTED REGION END # // CspSubelementController.test_controlMode + + # PROTECTED REGION ID(CspSubelementController.test_simulationMode_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_simulationMode_decorators + def test_simulationMode(self, tango_context): + """Test for simulationMode""" + # PROTECTED REGION ID(CspSubelementController.test_simulationMode) ENABLED START # + assert tango_context.device.simulationMode == SimulationMode.FALSE + # PROTECTED REGION END # // CspSubelementController.test_simulationMode + + # PROTECTED REGION ID(CspSubelementController.test_testMode_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_testMode_decorators + def test_testMode(self, tango_context): + """Test for testMode""" + # PROTECTED REGION ID(CspSubelementController.test_testMode) ENABLED START # + assert tango_context.device.testMode == TestMode.NONE + # PROTECTED REGION END # // CspSubelementController.test_testMode + + # PROTECTED REGION ID(CspSubelementController.test_powerDelayStandbyOn_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_powerDelayStandbyOn_decorators + def test_powerDelayStandbyOn(self, tango_context, device_properties): + """Test for powerDelayStandbyOn""" + # PROTECTED REGION ID(CspSubelementController.test_testMode) ENABLED START # + assert tango_context.device.powerDelayStandbyOn == pytest.approx( + float(device_properties["PowerDelayStandbyOn"]) + ) + tango_context.device.powerDelayStandbyOn = 3 + assert tango_context.device.powerDelayStandbyOn == 3 + # PROTECTED REGION END # // CspSubelementController.test_powerDelayStandbyOn + + # PROTECTED REGION ID(CspSubelementController.test_powerDelayStandbyOff_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_powerDelayStandbyOff_decorators + def test_powerDelayStandbyOff(self, tango_context, device_properties): + """Test for powerDelayStandbyOff""" + # PROTECTED REGION ID(CspSubelementController.test_testMode) ENABLED START # + assert tango_context.device.powerDelayStandbyOff == pytest.approx( + float(device_properties["PowerDelayStandbyOff"]) + ) + tango_context.device.powerDelayStandbyOff = 2 + assert tango_context.device.powerDelayStandbyOff == 2 + # PROTECTED REGION END # // CspSubelementController.test_powerDelayStandbyOff + + # PROTECTED REGION ID(CspSubelementController.test_onProgress_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_onProgress_decorators + def test_onProgress(self, tango_context): + """Test for onProgress""" + # PROTECTED REGION ID(CspSubelementController.test_onProgress) ENABLED START # + assert tango_context.device.onProgress == 0 + # PROTECTED REGION END # // CspSubelementController.test_onProgress + + # PROTECTED REGION ID(CspSubelementController.test_onMaximumDuration_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_onMaximumDuration_decorators + def test_onMaximumDuration(self, tango_context): + """Test for onMaximumDuration""" + # PROTECTED REGION ID(CspSubelementController.test_onMaximumDuration) ENABLED START # + tango_context.device.onMaximumDuration = 5 + assert tango_context.device.onMaximumDuration == 5 + # PROTECTED REGION END # // CspSubelementController.test_onMaximumDuration + + # PROTECTED REGION ID(CspSubelementController.test_onMeasuredDuration_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_onMeasuredDuration_decorators + def test_onMeasuredDuration(self, tango_context): + """Test for onMeasuredDuration""" + # PROTECTED REGION ID(CspSubelementController.test_onMeasuredDuration) ENABLED START # + assert tango_context.device.onMeasuredDuration == 0 + # PROTECTED REGION END # // CspSubelementController.test_onMeasuredDuration + + # PROTECTED REGION ID(CspSubelementController.test_standbyProgress_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_standbyProgress_decorators + def test_standbyProgress(self, tango_context): + """Test for standbyProgress""" + # PROTECTED REGION ID(CspSubelementController.test_standbyProgress) ENABLED START # + assert tango_context.device.standbyProgress == 0 + # PROTECTED REGION END # // CspSubelementController.test_standbyProgress + + # PROTECTED REGION ID(CspSubelementController.test_standbyMaximumDuration_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_standbyMaximumDuration_decorators + def test_standbyMaximumDuration(self, tango_context): + """Test for standbyMaximumDuration""" + # PROTECTED REGION ID(CspSubelementController.test_standbyMaximumDuration) ENABLED START # + tango_context.device.standbyMaximumDuration = 5 + assert tango_context.device.standbyMaximumDuration == 5 + # PROTECTED REGION END # // CspSubelementController.test_standbyMaximumDuration + + # PROTECTED REGION ID(CspSubelementController.test_standbyMeasuredDuration_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_standbyMeasuredDuration_decorators + def test_standbyMeasuredDuration(self, tango_context): + """Test for standbyMeasuredDuration""" + # PROTECTED REGION ID(CspSubelementController.test_standbyMeasuredDuration) ENABLED START # + assert tango_context.device.standbyMeasuredDuration == 0 + # PROTECTED REGION END # // CspSubelementController.test_standbyMeasuredDuration + + # PROTECTED REGION ID(CspSubelementController.test_offProgress_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_offProgress_decorators + def test_offProgress(self, tango_context): + """Test for offProgress""" + # PROTECTED REGION ID(CspSubelementController.test_offProgress) ENABLED START # + assert tango_context.device.offProgress == 0 + # PROTECTED REGION END # // CspSubelementController.test_offProgress + + # PROTECTED REGION ID(CspSubelementController.test_offMaximumDuration_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_offMaximumDuration_decorators + def test_offMaximumDuration(self, tango_context): + """Test for offMaximumDuration""" + # PROTECTED REGION ID(CspSubelementController.test_offMaximumDuration) ENABLED START # + tango_context.device.offMaximumDuration = 5 + assert tango_context.device.offMaximumDuration == 5 + # PROTECTED REGION END # // CspSubelementController.test_offMaximumDuration + + # PROTECTED REGION ID(CspSubelementController.test_offMeasuredDuration_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_offMeasuredDuration_decorators + def test_offMeasuredDuration(self, tango_context): + """Test for offMeasuredDuration""" + # PROTECTED REGION ID(CspSubelementController.test_offMeasuredDuration) ENABLED START # + assert tango_context.device.offMeasuredDuration == 0 + # PROTECTED REGION END # // CspSubelementController.test_offMeasuredDuration + + # PROTECTED REGION ID(CspSubelementController.test_loadFirmwareProgress_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_loadFirmwareProgress_decorators + def test_loadFirmwareProgress(self, tango_context): + """Test for loadFirmwareProgress""" + # PROTECTED REGION ID(CspSubelementController.test_loadFirmwareProgress) ENABLED START # + assert tango_context.device.loadFirmwareProgress == 0 + # PROTECTED REGION END # // CspSubelementController.test_loadFirmwareProgress + + # PROTECTED REGION ID(CspSubelementController.test_loadFirmwareMaximumDuration_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_loadFirmwareMaximumDuration_decorators + def test_loadFirmwareMaximumDuration(self, tango_context): + """Test for loadFirmwareMaximumDuration""" + # PROTECTED REGION ID(CspSubelementController.test_loadFirmwareMaximumDuration) ENABLED START # + tango_context.device.loadFirmwareMaximumDuration = 5 + assert tango_context.device.loadFirmwareMaximumDuration == 5 + # PROTECTED REGION END # // CspSubelementController.test_loadFirmwareMaximumDuration + + # PROTECTED REGION ID(CspSubelementController.test_loadFirmwareMeasuredDuration_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_loadFirmwareMeasuredDuration_decorators + def test_loadFirmwareMeasuredDuration(self, tango_context): + """Test for loadFirmwareMeasuredDuration""" + # PROTECTED REGION ID(CspSubelementController.test_loadFirmwareMeasuredDuration) ENABLED START # + assert tango_context.device.loadFirmwareMeasuredDuration == 0 + # PROTECTED REGION END # // CspSubelementController.test_loadFirmwareMeasuredDuration + + # PROTECTED REGION ID(CspSubelementController.test_LoadFirmware_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_LoadFirmware_decorators + def test_LoadFirmware(self, tango_context): + """Test for LoadFirmware""" + # PROTECTED REGION ID(CspSubelementController.test_LoadFirmware) ENABLED START # + # After initialization the device is in the right state (OFF/MAINTENANCE) to + # execute the command. + tango_context.device.adminMode = AdminMode.MAINTENANCE + assert tango_context.device.LoadFirmware( + ["file", "test/dev/b", "918698a7fea3"] + ) == [[ResultCode.OK], ["LoadFirmware command completed OK"]] + # PROTECTED REGION END # // CspSubelementController.test_LoadFirmware + + # PROTECTED REGION ID(CspSubelementController.test_LoadFirmware_when_in_wrong_state_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_LoadFirmware_wrong_state_decorators + def test_LoadFirmware_when_in_wrong_state(self, tango_context): + """Test for LoadFirmware when the device is in wrong state""" + # PROTECTED REGION ID(CspSubelementController.test_LoadFirmware_when_in_wrong_state) ENABLED START # + # Set the device in ON/ONLINE state + tango_context.device.On() + with pytest.raises(DevFailed, match="LoadFirmwareCommand not allowed"): + tango_context.device.LoadFirmware(["file", "test/dev/b", "918698a7fea3"]) + # PROTECTED REGION END # // CspSubelementController.test_LoadFirmware_when_in_wrong_state + + # PROTECTED REGION ID(CspSubelementController.test_PowerOnDevices_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_PowerOnDevices_decorators + def test_PowerOnDevices(self, tango_context): + """Test for PowerOnDevices""" + # PROTECTED REGION ID(CspSubelementController.test_PowerOnDevices) ENABLED START # + # put it in ON state + tango_context.device.On() + assert tango_context.device.PowerOnDevices(["test/dev/1", "test/dev/2"]) == [ + [ResultCode.OK], + ["PowerOnDevices command completed OK"], + ] + # PROTECTED REGION END # // CspSubelementController.test_PowerOnDevices + + # PROTECTED REGION ID(CspSubelementController.test_PowerOnDevices_when_in_wrong_state_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_PowerOnDevices_decorators + def test_PowerOnDevices_when_in_wrong_state(self, tango_context): + """Test for PowerOnDevices when the Controller is in wrong state""" + # PROTECTED REGION ID(CspSubelementController.test_PowerOnDevices_when_in_wrong_state) ENABLED START # + with pytest.raises(DevFailed, match="PowerOnDevicesCommand not allowed"): + tango_context.device.PowerOnDevices(["test/dev/1", "test/dev/2"]) + # PROTECTED REGION END # // CspSubelementController.test_PowerOnDevices_when_in_wrong_state + + # PROTECTED REGION ID(CspSubelementController.test_PowerOffDevices_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_PowerOffDevices_decorators + def test_PowerOffDevices(self, tango_context): + """Test for PowerOffDEvices""" + # PROTECTED REGION ID(CspSubelementController.test_PowerOffDevices) ENABLED START # + # put it in ON state + tango_context.device.On() + assert tango_context.device.PowerOffDevices(["test/dev/1", "test/dev/2"]) == [ + [ResultCode.OK], + ["PowerOffDevices command completed OK"], + ] + # PROTECTED REGION END # // CspSubelementController.test_PowerOffDevices + + # PROTECTED REGION ID(CspSubelementController.test_PowerOffDevices_when_in_wrong_state_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_PowerOffDevices_decorators + def test_PowerOffDevices_when_in_wrong_state(self, tango_context): + """Test for PowerOffDevices when the Controller is in wrong state""" + # PROTECTED REGION ID(CspSubelementController.test_PowerOffDevices_when_in_wrong_state) ENABLED START # + with pytest.raises(DevFailed, match="PowerOffDevicesCommand not allowed"): + tango_context.device.PowerOffDevices(["test/dev/1", "test/dev/2"]) + # PROTECTED REGION END # // CspSubelementController.test_PowerOffDevices_when_in_wrong_state + + # PROTECTED REGION ID(CspSubelementController.test_ReInitDevices_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_ReInitDevices_decorators + def test_ReInitDevices(self, tango_context): + """Test for ReInitDevices""" + # PROTECTED REGION ID(CspSubelementController.test_ReInitDevices) ENABLED START # + # put it in ON state + tango_context.device.On() + assert tango_context.device.ReInitDevices(["test/dev/1", "test/dev/2"]) == [ + [ResultCode.OK], + ["ReInitDevices command completed OK"], + ] + # PROTECTED REGION END # // CspSubelementController.test_ReInitDevices + + # PROTECTED REGION ID(CspSubelementController.test_ReInitDevices_when_in_wrong_state_decorators) ENABLED START # + # PROTECTED REGION END # // CspSubelementController.test_ReInitDevices_when_in_wrong_state_decorators + def test_ReInitDevices_when_in_wrong_state(self, tango_context): + """Test for ReInitDevices whe the device is in a wrong state""" + # PROTECTED REGION ID(CspSubelementController.test_ReInitDevices_when_in_wrong_state) ENABLED START # + # put it in ON state + with pytest.raises(DevFailed, match="ReInitDevicesCommand not allowed"): + tango_context.device.ReInitDevices(["test/dev/1", "test/dev/2"]) + # PROTECTED REGION END # // CspSubelementController.test_ReInitDevices_when_in_wrong_state + + +@pytest.mark.forked +def test_multiple_devices_in_same_process(): + + # The order here is important - base class last, so that we can + # test that the subclass isn't breaking anything. + devices_info = ( + {"class": CspSubElementController, "devices": [{"name": "test/se/1"}]}, + {"class": SKAController, "devices": [{"name": "test/control/1"}]}, + ) + + with MultiDeviceTestContext(devices_info, process=False) as context: + proxy1 = context.get_device("test/se/1") + proxy2 = context.get_device("test/control/1") + assert proxy1.State() == DevState.DISABLE + assert proxy2.State() == DevState.DISABLE diff --git a/tests/test_csp_master.py b/tests/test_csp_master.py deleted file mode 100644 index 38a8a1a98c75ed702e5651706588cc5091ecc333..0000000000000000000000000000000000000000 --- a/tests/test_csp_master.py +++ /dev/null @@ -1,392 +0,0 @@ -######################################################################################### -# -*- coding: utf-8 -*- -# -# This file is part of the CspSubelementMaster project -# -# -# -######################################################################################### -"""Contain the tests for the CspSubelementMaster.""" - -# Imports -import re -import pytest - -from tango import DevState, DevFailed -from tango.test_context import MultiDeviceTestContext - -# PROTECTED REGION ID(CspSubelementMaster.test_additional_imports) ENABLED START # -from ska_tango_base import SKAMaster, CspSubElementMaster -from ska_tango_base.base import ReferenceBaseComponentManager -from ska_tango_base.commands import ResultCode -from ska_tango_base.control_model import ( - AdminMode, - ControlMode, - HealthState, - SimulationMode, - TestMode, -) - -# PROTECTED REGION END # // CspSubElementMaster.test_additional_imports - - -# Device test case -# PROTECTED REGION ID(CspSubElementMaster.test_CspSubelementMaster_decorators) ENABLED START # -# PROTECTED REGION END # // CspSubelementMaster.test_CspSubelementMaster_decorators -class TestCspSubElementMaster(object): - """Test case for CSP SubElement Master class.""" - - @pytest.fixture(scope="class") - def device_properties(self): - """ - Fixture that returns device_properties to be provided to the - device under test. - """ - return {"PowerDelayStandbyOn": "1.5", "PowerDelayStandbyOff": "1.0"} - - @pytest.fixture(scope="class") - def device_test_config(self, device_properties): - """ - Fixture that specifies the device to be tested, along with its - properties and memorized attributes. - - This implementation provides a concrete subclass of the device - class under test, some properties, and a memorized value for - adminMode. - """ - return { - "device": CspSubElementMaster, - "component_manager_patch": lambda self: ReferenceBaseComponentManager( - self.op_state_model, logger=self.logger - ), - "properties": device_properties, - "memorized": {"adminMode": str(AdminMode.ONLINE.value)}, - } - - @pytest.mark.skip("Not implemented") - def test_properties(self, tango_context): - # Test the properties - # PROTECTED REGION ID(CspSubelementMaster.test_properties) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_properties - pass - - # PROTECTED REGION ID(CspSubelementMaster.test_State_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_State_decorators - def test_State(self, tango_context): - """Test for State""" - # PROTECTED REGION ID(CspSubelementMaster.test_State) ENABLED START # - assert tango_context.device.State() == DevState.OFF - # PROTECTED REGION END # // CspSubelementMaster.test_State - - # PROTECTED REGION ID(CspSubelementMaster.test_Status_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_Status_decorators - def test_Status(self, tango_context): - """Test for Status""" - # PROTECTED REGION ID(CspSubelementMaster.test_Status) ENABLED START # - assert tango_context.device.Status() == "The device is in OFF state." - # PROTECTED REGION END # // CspSubelementMaster.test_Status - - # PROTECTED REGION ID(CspSubelementMaster.test_GetVersionInfo_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_GetVersionInfo_decorators - def test_GetVersionInfo(self, tango_context): - """Test for GetVersionInfo""" - # PROTECTED REGION ID(CspSubelementMaster.test_GetVersionInfo) ENABLED START # - versionPattern = re.compile( - f"{tango_context.device.info().dev_class}, ska_tango_base, [0-9]+.[0-9]+.[0-9]+, " - "A set of generic base devices for SKA Telescope." - ) - versionInfo = tango_context.device.GetVersionInfo() - assert (re.match(versionPattern, versionInfo[0])) is not None - # PROTECTED REGION END # // CspSubelementMaster.test_GetVersionInfo - - # PROTECTED REGION ID(CspSubelementMaster.test_configurationProgress_decorators) ENABLED START # - def test_buildState(self, tango_context): - """Test for buildState""" - # PROTECTED REGION ID(CspSubelementMaster.test_buildState) ENABLED START # - buildPattern = re.compile( - r"ska_tango_base, [0-9]+.[0-9]+.[0-9]+, " - r"A set of generic base devices for SKA Telescope" - ) - assert (re.match(buildPattern, tango_context.device.buildState)) is not None - # PROTECTED REGION END # // CspSubelementMaster.test_buildState - - # PROTECTED REGION ID(CspSubelementMaster.test_versionId_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_versionId_decorators - def test_versionId(self, tango_context): - """Test for versionId""" - # PROTECTED REGION ID(CspSubelementMaster.test_versionId) ENABLED START # - versionIdPattern = re.compile(r"[0-9]+.[0-9]+.[0-9]+") - assert (re.match(versionIdPattern, tango_context.device.versionId)) is not None - # PROTECTED REGION END # // CspSubelementMaster.test_versionId - - # PROTECTED REGION ID(CspSubelementMaster.test_healthState_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_healthState_decorators - def test_healthState(self, tango_context): - """Test for healthState""" - # PROTECTED REGION ID(CspSubelementMaster.test_healthState) ENABLED START # - assert tango_context.device.healthState == HealthState.OK - # PROTECTED REGION END # // CspSubelementMaster.test_healthState - - # PROTECTED REGION ID(CspSubelementMaster.test_adminMode_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_adminMode_decorators - def test_adminMode(self, tango_context): - """Test for adminMode""" - # PROTECTED REGION ID(CspSubelementMaster.test_adminMode) ENABLED START # - assert tango_context.device.adminMode == AdminMode.ONLINE - # PROTECTED REGION END # // CspSubelementMaster.test_adminMode - - # PROTECTED REGION ID(CspSubelementMaster.test_controlMode_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_controlMode_decorators - def test_controlMode(self, tango_context): - """Test for controlMode""" - # PROTECTED REGION ID(CspSubelementMaster.test_controlMode) ENABLED START # - assert tango_context.device.controlMode == ControlMode.REMOTE - # PROTECTED REGION END # // CspSubelementMaster.test_controlMode - - # PROTECTED REGION ID(CspSubelementMaster.test_simulationMode_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_simulationMode_decorators - def test_simulationMode(self, tango_context): - """Test for simulationMode""" - # PROTECTED REGION ID(CspSubelementMaster.test_simulationMode) ENABLED START # - assert tango_context.device.simulationMode == SimulationMode.FALSE - # PROTECTED REGION END # // CspSubelementMaster.test_simulationMode - - # PROTECTED REGION ID(CspSubelementMaster.test_testMode_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_testMode_decorators - def test_testMode(self, tango_context): - """Test for testMode""" - # PROTECTED REGION ID(CspSubelementMaster.test_testMode) ENABLED START # - assert tango_context.device.testMode == TestMode.NONE - # PROTECTED REGION END # // CspSubelementMaster.test_testMode - - # PROTECTED REGION ID(CspSubelementMaster.test_powerDelayStandbyOn_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_powerDelayStandbyOn_decorators - def test_powerDelayStandbyOn(self, tango_context, device_properties): - """Test for powerDelayStandbyOn""" - # PROTECTED REGION ID(CspSubelementMaster.test_testMode) ENABLED START # - assert tango_context.device.powerDelayStandbyOn == pytest.approx( - float(device_properties["PowerDelayStandbyOn"]) - ) - tango_context.device.powerDelayStandbyOn = 3 - assert tango_context.device.powerDelayStandbyOn == 3 - # PROTECTED REGION END # // CspSubelementMaster.test_powerDelayStandbyOn - - # PROTECTED REGION ID(CspSubelementMaster.test_powerDelayStandbyOff_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_powerDelayStandbyOff_decorators - def test_powerDelayStandbyOff(self, tango_context, device_properties): - """Test for powerDelayStandbyOff""" - # PROTECTED REGION ID(CspSubelementMaster.test_testMode) ENABLED START # - assert tango_context.device.powerDelayStandbyOff == pytest.approx( - float(device_properties["PowerDelayStandbyOff"]) - ) - tango_context.device.powerDelayStandbyOff = 2 - assert tango_context.device.powerDelayStandbyOff == 2 - # PROTECTED REGION END # // CspSubelementMaster.test_powerDelayStandbyOff - - # PROTECTED REGION ID(CspSubelementMaster.test_onProgress_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_onProgress_decorators - def test_onProgress(self, tango_context): - """Test for onProgress""" - # PROTECTED REGION ID(CspSubelementMaster.test_onProgress) ENABLED START # - assert tango_context.device.onProgress == 0 - # PROTECTED REGION END # // CspSubelementMaster.test_onProgress - - # PROTECTED REGION ID(CspSubelementMaster.test_onMaximumDuration_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_onMaximumDuration_decorators - def test_onMaximumDuration(self, tango_context): - """Test for onMaximumDuration""" - # PROTECTED REGION ID(CspSubelementMaster.test_onMaximumDuration) ENABLED START # - tango_context.device.onMaximumDuration = 5 - assert tango_context.device.onMaximumDuration == 5 - # PROTECTED REGION END # // CspSubelementMaster.test_onMaximumDuration - - # PROTECTED REGION ID(CspSubelementMaster.test_onMeasuredDuration_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_onMeasuredDuration_decorators - def test_onMeasuredDuration(self, tango_context): - """Test for onMeasuredDuration""" - # PROTECTED REGION ID(CspSubelementMaster.test_onMeasuredDuration) ENABLED START # - assert tango_context.device.onMeasuredDuration == 0 - # PROTECTED REGION END # // CspSubelementMaster.test_onMeasuredDuration - - # PROTECTED REGION ID(CspSubelementMaster.test_standbyProgress_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_standbyProgress_decorators - def test_standbyProgress(self, tango_context): - """Test for standbyProgress""" - # PROTECTED REGION ID(CspSubelementMaster.test_standbyProgress) ENABLED START # - assert tango_context.device.standbyProgress == 0 - # PROTECTED REGION END # // CspSubelementMaster.test_standbyProgress - - # PROTECTED REGION ID(CspSubelementMaster.test_standbyMaximumDuration_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_standbyMaximumDuration_decorators - def test_standbyMaximumDuration(self, tango_context): - """Test for standbyMaximumDuration""" - # PROTECTED REGION ID(CspSubelementMaster.test_standbyMaximumDuration) ENABLED START # - tango_context.device.standbyMaximumDuration = 5 - assert tango_context.device.standbyMaximumDuration == 5 - # PROTECTED REGION END # // CspSubelementMaster.test_standbyMaximumDuration - - # PROTECTED REGION ID(CspSubelementMaster.test_standbyMeasuredDuration_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_standbyMeasuredDuration_decorators - def test_standbyMeasuredDuration(self, tango_context): - """Test for standbyMeasuredDuration""" - # PROTECTED REGION ID(CspSubelementMaster.test_standbyMeasuredDuration) ENABLED START # - assert tango_context.device.standbyMeasuredDuration == 0 - # PROTECTED REGION END # // CspSubelementMaster.test_standbyMeasuredDuration - - # PROTECTED REGION ID(CspSubelementMaster.test_offProgress_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_offProgress_decorators - def test_offProgress(self, tango_context): - """Test for offProgress""" - # PROTECTED REGION ID(CspSubelementMaster.test_offProgress) ENABLED START # - assert tango_context.device.offProgress == 0 - # PROTECTED REGION END # // CspSubelementMaster.test_offProgress - - # PROTECTED REGION ID(CspSubelementMaster.test_offMaximumDuration_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_offMaximumDuration_decorators - def test_offMaximumDuration(self, tango_context): - """Test for offMaximumDuration""" - # PROTECTED REGION ID(CspSubelementMaster.test_offMaximumDuration) ENABLED START # - tango_context.device.offMaximumDuration = 5 - assert tango_context.device.offMaximumDuration == 5 - # PROTECTED REGION END # // CspSubelementMaster.test_offMaximumDuration - - # PROTECTED REGION ID(CspSubelementMaster.test_offMeasuredDuration_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_offMeasuredDuration_decorators - def test_offMeasuredDuration(self, tango_context): - """Test for offMeasuredDuration""" - # PROTECTED REGION ID(CspSubelementMaster.test_offMeasuredDuration) ENABLED START # - assert tango_context.device.offMeasuredDuration == 0 - # PROTECTED REGION END # // CspSubelementMaster.test_offMeasuredDuration - - # PROTECTED REGION ID(CspSubelementMaster.test_loadFirmwareProgress_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_loadFirmwareProgress_decorators - def test_loadFirmwareProgress(self, tango_context): - """Test for loadFirmwareProgress""" - # PROTECTED REGION ID(CspSubelementMaster.test_loadFirmwareProgress) ENABLED START # - assert tango_context.device.loadFirmwareProgress == 0 - # PROTECTED REGION END # // CspSubelementMaster.test_loadFirmwareProgress - - # PROTECTED REGION ID(CspSubelementMaster.test_loadFirmwareMaximumDuration_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_loadFirmwareMaximumDuration_decorators - def test_loadFirmwareMaximumDuration(self, tango_context): - """Test for loadFirmwareMaximumDuration""" - # PROTECTED REGION ID(CspSubelementMaster.test_loadFirmwareMaximumDuration) ENABLED START # - tango_context.device.loadFirmwareMaximumDuration = 5 - assert tango_context.device.loadFirmwareMaximumDuration == 5 - # PROTECTED REGION END # // CspSubelementMaster.test_loadFirmwareMaximumDuration - - # PROTECTED REGION ID(CspSubelementMaster.test_loadFirmwareMeasuredDuration_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_loadFirmwareMeasuredDuration_decorators - def test_loadFirmwareMeasuredDuration(self, tango_context): - """Test for loadFirmwareMeasuredDuration""" - # PROTECTED REGION ID(CspSubelementMaster.test_loadFirmwareMeasuredDuration) ENABLED START # - assert tango_context.device.loadFirmwareMeasuredDuration == 0 - # PROTECTED REGION END # // CspSubelementMaster.test_loadFirmwareMeasuredDuration - - # PROTECTED REGION ID(CspSubelementMaster.test_LoadFirmware_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_LoadFirmware_decorators - def test_LoadFirmware(self, tango_context): - """Test for LoadFirmware""" - # PROTECTED REGION ID(CspSubelementMaster.test_LoadFirmware) ENABLED START # - # After initialization the device is in the right state (OFF/MAINTENANCE) to - # execute the command. - tango_context.device.adminMode = AdminMode.MAINTENANCE - assert tango_context.device.LoadFirmware( - ["file", "test/dev/b", "918698a7fea3"] - ) == [[ResultCode.OK], ["LoadFirmware command completed OK"]] - # PROTECTED REGION END # // CspSubelementMaster.test_LoadFirmware - - # PROTECTED REGION ID(CspSubelementMaster.test_LoadFirmware_when_in_wrong_state_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_LoadFirmware_wrong_state_decorators - def test_LoadFirmware_when_in_wrong_state(self, tango_context): - """Test for LoadFirmware when the device is in wrong state""" - # PROTECTED REGION ID(CspSubelementMaster.test_LoadFirmware_when_in_wrong_state) ENABLED START # - # Set the device in ON/ONLINE state - tango_context.device.On() - with pytest.raises(DevFailed, match="LoadFirmwareCommand not allowed"): - tango_context.device.LoadFirmware(["file", "test/dev/b", "918698a7fea3"]) - # PROTECTED REGION END # // CspSubelementMaster.test_LoadFirmware_when_in_wrong_state - - # PROTECTED REGION ID(CspSubelementMaster.test_PowerOnDevices_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_PowerOnDevices_decorators - def test_PowerOnDevices(self, tango_context): - """Test for PowerOnDevices""" - # PROTECTED REGION ID(CspSubelementMaster.test_PowerOnDevices) ENABLED START # - # put it in ON state - tango_context.device.On() - assert tango_context.device.PowerOnDevices(["test/dev/1", "test/dev/2"]) == [ - [ResultCode.OK], - ["PowerOnDevices command completed OK"], - ] - # PROTECTED REGION END # // CspSubelementMaster.test_PowerOnDevices - - # PROTECTED REGION ID(CspSubelementMaster.test_PowerOnDevices_when_in_wrong_state_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_PowerOnDevices_decorators - def test_PowerOnDevices_when_in_wrong_state(self, tango_context): - """Test for PowerOnDevices when the Master is in wrong state""" - # PROTECTED REGION ID(CspSubelementMaster.test_PowerOnDevices_when_in_wrong_state) ENABLED START # - with pytest.raises(DevFailed, match="PowerOnDevicesCommand not allowed"): - tango_context.device.PowerOnDevices(["test/dev/1", "test/dev/2"]) - # PROTECTED REGION END # // CspSubelementMaster.test_PowerOnDevices_when_in_wrong_state - - # PROTECTED REGION ID(CspSubelementMaster.test_PowerOffDevices_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_PowerOffDevices_decorators - def test_PowerOffDevices(self, tango_context): - """Test for PowerOffDEvices""" - # PROTECTED REGION ID(CspSubelementMaster.test_PowerOffDevices) ENABLED START # - # put it in ON state - tango_context.device.On() - assert tango_context.device.PowerOffDevices(["test/dev/1", "test/dev/2"]) == [ - [ResultCode.OK], - ["PowerOffDevices command completed OK"], - ] - # PROTECTED REGION END # // CspSubelementMaster.test_PowerOffDevices - - # PROTECTED REGION ID(CspSubelementMaster.test_PowerOffDevices_when_in_wrong_state_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_PowerOffDevices_decorators - def test_PowerOffDevices_when_in_wrong_state(self, tango_context): - """Test for PowerOffDevices when the Master is in wrong state""" - # PROTECTED REGION ID(CspSubelementMaster.test_PowerOffDevices_when_in_wrong_state) ENABLED START # - with pytest.raises(DevFailed, match="PowerOffDevicesCommand not allowed"): - tango_context.device.PowerOffDevices(["test/dev/1", "test/dev/2"]) - # PROTECTED REGION END # // CspSubelementMaster.test_PowerOffDevices_when_in_wrong_state - - # PROTECTED REGION ID(CspSubelementMaster.test_ReInitDevices_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_ReInitDevices_decorators - def test_ReInitDevices(self, tango_context): - """Test for ReInitDevices""" - # PROTECTED REGION ID(CspSubelementMaster.test_ReInitDevices) ENABLED START # - # put it in ON state - tango_context.device.On() - assert tango_context.device.ReInitDevices(["test/dev/1", "test/dev/2"]) == [ - [ResultCode.OK], - ["ReInitDevices command completed OK"], - ] - # PROTECTED REGION END # // CspSubelementMaster.test_ReInitDevices - - # PROTECTED REGION ID(CspSubelementMaster.test_ReInitDevices_when_in_wrong_state_decorators) ENABLED START # - # PROTECTED REGION END # // CspSubelementMaster.test_ReInitDevices_when_in_wrong_state_decorators - def test_ReInitDevices_when_in_wrong_state(self, tango_context): - """Test for ReInitDevices whe the device is in a wrong state""" - # PROTECTED REGION ID(CspSubelementMaster.test_ReInitDevices_when_in_wrong_state) ENABLED START # - # put it in ON state - with pytest.raises(DevFailed, match="ReInitDevicesCommand not allowed"): - tango_context.device.ReInitDevices(["test/dev/1", "test/dev/2"]) - # PROTECTED REGION END # // CspSubelementMaster.test_ReInitDevices_when_in_wrong_state - - -@pytest.mark.forked -def test_multiple_devices_in_same_process(): - - # The order here is important - base class last, so that we can - # test that the subclass isn't breaking anything. - devices_info = ( - {"class": CspSubElementMaster, "devices": [{"name": "test/se/1"}]}, - {"class": SKAMaster, "devices": [{"name": "test/master/1"}]}, - ) - - with MultiDeviceTestContext(devices_info, process=False) as context: - proxy1 = context.get_device("test/se/1") - proxy2 = context.get_device("test/master/1") - assert proxy1.State() == DevState.DISABLE - assert proxy2.State() == DevState.DISABLE diff --git a/tests/test_master_device.py b/tests/test_master_device.py deleted file mode 100644 index 35e67215c6bbc51a4a9f894c18bd78701e10119c..0000000000000000000000000000000000000000 --- a/tests/test_master_device.py +++ /dev/null @@ -1,233 +0,0 @@ -######################################################################################### -# -*- coding: utf-8 -*- -# -# This file is part of the SKAMaster project -# -# -# -######################################################################################### -"""Contain the tests for the SKAMaster.""" - -import re -import pytest -from tango import DevState - -# PROTECTED REGION ID(SKAMaster.test_additional_imports) ENABLED START # -from ska_tango_base import SKAMaster -from ska_tango_base.base import ReferenceBaseComponentManager -from ska_tango_base.control_model import ( - AdminMode, - ControlMode, - HealthState, - SimulationMode, - TestMode, -) - -# PROTECTED REGION END # // SKAMaster.test_additional_imports - - -# PROTECTED REGION ID(SKAMaster.test_SKAMaster_decorators) ENABLED START # -@pytest.mark.usefixtures("tango_context") -# PROTECTED REGION END # // SKAMaster.test_SKAMaster_decorators -class TestSKAMaster(object): - """ - Test class for tests of the SKAMaster device class. - """ - - # capabilities = ['BAND1:1', 'BAND2:1', 'BAND3:0', 'BAND4:0', 'BAND5:0'] - - @pytest.fixture(scope="class") - def device_properties(self): - """ - Fixture that returns device_properties to be provided to the - device under test. - """ - return { - "SkaLevel": "4", - "LoggingTargetsDefault": "", - "GroupDefinitions": "", - "NrSubarrays": "16", - "CapabilityTypes": "", - "MaxCapabilities": ["BAND1:1", "BAND2:1"], - } - - @pytest.fixture(scope="class") - def device_test_config(self, device_properties): - """ - Fixture that specifies the device to be tested, along with its - properties and memorized attributes. - - This implementation provides a concrete subclass of the device - class under test, some properties, and a memorized value for - adminMode. - """ - return { - "device": SKAMaster, - "component_manager_patch": lambda self: ReferenceBaseComponentManager( - self.op_state_model, logger=self.logger - ), - "properties": device_properties, - "memorized": {"adminMode": str(AdminMode.ONLINE.value)}, - } - - @pytest.mark.skip("Not implemented") - def test_properties(self, tango_context): - # Test the properties - # PROTECTED REGION ID(SKAMaster.test_properties) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_properties - pass - - # PROTECTED REGION ID(SKAMaster.test_State_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_State_decorators - def test_State(self, tango_context): - """Test for State""" - # PROTECTED REGION ID(SKAMaster.test_State) ENABLED START # - assert tango_context.device.State() == DevState.OFF - # PROTECTED REGION END # // SKAMaster.test_State - - # PROTECTED REGION ID(SKAMaster.test_Status_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_Status_decorators - def test_Status(self, tango_context): - """Test for Status""" - # PROTECTED REGION ID(SKAMaster.test_Status) ENABLED START # - assert tango_context.device.Status() == "The device is in OFF state." - # PROTECTED REGION END # // SKAMaster.test_Status - - # PROTECTED REGION ID(SKAMaster.test_GetVersionInfo_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_GetVersionInfo_decorators - def test_GetVersionInfo(self, tango_context): - """Test for GetVersionInfo""" - # PROTECTED REGION ID(SKAMaster.test_GetVersionInfo) ENABLED START # - versionPattern = re.compile( - f"{tango_context.device.info().dev_class}, ska_tango_base, [0-9]+.[0-9]+.[0-9]+, " - "A set of generic base devices for SKA Telescope." - ) - versionInfo = tango_context.device.GetVersionInfo() - assert (re.match(versionPattern, versionInfo[0])) is not None - # PROTECTED REGION END # // SKAMaster.test_GetVersionInfo - - # PROTECTED REGION ID(SKAMaster.test_isCapabilityAchievable_failure_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_isCapabilityAchievable_failure_decorators - def test_isCapabilityAchievable_failure(self, tango_context): - """Test for isCapabilityAchievable to test failure condition""" - # PROTECTED REGION ID(SKAMaster.test_isCapabilityAchievable_failure) ENABLED START # - assert tango_context.device.isCapabilityAchievable([[2], ["BAND1"]]) is False - # PROTECTED REGION END # // SKAMaster.test_isCapabilityAchievable_failure - - # PROTECTED REGION ID(SKAMaster.test_isCapabilityAchievable_success_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_isCapabilityAchievable_success_decorators - - def test_isCapabilityAchievable_success(self, tango_context): - """Test for isCapabilityAchievable to test success condition""" - # PROTECTED REGION ID(SKAMaster.test_isCapabilityAchievable_success) ENABLED START # - assert tango_context.device.isCapabilityAchievable([[1], ["BAND1"]]) is True - # PROTECTED REGION END # // SKAMaster.test_isCapabilityAchievable_success - - # PROTECTED REGION ID(SKAMaster.test_elementLoggerAddress_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_elementLoggerAddress_decorators - def test_elementLoggerAddress(self, tango_context): - """Test for elementLoggerAddress""" - # PROTECTED REGION ID(SKAMaster.test_elementLoggerAddress) ENABLED START # - assert tango_context.device.elementLoggerAddress == "" - # PROTECTED REGION END # // SKAMaster.test_elementLoggerAddress - - # PROTECTED REGION ID(SKAMaster.test_elementAlarmAddress_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_elementAlarmAddress_decorators - def test_elementAlarmAddress(self, tango_context): - """Test for elementAlarmAddress""" - # PROTECTED REGION ID(SKAMaster.test_elementAlarmAddress) ENABLED START # - assert tango_context.device.elementAlarmAddress == "" - # PROTECTED REGION END # // SKAMaster.test_elementAlarmAddress - - # PROTECTED REGION ID(SKAMaster.test_elementTelStateAddress_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_elementTelStateAddress_decorators - def test_elementTelStateAddress(self, tango_context): - """Test for elementTelStateAddress""" - # PROTECTED REGION ID(SKAMaster.test_elementTelStateAddress) ENABLED START # - assert tango_context.device.elementTelStateAddress == "" - # PROTECTED REGION END # // SKAMaster.test_elementTelStateAddress - - # PROTECTED REGION ID(SKAMaster.test_elementDatabaseAddress_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_elementDatabaseAddress_decorators - def test_elementDatabaseAddress(self, tango_context): - """Test for elementDatabaseAddress""" - # PROTECTED REGION ID(SKAMaster.test_elementDatabaseAddress) ENABLED START # - assert tango_context.device.elementDatabaseAddress == "" - # PROTECTED REGION END # // SKAMaster.test_elementDatabaseAddress - - # PROTECTED REGION ID(SKAMaster.test_buildState_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_buildState_decorators - def test_buildState(self, tango_context): - """Test for buildState""" - # PROTECTED REGION ID(SKAMaster.test_buildState) ENABLED START # - buildPattern = re.compile( - r"ska_tango_base, [0-9]+.[0-9]+.[0-9]+, " - r"A set of generic base devices for SKA Telescope" - ) - assert (re.match(buildPattern, tango_context.device.buildState)) is not None - # PROTECTED REGION END # // SKAMaster.test_buildState - - # PROTECTED REGION ID(SKAMaster.test_versionId_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_versionId_decorators - def test_versionId(self, tango_context): - """Test for versionId""" - # PROTECTED REGION ID(SKAMaster.test_versionId) ENABLED START # - versionIdPattern = re.compile(r"[0-9]+.[0-9]+.[0-9]+") - assert (re.match(versionIdPattern, tango_context.device.versionId)) is not None - # PROTECTED REGION END # // SKAMaster.test_versionId - - # PROTECTED REGION ID(SKAMaster.test_healthState_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_healthState_decorators - def test_healthState(self, tango_context): - """Test for healthState""" - # PROTECTED REGION ID(SKAMaster.test_healthState) ENABLED START # - assert tango_context.device.healthState == HealthState.OK - # PROTECTED REGION END # // SKAMaster.test_healthState - - # PROTECTED REGION ID(SKAMaster.test_adminMode_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_adminMode_decorators - def test_adminMode(self, tango_context): - """Test for adminMode""" - # PROTECTED REGION ID(SKAMaster.test_adminMode) ENABLED START # - assert tango_context.device.adminMode == AdminMode.ONLINE - # PROTECTED REGION END # // SKAMaster.test_adminMode - - # PROTECTED REGION ID(SKAMaster.test_controlMode_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_controlMode_decorators - def test_controlMode(self, tango_context): - """Test for controlMode""" - # PROTECTED REGION ID(SKAMaster.test_controlMode) ENABLED START # - assert tango_context.device.controlMode == ControlMode.REMOTE - # PROTECTED REGION END # // SKAMaster.test_controlMode - - # PROTECTED REGION ID(SKAMaster.test_simulationMode_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_simulationMode_decorators - def test_simulationMode(self, tango_context): - """Test for simulationMode""" - # PROTECTED REGION ID(SKAMaster.test_simulationMode) ENABLED START # - assert tango_context.device.simulationMode == SimulationMode.FALSE - # PROTECTED REGION END # // SKAMaster.test_simulationMode - - # PROTECTED REGION ID(SKAMaster.test_testMode_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_testMode_decorators - def test_testMode(self, tango_context): - """Test for testMode""" - # PROTECTED REGION ID(SKAMaster.test_testMode) ENABLED START # - assert tango_context.device.testMode == TestMode.NONE - # PROTECTED REGION END # // SKAMaster.test_testMode - - # PROTECTED REGION ID(SKAMaster.test_maxCapabilities_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_maxCapabilities_decorators - def test_maxCapabilities(self, tango_context): - """Test for maxCapabilities""" - # PROTECTED REGION ID(SKAMaster.test_maxCapabilities) ENABLED START # - assert tango_context.device.maxCapabilities == ("BAND1:1", "BAND2:1") - # PROTECTED REGION END # // SKAMaster.test_maxCapabilities - - # PROTECTED REGION ID(SKAMaster.test_availableCapabilities_decorators) ENABLED START # - # PROTECTED REGION END # // SKAMaster.test_availableCapabilities_decorators - def test_availableCapabilities(self, tango_context): - """Test for availableCapabilities""" - # PROTECTED REGION ID(SKAMaster.test_availableCapabilities) ENABLED START # - assert tango_context.device.availableCapabilities == ("BAND1:1", "BAND2:1") - # PROTECTED REGION END # // SKAMaster.test_availableCapabilities