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
Cédric Le Ninivin
slapos
Commits
508c6c0c
Commit
508c6c0c
authored
Oct 18, 2018
by
Guillaume Hervier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/re6stnet: Add test for services auto-restart.
parent
96c1515d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
software/re6stnet/test/test.py
software/re6stnet/test/test.py
+38
-0
No files found.
software/re6stnet/test/test.py
View file @
508c6c0c
...
...
@@ -81,3 +81,41 @@ class TestPortRedirection(Re6stnetTestCase):
'srcPort'
:
9201
,
'destPort'
:
9201
,
},
portredir_config
[
0
])
class
ServicesTestCase
(
Re6stnetTestCase
):
@
staticmethod
def
generateHashFromFiles
(
file_list
):
import
hashlib
hasher
=
hashlib
.
md5
()
for
path
in
file_list
:
with
open
(
path
,
'r'
)
as
afile
:
buf
=
afile
.
read
()
hasher
.
update
(
"%s
\
n
"
%
len
(
buf
))
hasher
.
update
(
buf
)
hash
=
hasher
.
hexdigest
()
return
hash
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'uri-scheme'
:
'https'
}
def
test_hashes
(
self
):
hash_files
=
[
'software_release/buildout.cfg'
,
]
expected_process_names
=
[
'httpd-{hash}-on-watch'
,
]
supervisor
=
self
.
getSupervisorRPCServer
().
supervisor
process_names
=
[
process
[
'name'
]
for
process
in
supervisor
.
getAllProcessInfo
()]
hash_files
=
[
os
.
path
.
join
(
self
.
computer_partition_root_path
,
path
)
for
path
in
hash_files
]
for
name
in
expected_process_names
:
h
=
ServicesTestCase
.
generateHashFromFiles
(
hash_files
)
expected_process_name
=
name
.
format
(
hash
=
h
)
self
.
assertIn
(
expected_process_name
,
process_names
)
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