Skip to content
Snippets Groups Projects
Commit f0f1197b authored by Jasper Annyas's avatar Jasper Annyas
Browse files

L2SS-275:Added and tested the UNB2 simulator

parent 7405dc94
No related branches found
No related tags found
1 merge request!121Resolve L2SS-275 "Add UNB2 simulator and integration test"
......@@ -59,6 +59,25 @@
}
}
}
},
"UNB2": {
"LTS": {
"UNB2": {
"LTS/UNB2/1": {
"properties": {
"OPC_Server_Name": [
"despi.astron.nl"
],
"OPC_Server_Port": [
"4842"
],
"OPC_Time_Out": [
"5.0"
]
}
}
}
}
}
}
}
# -*- coding: utf-8 -*-
#
# This file is part of the LOFAR 2.0 Station Software
#
#
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
import time
from tango import DeviceProxy
from tango._tango import DevState
from integration_test import base
class TestDeviceUNB2(base.IntegrationTestCase):
def setUp(self):
"""Intentionally recreate the device object in each test"""
super(TestDeviceUNB2, self).setUp()
def tearDown(self):
"""Turn device Off in teardown to prevent blocking tests"""
d = DeviceProxy("LTS/UNB2/1")
try:
d.Off()
except Exception as e:
"""Failing to turn Off devices should not raise errors here"""
print(f"Failed to turn device off in teardown {e}")
def test_device_proxy_unb2(self):
"""Test if we can successfully create a DeviceProxy and fetch state"""
d = DeviceProxy("LTS/UNB2/1")
self.assertEqual(DevState.OFF, d.state())
def test_device_unb2_initialize(self):
"""Test if we can transition to standby"""
d = DeviceProxy("LTS/UNB2/1")
d.initialise()
self.assertEqual(DevState.STANDBY, d.state())
def test_device_unb2_on(self):
"""Test if we can transition to on"""
d = DeviceProxy("LTS/UNB2/1")
d.initialise()
d.on()
self.assertEqual(DevState.ON, d.state())
......@@ -126,8 +126,8 @@ pull: ## pull the images from the Docker hub
build: ## rebuild images
# docker-compose does not support build dependencies, so manage those here
$(DOCKER_COMPOSE_ARGS) docker-compose -f lofar-device-base.yml -f networks.yml build
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) build
$(DOCKER_COMPOSE_ARGS) docker-compose -f lofar-device-base.yml -f networks.yml build --progress=plain
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) build --progress=plain
up: minimal ## start the base TANGO system and prepare all services
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) up --no-start
......
This diff is collapsed.
......@@ -8,7 +8,7 @@ fi
# Start all required containers
cd "$LOFAR20_DIR/docker-compose" || exit 1
make start databaseds dsconfig device-sdp device-pcc jupyter elk sdptr-sim pypcc-sim
make start databaseds dsconfig device-sdp device-pcc jupyter elk sdptr-sim pypcc-sim unb2-sim
# Update the dsconfig
cd "$TANGO_LOFAR_LOCAL_DIR" || exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment