Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
cd6fbdaf
Commit
cd6fbdaf
authored
2 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
added unit test for docker device
parent
e1bc4227
No related branches found
No related tags found
1 merge request
!434
Resolve L2SS-982 "Update docker device"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/test/devices/test_device_docker.py
+47
-0
47 additions, 0 deletions
...ol/tangostationcontrol/test/devices/test_device_docker.py
with
47 additions
and
0 deletions
tangostationcontrol/tangostationcontrol/test/devices/test_device_docker.py
0 → 100644
+
47
−
0
View file @
cd6fbdaf
# -*- 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.test_context
import
DeviceTestContext
from
tangostationcontrol.devices
import
docker_device
import
numpy
from
tangostationcontrol.test.devices
import
device_base
class
TestDockerDevice
(
device_base
.
DeviceTestCase
):
DOCKER_PROPERTIES
=
{
'
Docker_Base_URL
'
:
"
unix:///var/run/docker.sock
"
}
def
setUp
(
self
):
# DeviceTestCase setUp patches lofar_device DeviceProxy
super
(
TestDockerDevice
,
self
).
setUp
()
def
test_read
(
self
):
"""
Test whether the device-docker container is running
"""
with
DeviceTestContext
(
docker_device
.
Docker
,
properties
=
self
.
DOCKER_PROPERTIES
,
process
=
True
)
as
proxy
:
self
.
assertEqual
(
proxy
.
device_docker_R
,
True
)
def
test_toggle
(
self
):
"""
Test turning off and on a running docker container
"""
with
DeviceTestContext
(
docker_device
.
Docker
,
properties
=
self
.
DOCKER_PROPERTIES
,
process
=
True
)
as
proxy
:
# Turn the recv container off and check that it is indeed turned off
proxy
.
device_recv_RW
=
False
self
.
assertEqual
(
self
.
device_recv_R
,
False
)
# Turn the recv container on and check that it is indeed turned on
proxy
.
device_recv_RW
=
True
self
.
assertEqual
(
self
.
device_recv_R
,
True
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment