Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
slapos
Commits
12b0e7d0
Commit
12b0e7d0
authored
Jun 08, 2023
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/theia: Add test for ipv6 range
parent
63cce30d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
software/theia/test/test.py
software/theia/test/test.py
+14
-0
No files found.
software/theia/test/test.py
View file @
12b0e7d0
...
@@ -34,6 +34,7 @@ import subprocess
...
@@ -34,6 +34,7 @@ import subprocess
import
sqlite3
import
sqlite3
import
time
import
time
import
netaddr
import
pexpect
import
pexpect
import
psutil
import
psutil
import
requests
import
requests
...
@@ -241,6 +242,19 @@ class TestTheia(TheiaTestCase):
...
@@ -241,6 +242,19 @@ class TestTheia(TheiaTestCase):
self
.
assertIn
(
b'slaprunner'
,
self
.
captureSlapos
(
'proxy'
,
'show'
))
self
.
assertIn
(
b'slaprunner'
,
self
.
captureSlapos
(
'proxy'
,
'show'
))
self
.
assertIn
(
b'slaprunner'
,
self
.
captureSlapos
(
'computer'
,
'list'
))
self
.
assertIn
(
b'slaprunner'
,
self
.
captureSlapos
(
'computer'
,
'list'
))
def
test_ipv6_range
(
self
):
proxy_path
=
self
.
getPath
(
'srv'
,
'runner'
,
'var'
,
'proxy.db'
)
query
=
"SELECT partition_reference, address FROM partition_network%s"
%
DB_VERSION
with
sqlite3
.
connect
(
proxy_path
)
as
db
:
rows
=
db
.
execute
(
query
).
fetchall
()
partitions
=
set
(
p
for
p
,
_
in
rows
)
ipv6
=
set
(
addr
for
_
,
addr
in
rows
if
netaddr
.
valid_ipv6
(
addr
))
# Check that each partition has a different IPv6
self
.
assertEqual
(
len
(
partitions
),
len
(
ipv6
))
# Check that no partition has the same IPv6 as theia
self
.
assertNotIn
(
self
.
connection_parameters
[
'ipv6'
],
ipv6
)
class
TestTheiaWithNonAsciiInstanceName
(
TestTheia
):
class
TestTheiaWithNonAsciiInstanceName
(
TestTheia
):
default_partition_reference
=
'💥'
default_partition_reference
=
'💥'
...
...
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