Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
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
1
Merge Requests
1
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
Nikola Balog
opcua-asyncio
Commits
78d61807
Commit
78d61807
authored
Nov 09, 2017
by
Mathias Lüdtke
Committed by
oroulet
Nov 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WORKAROUND] enforce IPv4 in travis tests
parent
b6576153
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
19 deletions
+18
-19
tests/tests_client.py
tests/tests_client.py
+3
-3
tests/tests_cmd_lines.py
tests/tests_cmd_lines.py
+2
-2
tests/tests_crypto_connect.py
tests/tests_crypto_connect.py
+2
-2
tests/tests_history.py
tests/tests_history.py
+2
-2
tests/tests_server.py
tests/tests_server.py
+9
-10
No files found.
tests/tests_client.py
View file @
78d61807
...
...
@@ -22,18 +22,18 @@ class TestClient(unittest.TestCase, CommonTests, SubscriptionTests, XmlTests):
def
setUpClass
(
cls
):
# start our own server
cls
.
srv
=
Server
()
cls
.
srv
.
set_endpoint
(
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_num1
))
cls
.
srv
.
set_endpoint
(
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_num1
))
add_server_methods
(
cls
.
srv
)
cls
.
srv
.
start
()
# start admin client
# long timeout since travis (automated testing) can be really slow
cls
.
clt
=
Client
(
'opc.tcp://admin@
localhost
:{0:d}'
.
format
(
port_num1
),
timeout
=
10
)
cls
.
clt
=
Client
(
'opc.tcp://admin@
127.0.0.1
:{0:d}'
.
format
(
port_num1
),
timeout
=
10
)
cls
.
clt
.
connect
()
cls
.
opc
=
cls
.
clt
# start anonymous client
cls
.
ro_clt
=
Client
(
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_num1
))
cls
.
ro_clt
=
Client
(
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_num1
))
cls
.
ro_clt
.
connect
()
@
classmethod
...
...
tests/tests_cmd_lines.py
View file @
78d61807
...
...
@@ -15,7 +15,7 @@ class TestCmdLines(unittest.TestCase):
@
classmethod
def
setUpClass
(
cls
):
cls
.
srv
=
Server
()
cls
.
srv_url
=
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_num
)
cls
.
srv_url
=
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_num
)
cls
.
srv
.
set_endpoint
(
cls
.
srv_url
)
objects
=
cls
.
srv
.
get_objects_node
()
obj
=
objects
.
add_object
(
4
,
"directory"
)
...
...
@@ -44,7 +44,7 @@ class TestCmdLines(unittest.TestCase):
def
test_uadiscover
(
self
):
s
=
subprocess
.
check_output
([
"python"
,
"tools/uadiscover"
,
"--url"
,
self
.
srv_url
])
self
.
assertIn
(
b"opc.tcp://
localhost
"
,
s
)
self
.
assertIn
(
b"opc.tcp://
127.0.0.1
"
,
s
)
self
.
assertIn
(
b"FreeOpcUa"
,
s
)
self
.
assertIn
(
b"urn:freeopcua:python:server"
,
s
)
...
...
tests/tests_crypto_connect.py
View file @
78d61807
...
...
@@ -28,7 +28,7 @@ class TestCryptoConnect(unittest.TestCase):
def
setUpClass
(
cls
):
# start our own server
cls
.
srv_crypto
=
Server
()
cls
.
uri_crypto
=
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_num1
)
cls
.
uri_crypto
=
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_num1
)
cls
.
srv_crypto
.
set_endpoint
(
cls
.
uri_crypto
)
# load server certificate and private key. This enables endpoints
# with signing and encryption.
...
...
@@ -38,7 +38,7 @@ class TestCryptoConnect(unittest.TestCase):
# start a server without crypto
cls
.
srv_no_crypto
=
Server
()
cls
.
uri_no_crypto
=
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_num2
)
cls
.
uri_no_crypto
=
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_num2
)
cls
.
srv_no_crypto
.
set_endpoint
(
cls
.
uri_no_crypto
)
cls
.
srv_no_crypto
.
start
()
...
...
tests/tests_history.py
View file @
78d61807
...
...
@@ -24,10 +24,10 @@ class HistoryCommon(object):
@
classmethod
def
start_server_and_client
(
cls
):
cls
.
srv
=
Server
()
cls
.
srv
.
set_endpoint
(
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_num1
))
cls
.
srv
.
set_endpoint
(
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_num1
))
cls
.
srv
.
start
()
cls
.
clt
=
Client
(
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_num1
))
cls
.
clt
=
Client
(
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_num1
))
cls
.
clt
.
connect
()
@
classmethod
...
...
tests/tests_server.py
View file @
78d61807
...
...
@@ -31,13 +31,13 @@ class TestServer(unittest.TestCase, CommonTests, SubscriptionTests, XmlTests):
@
classmethod
def
setUpClass
(
cls
):
cls
.
srv
=
Server
()
cls
.
srv
.
set_endpoint
(
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_num
))
cls
.
srv
.
set_endpoint
(
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_num
))
add_server_methods
(
cls
.
srv
)
cls
.
srv
.
start
()
cls
.
opc
=
cls
.
srv
cls
.
discovery
=
Server
()
cls
.
discovery
.
set_application_uri
(
"urn:freeopcua:python:discovery"
)
cls
.
discovery
.
set_endpoint
(
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_discovery
))
cls
.
discovery
.
set_endpoint
(
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_discovery
))
cls
.
discovery
.
start
()
@
classmethod
...
...
@@ -200,7 +200,7 @@ class TestServer(unittest.TestCase, CommonTests, SubscriptionTests, XmlTests):
self
.
assertEqual
(
ev
.
ServerId
,
None
)
self
.
assertEqual
(
ev
.
ClientAuditEntryId
,
None
)
self
.
assertEqual
(
ev
.
ClientUserId
,
None
)
def
test_get_event_from_type_node_MultiInhereted_AuditOpenSecureChannelEvent
(
self
):
ev
=
opcua
.
common
.
events
.
get_event_obj_from_type_node
(
opcua
.
Node
(
self
.
opc
.
iserver
.
isession
,
ua
.
NodeId
(
ua
.
ObjectIds
.
AuditOpenSecureChannelEventType
)))
self
.
assertIsNot
(
ev
,
None
)
...
...
@@ -293,7 +293,7 @@ class TestServer(unittest.TestCase, CommonTests, SubscriptionTests, XmlTests):
self
.
assertEqual
(
ev
.
ServerId
,
None
)
self
.
assertEqual
(
ev
.
ClientAuditEntryId
,
None
)
self
.
assertEqual
(
ev
.
ClientUserId
,
None
)
def
test_eventgenerator_MultiInheritedEvent
(
self
):
evgen
=
self
.
opc
.
get_event_generator
(
ua
.
ObjectIds
.
AuditOpenSecureChannelEventType
)
check_eventgenerator_SourceServer
(
self
,
evgen
)
...
...
@@ -561,22 +561,21 @@ class TestServerCaching(unittest.TestCase):
self
.
assertEqual
(
server
.
get_node
(
id
).
get_value
(),
123
)
os
.
remove
(
path
)
class
TestServerStartError
(
unittest
.
TestCase
):
def
test_port_in_use
(
self
):
server1
=
Server
()
server1
.
set_endpoint
(
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_num
+
1
))
server1
.
set_endpoint
(
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_num
+
1
))
server1
.
start
()
server2
=
Server
()
server2
.
set_endpoint
(
'opc.tcp://
localhost
:{0:d}'
.
format
(
port_num
+
1
))
server2
.
set_endpoint
(
'opc.tcp://
127.0.0.1
:{0:d}'
.
format
(
port_num
+
1
))
try
:
server2
.
start
()
except
Exception
:
pass
server1
.
stop
()
server2
.
stop
()
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