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
Gwenaël Samain
slapos
Commits
f78e438c
Commit
f78e438c
authored
Sep 26, 2018
by
Guillaume Hervier
Browse files
Options
Browse Files
Download
Plain Diff
software/re6stnet: auto-restart services on SR upgrade.
/reviewed-on
nexedi/slapos!410
parents
2a01586b
508c6c0c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
6 deletions
+50
-6
software/re6stnet/instance-re6stnet.cfg.in
software/re6stnet/instance-re6stnet.cfg.in
+11
-5
software/re6stnet/software.cfg
software/re6stnet/software.cfg
+1
-1
software/re6stnet/test/test.py
software/re6stnet/test/test.py
+38
-0
No files found.
software/re6stnet/instance-re6stnet.cfg.in
View file @
f78e438c
...
...
@@ -80,13 +80,19 @@ wrapper-path = {{ apache_wrapper }}
command-line = "{{ parameter_dict['apache-location'] }}/bin/httpd" -f "${apache-conf:rendered}" -DFOREGROUND
{% if uri_scheme == 'https' %}
[
{{ section('apache-ca') }}
]
[
apache-ca
]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
executable = ${apache-httpd:wrapper-path}
wrapper = ${directory:
services
}/httpd
wrapper = ${directory:
bin
}/httpd
key-file = ${certificate-authority:ca-private}/apache.key
cert-file = ${certificate-authority:ca-certs}/apache.crt
[{{ section('apache-ca-service') }}]
recipe = slapos.cookbook:wrapper
command-line = ${apache-ca:wrapper}
wrapper-path = ${directory:services}/httpd
hash-files = ${buildout:directory}/software_release/buildout.cfg
{% endif %}
[apache-httpd-graceful]
...
...
software/re6stnet/software.cfg
View file @
f78e438c
...
...
@@ -86,7 +86,7 @@ extra-context =
[template-re6stnet]
< = download-base
filename = instance-re6stnet.cfg.in
md5sum =
8c167f2adb2ed36aeaff773f59214981
md5sum =
09683c66c16361b77867d8f2e1140a35
[template-apache-conf]
< = download-base
...
...
software/re6stnet/test/test.py
View file @
f78e438c
...
...
@@ -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