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

Merge branch 'master' into L2SS-546-fqdns-in-archiving-functions

parents e6ec1ea5 480cbcdb
Branches
Tags
1 merge request!250Resolve L2SS-546 "Fqdns in archiving functions"
Showing
with 33 additions and 12 deletions
......@@ -26,7 +26,7 @@ endif
# the host.
LOG_HOSTNAME ?= localhost
# If the first make argument is "start" or "stop"...
# If the first make argument is "start", "stop"...
ifeq (start,$(firstword $(MAKECMDGOALS)))
SERVICE_TARGET = true
else ifeq (stop,$(firstword $(MAKECMDGOALS)))
......@@ -48,6 +48,8 @@ else ifeq (attach,$(firstword $(MAKECMDGOALS)))
ifndef TANGO_HOST
$(error TANGO_HOST must specify the Tango database device, e.g., make TANGO_HOST=powersupply-databaseds:10000 ...)
endif
else ifeq (run,$(firstword $(MAKECMDGOALS)))
RUN_TARGET = true
endif
ifdef SERVICE_TARGET
......@@ -55,6 +57,13 @@ ifdef SERVICE_TARGET
SERVICE := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(SERVICE):;@:)
else ifdef RUN_TARGET
# Isolate second argument as service, the rest is arguments for run command
SERVICE := $(wordlist 2, 2, $(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(SERVICE):;@:)
SERVICE_ARGS := $(wordlist 3, $(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(SERVICE_ARGS):;@:)
endif
#
......@@ -131,7 +140,7 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \
DOCKER_GID=$(DOCKER_GID)
.PHONY: up down minimal start stop restart build build-nocache status clean pull help
.PHONY: up down minimal run start stop restart build build-nocache status clean pull help
.DEFAULT_GOAL := help
pull: ## pull the images from the Docker hub
......@@ -150,6 +159,9 @@ build-nocache: ## rebuild images from scratch
up: minimal ## start the base TANGO system and prepare requested services
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) up --no-start --no-recreate $(SERVICE)
run: minimal ## run a service using arguments and delete it afterwards
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) run --rm $(SERVICE) $(SERVICE_ARGS)
down: ## stop all services and tear down the system
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) down
ifneq ($(NETWORK_MODE),host)
......
......@@ -29,3 +29,8 @@ services:
- --strict
- --
- tox --recreate -e integration
command:
# Allow for arguments to be passed that wil be put after the entrypoint
# tox is configured to take these arguments as integration test directory
# specifications.
- ""
......@@ -31,7 +31,6 @@ sleep 60
bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/LOFAR_ConfigDb.json
bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/stations/simulators_ConfigDb.json
bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/stations/dummy_positions_ConfigDb.json
#bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/integration_ConfigDb.json
cd "$LOFAR20_DIR/docker-compose" || exit 1
make start sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim
......@@ -51,5 +50,5 @@ sleep 60
cd "$LOFAR20_DIR/docker-compose" || exit 1
make up integration-test
# Run the integration test with the output displayed on stdout
docker start -a "${CONTAINER_NAME_PREFIX}"integration-test
# Run the default integration tests
make run integration-test default
# Integration Tests
Integration tests are separated into multi modules. Each module requires a
different state and configuration. These configurations are managed externally.
Invocation of individual modules is achieved through tox:
`tox -e integration MODULE_SUBFOLDER`
## Approach
A special docker container is build to perform the integration tests. This
......@@ -7,9 +13,9 @@ container will be build by the makefiles but should only be started by the
dedicated integration test script. This script will ensure that other containers
are running and are in the required state.
* Launch recv-sim and sdptr-sim simulators.
* Launch simulators.
* Reconfigure dsconfig to use these simulators.
* Create and start the integration-test container.
* Create and start the integration-test container for the specific module.
## Running
......@@ -18,8 +24,3 @@ are running and are in the required state.
```shell
sbin/run_integration_test.sh
```
## Limitations
Our makefile will always launch the new container upon creation, resulting in
the integration tests actually being run twice.
......@@ -7,6 +7,7 @@
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
import time
import numpy
import datetime
import json
......@@ -74,6 +75,9 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase):
HBAT_delays_r1 = numpy.array(recv_proxy.read_attribute('HBAT_BF_delay_steps_RW').value)
self.assertIsNotNone(HBAT_delays_r1)
time.sleep(3)
# Verify writing operation does not lead to errors
self.proxy.HBAT_set_pointing(self.pointing_direction) # write values to RECV
HBAT_delays_r2 = numpy.array(recv_proxy.read_attribute('HBAT_BF_delay_steps_RW').value)
self.assertIsNotNone(HBAT_delays_r2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment