Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
osie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Manchev
osie
Commits
a48d76c0
Commit
a48d76c0
authored
Dec 03, 2021
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add skeleton for testing.
parent
55b96500
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
tests/test.py
tests/test.py
+14
-4
No files found.
tests/test.py
View file @
a48d76c0
"""
OPC-UA test agent used for testing of PLC program here: https://lab.nexedi.com/nexedi/osie/tree/master/Beremiz/beremiz_test_opc_ua
XXX:
- add asserts
"""
from
opcua
import
Client
import
time
client
=
Client
(
"opc.tcp://k2-osie:4840/"
)
...
...
@@ -8,9 +14,13 @@ try:
# Client has a few methods to get proxy to UA nodes that should always be in address space such as Root or Objects
root
=
client
.
get_root_node
()
children_list
=
root
.
get_children
()
for
i
in
range
(
0
,
10
):
var
=
client
.
get_node
(
"ns=1;s=i2c0.relay0"
)
i2c0_relay0
=
var
.
get_value
()
# XXX: do asserts here
print
i2c0_relay0
print
"sleep"
time
.
sleep
(
5
)
finally
:
client
.
disconnect
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment