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
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
Justin
slapos
Commits
eeb548a6
Commit
eeb548a6
authored
Jun 04, 2021
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Plain Diff
software/re6stnet: Fix slave instance parameters passing and add test
See merge request
nexedi/slapos!983
parents
3c211d70
264bd051
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
16 deletions
+43
-16
component/faketime/buildout.cfg
component/faketime/buildout.cfg
+2
-4
software/re6stnet/buildout.hash.cfg
software/re6stnet/buildout.hash.cfg
+2
-2
software/re6stnet/instance-re6stnet.cfg.in
software/re6stnet/instance-re6stnet.cfg.in
+4
-9
software/re6stnet/instance.cfg.in
software/re6stnet/instance.cfg.in
+1
-0
software/re6stnet/test/test.py
software/re6stnet/test/test.py
+33
-0
stack/slapos.cfg
stack/slapos.cfg
+1
-1
No files found.
component/faketime/buildout.cfg
View file @
eeb548a6
...
...
@@ -6,11 +6,9 @@ parts = faketime
[faketime]
recipe = slapos.recipe.cmmi
url = http
://www.code-wizards.com/projects/libfaketime/libfaketime-0.9.1
.tar.gz
md5sum =
ce3f996dfd5826b4ac62f1a7cc36ea27
url = http
s://github.com/wolfcw/libfaketime/archive/refs/tags/v0.9.9
.tar.gz
md5sum =
1f784c9c0ec7807b9d1107d1730dbb41
configure-command = true
make-options =
PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
make-binary = make -e -C src
make-targets = install
post-install = sed -i -e "16c\FTPL_PATH=${buildout:parts-directory}/${:_buildout_section_name_}/lib/faketime" ${buildout:parts-directory}/${:_buildout_section_name_}/bin/faketime
software/re6stnet/buildout.hash.cfg
View file @
eeb548a6
...
...
@@ -14,11 +14,11 @@
# not need these here).
[template]
filename = instance.cfg.in
md5sum =
01938aa1683b7994f814fff6d964b9ba
md5sum =
71531ed9c9b79fa769ab367e7ea2d2a5
[template-re6stnet]
filename = instance-re6stnet.cfg.in
md5sum =
4e4475c8ef80a3a53aa63a2ae444586d
md5sum =
2309889cf3f5bc57ba63d389e662fc21
[template-apache-conf]
filename = apache.conf.in
...
...
software/re6stnet/instance-re6stnet.cfg.in
View file @
eeb548a6
{% set bin_directory = parameter_dict['bin-directory'] -%}
{% set python_bin = parameter_dict['python-executable'] -%}
{% set publish_dict = {} -%}
{% set ipv6 = (ipv6_set | list)[0] -%}
{% set ipv4 = (ipv4_set | list)[0] -%}
...
...
@@ -136,8 +135,7 @@ db-path = ${re6st-registry-conf-dict:db}
key-file = ${re6st-registry-conf-dict:key}
cert-file = ${re6st-registry-conf-dict:ca}
dh-file = ${re6st-registry-conf-dict:dh}
slave-instance-list = {{ slapparameter_dict.get('slave_instance_list', '{}') }}
slave-instance-list = {{ dumps(slave_instance_list) }}
environment =
PATH={{ openssl_bin }}
...
...
@@ -184,15 +182,12 @@ name = apache-re6st-registry.py
config-hostname = ${apache-conf:ipv6}
config-port = ${apache-conf:port}
{% do publish_dict.__setitem__('re6stry-url', 'http://[${apache-conf:ipv6}]:${apache-conf:port}') -%}
{% do publish_dict.__setitem__('re6stry-local-url', 'http://${re6st-registry:ipv4}:${re6st-registry:port}/') -%}
{% do publish_dict.__setitem__('slave-amount', '${re6st-registry:slave-amount}') -%}
[publish]
recipe = slapos.cookbook:publish
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
{% for name, value in publish_dict.items() -%
}
{{ name }} = {{ value }
}
{% endfor -%
}
slave-amount = {{ len(slave_instance_list) }
}
re6stry-url = http://[${apache-conf:ipv6}]:${apache-conf:port
}
re6stry-local-url = http://${re6st-registry:ipv4}:${re6st-registry:port
}
[buildout]
extends =
...
...
software/re6stnet/instance.cfg.in
View file @
eeb548a6
...
...
@@ -40,6 +40,7 @@ extensions = jinja2.ext.do
extra-context =
section parameter_dict dynamic-template-re6stnet-parameters
raw monitor2_template_rendered {{ monitor2_template_rendered }}
key slave_instance_list slap-configuration:slave-instance-list
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
...
...
software/re6stnet/test/test.py
View file @
eeb548a6
...
...
@@ -26,10 +26,12 @@
##############################################################################
import
os
import
time
import
requests
import
json
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
from
slapos.testing.utils
import
CrontabMixin
setUpModule
,
Re6stnetTestCase
=
makeModuleSetUpAndTestCaseClass
(
os
.
path
.
abspath
(
...
...
@@ -56,3 +58,34 @@ class TestPortRedirection(Re6stnetTestCase):
'srcPort'
:
9201
,
'destPort'
:
9201
,
},
portredir_config
[
0
])
class
TestTokens
(
Re6stnetTestCase
,
CrontabMixin
):
partition_reference
=
"SOFTINST-1"
@
classmethod
def
requestDefaultInstance
(
cls
,
state
=
'started'
):
default_instance
=
super
(
Re6stnetTestCase
,
cls
).
requestDefaultInstance
(
state
=
state
)
cls
.
requestSlaveInstance
()
return
default_instance
@
classmethod
def
requestSlaveInstance
(
cls
):
software_url
=
cls
.
getSoftwareURL
()
cls
.
logger
.
debug
(
'requesting slave "%s"'
,
cls
.
partition_reference
)
return
cls
.
slap
.
request
(
software_release
=
software_url
,
partition_reference
=
cls
.
partition_reference
,
partition_parameter_kw
=
{},
shared
=
True
,
)
def
test_tokens
(
self
):
self
.
_executeCrontabAtDate
(
're6stnet-check-token'
,
'+10min'
)
self
.
slap
.
waitForInstance
()
# Wait until publish is done
s
=
self
.
requestSlaveInstance
()
self
.
assertEqual
(
"Token is ready for use"
,
s
.
getConnectionParameterDict
()[
'1_info'
])
stack/slapos.cfg
View file @
eeb548a6
...
...
@@ -189,7 +189,7 @@ scandir = 1.10.0
setuptools-dso = 1.7
rubygemsrecipe = 0.3.0
six = 1.12.0
slapos.cookbook = 1.0.1
84
slapos.cookbook = 1.0.1
97
slapos.core = 1.6.13
slapos.extension.strip = 0.4
slapos.extension.shared = 1.0
...
...
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