Skip to content
Snippets Groups Projects
Commit c6fcb1cf authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

Merge branch 'master' into L2SS-871-update-hdf5-writer

parents 11527e81 e36e3b70
Branches
No related tags found
1 merge request!407Resolve L2SS-871 "update-hdf5-writer"
...@@ -529,6 +529,7 @@ unit_test: ...@@ -529,6 +529,7 @@ unit_test:
- tangostationcontrol/.coverage - tangostationcontrol/.coverage
integration_test_docker: integration_test_docker:
stage: integration-tests stage: integration-tests
allow_failure: true
image: docker:latest image: docker:latest
tags: tags:
- privileged - privileged
...@@ -551,6 +552,7 @@ integration_test_docker: ...@@ -551,6 +552,7 @@ integration_test_docker:
tag="$CI_COMMIT_REF_SLUG" tag="$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi fi
- apk update
- apk add --update make bash docker-compose - apk add --update make bash docker-compose
- apk add --update bind-tools - apk add --update bind-tools
- apk add --update postgresql14-client gzip - apk add --update postgresql14-client gzip
......
...@@ -92,19 +92,6 @@ ...@@ -92,19 +92,6 @@
} }
} }
}, },
"DigitalBeam": {
"STAT": {
"DigitalBeam": {
"STAT/DigitalBeam/1": {
"properties": {
"Tracking_enabled_RW_default": [
"False"
]
}
}
}
}
},
"Beamlet": { "Beamlet": {
"STAT": { "STAT": {
"Beamlet": { "Beamlet": {
...@@ -168,6 +155,13 @@ ...@@ -168,6 +155,13 @@
"RECV_devices": [ "RECV_devices": [
"STAT/RECV/1" "STAT/RECV/1"
], ],
"Antenna_Names": [
"C0",
"C1",
"C2",
"C3",
"C4"
],
"HBAT_Control_to_RECV_mapping": [ "HBAT_Control_to_RECV_mapping": [
"1","27", "1","27",
"0","-1", "0","-1",
...@@ -211,6 +205,17 @@ ...@@ -211,6 +205,17 @@
"RECV_devices": [ "RECV_devices": [
"STAT/RECV/1" "STAT/RECV/1"
], ],
"Antenna_Names": [
"LBA1",
"LBA2",
"LBA3",
"LBA4",
"LBA5",
"LBA6",
"LBA7",
"LBA8",
"LBA9"
],
"HBAT_Control_to_RECV_mapping": [ "HBAT_Control_to_RECV_mapping": [
"1","1", "1","1",
"1","3", "1","3",
...@@ -234,7 +239,9 @@ ...@@ -234,7 +239,9 @@
"1","17" "1","17"
], ],
"Antenna_Field_Reference_ETRS": [ "Antenna_Field_Reference_ETRS": [
"3839358.189", "430354.482", "5057967.804" "3839358.189",
"430354.482",
"5057967.804"
], ],
"HBAT_reference_ETRS": [ "HBAT_reference_ETRS": [
"3839358.189","430354.482","5057967.804", "3839358.189","430354.482","5057967.804",
...@@ -302,6 +309,9 @@ ...@@ -302,6 +309,9 @@
"-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1",
"-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1",
"-1", "-1", "-1", "-1", "-1", "-1" "-1", "-1", "-1", "-1", "-1", "-1"
],
"Tracking_enabled_RW_default": [
"False"
] ]
} }
} }
...@@ -555,7 +565,9 @@ ...@@ -555,7 +565,9 @@
"PSOC": { "PSOC": {
"STAT/PSOC/1": { "STAT/PSOC/1": {
"properties": { "properties": {
"SNMP_host": ["10.87.2.145"], "SNMP_host": [
"10.87.2.145"
],
"PSOC_sockets": [ "PSOC_sockets": [
"ccd_socket", "ccd_socket",
"sdptr0_socket", "sdptr0_socket",
...@@ -576,7 +588,9 @@ ...@@ -576,7 +588,9 @@
"PCON": { "PCON": {
"STAT/PCON/1": { "STAT/PCON/1": {
"properties": { "properties": {
"SNMP_host": ["10.151.225.5"] "SNMP_host": [
"10.151.225.5"
]
} }
} }
} }
......
...@@ -150,7 +150,8 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \ ...@@ -150,7 +150,8 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \
CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) \ CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) \
COMPOSE_IGNORE_ORPHANS=true \ COMPOSE_IGNORE_ORPHANS=true \
CONTAINER_EXECUTION_UID=$(shell id -u) \ CONTAINER_EXECUTION_UID=$(shell id -u) \
DOCKER_GID=$(DOCKER_GID) DOCKER_GID=$(DOCKER_GID) \
TEST_MODULE=$(INTEGRATION_MODULE)
.PHONY: up down minimal context run integration start stop restart build build-nocache status clean pull help .PHONY: up down minimal context run integration start stop restart build build-nocache status clean pull help
...@@ -174,7 +175,7 @@ run: minimal ## run a service using arguments and delete it afterwards ...@@ -174,7 +175,7 @@ run: minimal ## run a service using arguments and delete it afterwards
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) run --no-deps --rm $(SERVICE) $(SERVICE_ARGS) $(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) run --no-deps --rm $(SERVICE) $(SERVICE_ARGS)
integration: minimal ## run a service using arguments and delete it afterwards integration: minimal ## run a service using arguments and delete it afterwards
TEST_MODULE=$(INTEGRATION_MODULE) $(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) run --no-deps --rm integration-test $(INTEGRATION_ARGS) $(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) run --no-deps --rm integration-test $(INTEGRATION_ARGS)
down: ## stop all services and tear down the system down: ## stop all services and tear down the system
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) down $(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) down
......
...@@ -24,12 +24,16 @@ function integration_test { ...@@ -24,12 +24,16 @@ function integration_test {
IFS=" " read -r -a restarts <<< "${2}" IFS=" " read -r -a restarts <<< "${2}"
IFS=" " read -r -a configs <<< "${3}" IFS=" " read -r -a configs <<< "${3}"
for config in "${configs[@]}"; do for config in "${configs[@]}"; do
echo "Updating config ${config} ..."
bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${config}" bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${config}"
done done
if [ ! -z "${2+x}" ]; then if [ ! -z "${2+x}" ]; then
# shellcheck disable=SC2145
echo "make restart ${restarts[@]} ..."
make restart "${restarts[@]}" make restart "${restarts[@]}"
fi fi
sleep 5 sleep 5
echo "make integration ${1} ..."
make integration "${1}" make integration "${1}"
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# order of appearance. Changing the order has an impact on the overall # order of appearance. Changing the order has an impact on the overall
# integration process, which may cause wedges in the gate later. # integration process, which may cause wedges in the gate later.
lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client@0.4.0 lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client@0.6.0
asyncua >= 0.9.90 # LGPLv3 asyncua >= 0.9.90 # LGPLv3
PyMySQL[rsa] >= 1.0.2 # MIT PyMySQL[rsa] >= 1.0.2 # MIT
psycopg2-binary >= 2.9.2 # LGPL psycopg2-binary >= 2.9.2 # LGPL
......
...@@ -85,6 +85,14 @@ class AntennaField(lofar_device): ...@@ -85,6 +85,14 @@ class AntennaField(lofar_device):
calculated, as well as the geohash. calculated, as well as the geohash.
""" """
# ----- Antenna names
Antenna_Names = device_property(
doc="Name of each antenna",
dtype='DevVarStringArray',
mandatory=False
)
# ----- Antenna states # ----- Antenna states
Antenna_Quality = device_property( Antenna_Quality = device_property(
...@@ -195,6 +203,8 @@ class AntennaField(lofar_device): ...@@ -195,6 +203,8 @@ class AntennaField(lofar_device):
default_value = [] default_value = []
) )
Antenna_Names_R = attribute(access=AttrWriteType.READ,
dtype=(str,), max_dim_x=MAX_NUMBER_OF_HBAT)
Antenna_Quality_R = attribute(access=AttrWriteType.READ, Antenna_Quality_R = attribute(access=AttrWriteType.READ,
dtype=(numpy.uint16,), max_dim_x=MAX_NUMBER_OF_HBAT) dtype=(numpy.uint16,), max_dim_x=MAX_NUMBER_OF_HBAT)
Antenna_Use_R = attribute(access=AttrWriteType.READ, Antenna_Use_R = attribute(access=AttrWriteType.READ,
...@@ -247,6 +257,9 @@ class AntennaField(lofar_device): ...@@ -247,6 +257,9 @@ class AntennaField(lofar_device):
doc='Number of HBAT in this field', doc='Number of HBAT in this field',
dtype=numpy.int32) dtype=numpy.int32)
def read_Antenna_Names_R(self):
return self.Antenna_Names
def read_Antenna_Use_R(self): def read_Antenna_Use_R(self):
return self.Antenna_Use return self.Antenna_Use
......
...@@ -389,3 +389,11 @@ class TestAntennafieldDevice(device_base.DeviceTestCase): ...@@ -389,3 +389,11 @@ class TestAntennafieldDevice(device_base.DeviceTestCase):
antenna_properties = {'Antenna_Quality': antenna_qualities, 'Antenna_Use': antenna_use} antenna_properties = {'Antenna_Quality': antenna_qualities, 'Antenna_Use': antenna_use}
with DeviceTestContext(antennafield.AntennaField, properties={**self.AT_PROPERTIES, **antenna_properties}, process=True) as proxy: with DeviceTestContext(antennafield.AntennaField, properties={**self.AT_PROPERTIES, **antenna_properties}, process=True) as proxy:
numpy.testing.assert_equal(numpy.array([True] + [False] * 95), proxy.Antenna_Usage_Mask_R) numpy.testing.assert_equal(numpy.array([True] + [False] * 95), proxy.Antenna_Usage_Mask_R)
def test_read_Antenna_Names(self):
""" Verify if Antenna_Names_R is correctly retrieved """
antenna_names = ["C0","C1","C2","C3","C4"]
antenna_properties = {'Antenna_Names' : antenna_names}
with DeviceTestContext(antennafield.AntennaField, properties={**self.AT_PROPERTIES, **antenna_properties}, process=True) as proxy:
for i in range(len(antenna_names)):
self.assertTrue(proxy.Antenna_Names_R[i]==f"C{i}")
...@@ -29,12 +29,14 @@ commands = {envpython} -m stestr run {posargs} ...@@ -29,12 +29,14 @@ commands = {envpython} -m stestr run {posargs}
[testenv:integration] [testenv:integration]
; Warning running integration tests will make changes to your docker system! ; Warning running integration tests will make changes to your docker system!
; These tests should only be run by the integration-test docker container. ; These tests should only be run by the integration-test docker container.
allowlist_externals = echo
passenv = TANGO_HOST passenv = TANGO_HOST
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
TESTS_DIR=./tangostationcontrol/integration_test/{env:TEST_MODULE:default} TESTS_DIR=./tangostationcontrol/integration_test/{env:TEST_MODULE:default}
PYTHON={envpython} -m coverage run --source tangostationcontrol --parallel-mode PYTHON={envpython} -m coverage run --source tangostationcontrol --parallel-mode
commands = commands =
echo "Integration test directory configured for{env:TESTS_DIR} ({env:TEST_MODULE})"
{envpython} -m stestr run --serial {posargs} {envpython} -m stestr run --serial {posargs}
{envpython} -m coverage combine {envpython} -m coverage combine
{envpython} -m coverage html --omit='*test*' -d cover {envpython} -m coverage html --omit='*test*' -d cover
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment