Skip to content
Snippets Groups Projects
Commit 23c5d564 authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-240: Split basic integration tasks out across files

parent 4f9c603f
Branches
Tags
1 merge request!89Resolve L2SS-240 "Integration testing"
......@@ -37,10 +37,13 @@ unit_test:
- tox -e py37
integration_test:
stage: integration-tests
allow_failure: true
services:
- name: docker:20.10.8-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
# Everything below does not work currently, we need a privileged container
# that can run the dind service
before_script:
- sudo apt update
- sudo apt install -y docker.io
......
# Integration tests
**Warning running these tests will make changes to your local system**
# Integration Tests
## Approach
......@@ -9,10 +7,21 @@ 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.
[comment]: <> (#TODO&#40;Corne&#41;: Change pypcc-sim name to apsct-sim name once changed!)
* Launch pypcc-sim and sdptr-sim simulators.
* Reconfigure dsconfig to use these simulators.
* Create and start the integration-test container.
## Running
**Warning running these tests will make changes to your local system!**
```shell
source bootstrap/etc/lofar20rc.sh
$LOFAR20_DIR/sbin/run_integration_test.sh
```
## Limitations
Our makefile will always launch the new container upon creation, resulting in
......
# -*- 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.
from opcua import Client
from integration_test import base
class TestAPSCTSim(base.IntegrationTestCase):
def setUp(self):
super(TestAPSCTSim, self).setUp()
def test_opcua_connection(self):
"""Check if we can connect to apsct-sim"""
#TODO(Corne): Replace to APSCT name once simulator name has changed
client = Client("opc.tcp://pypcc-sim:4842")
root_node = None
try:
client.connect()
root_node = client.get_root_node()
finally:
client.disconnect()
self.assertNotEqual(None, root_node)
# -*- 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.
from opcua import Client
from integration_test import base
class TestSDPTRSim(base.IntegrationTestCase):
def setUp(self):
super(TestSDPTRSim, self).setUp()
def test_opcua_connection(self):
"""Check if we can connect to sdptr-sim"""
client = Client("opc.tcp://sdptr-sim:4840")
root_node = None
try:
client.connect()
root_node = client.get_root_node()
finally:
client.disconnect()
self.assertNotEqual(None, root_node)
# -*- 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.
from tango import DeviceProxy
from tango._tango import DevState
from integration_test import base
class TestDeviceAPSCT(base.IntegrationTestCase):
def setUp(self):
super(TestDeviceAPSCT, self).setUp()
def test_device_proxy_apsct(self):
"""Test if we can successfully create a DeviceProxy and fetch state"""
#TODO(Corne): Change name to APSCT once ready
d = DeviceProxy("LTS/PCC/1")
self.assertEqual(DevState.OFF, d.state())
......@@ -8,17 +8,19 @@
# See LICENSE.txt for more info.
from tango import DeviceProxy
from tango._tango import DevState
from integration_test import base
class TestDevice(base.IntegrationTestCase):
class TestDeviceSDP(base.IntegrationTestCase):
def setUp(self):
super(TestDevice, self).setUp()
super(TestDeviceSDP, self).setUp()
def test_device_proxy_sdp(self):
"""Test if we can successfully create a DeviceProxy and fetch state"""
def test_device(self):
d = DeviceProxy("LTS/SDP/1")
self.assertEqual("ON", d.state())
self.assertEqual(DevState.OFF, d.state())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment