Commit 24e30be2 authored by Alain Takoudjou's avatar Alain Takoudjou

allow to set root password during installation for tests

parent 39bab215
Pipeline #34301 failed with stage
in 0 seconds
...@@ -54,7 +54,7 @@ md5sum = d769ea27820e932c596c35bbbf3f2902 ...@@ -54,7 +54,7 @@ md5sum = d769ea27820e932c596c35bbbf3f2902
[instance-gitlab.cfg.in] [instance-gitlab.cfg.in]
_update_hash_filename_ = instance-gitlab.cfg.in _update_hash_filename_ = instance-gitlab.cfg.in
md5sum = d63a14446f52e147c734a0a285cb4f09 md5sum = 9b741e61a5a8a86efbc2c0334de107a0
[instance-gitlab-export.cfg.in] [instance-gitlab-export.cfg.in]
_update_hash_filename_ = instance-gitlab-export.cfg.in _update_hash_filename_ = instance-gitlab-export.cfg.in
......
...@@ -628,6 +628,10 @@ wrapper-path = ${directory:service}/puma ...@@ -628,6 +628,10 @@ wrapper-path = ${directory:service}/puma
# Those operations require PG and Redis to be up and running already, that's # Those operations require PG and Redis to be up and running already, that's
# why we do it here. See gitlab-puma-startup for details. # why we do it here. See gitlab-puma-startup for details.
command-line = ${gitlab-puma-startup:output} command-line = ${gitlab-puma-startup:output}
{% if instance_parameter_dict.get('root-password') -%}
environment =
GITLAB_ROOT_PASSWORD={{ instance_parameter_dict['root-password'] }}
{% endif %}
depend = depend =
${promise-puma:recipe} ${promise-puma:recipe}
......
...@@ -46,6 +46,10 @@ class TestGitlab(SlapOSInstanceTestCase): ...@@ -46,6 +46,10 @@ class TestGitlab(SlapOSInstanceTestCase):
def getInstanceSoftwareType(cls): def getInstanceSoftwareType(cls):
return 'gitlab' return 'gitlab'
@classmethod
def getInstanceParameterDict(cls):
return {'root-password': 'admin1234'}
def setUp(self): def setUp(self):
self.backend_url = self.computer_partition.getConnectionParameterDict( self.backend_url = self.computer_partition.getConnectionParameterDict(
)['backend_url'] )['backend_url']
...@@ -79,8 +83,8 @@ class TestGitlab(SlapOSInstanceTestCase): ...@@ -79,8 +83,8 @@ class TestGitlab(SlapOSInstanceTestCase):
verify=False) verify=False)
for _ in range(10): for _ in range(10):
sign_in(headers={'X_FORWARDED_FOR': '1.2.3.4'}) sign_in(headers={'X-Forwarded-For': '1.2.3.4'})
# after 10 authentication failures, this client is rate limited # after 10 authentication failures, this client is rate limited
self.assertEqual(sign_in(headers={'X_FORWARDED_FOR': '1.2.3.4'}).status_code, 429) self.assertEqual(sign_in(headers={'X-Forwarded-For': '1.2.3.4'}).status_code, 429)
# but other clients are not # but other clients are not
self.assertNotEqual(sign_in(headers={'X_FORWARDED_FOR': '5.6.7.8'}).status_code, 429) self.assertNotEqual(sign_in(headers={'X-Forwarded-For': '5.6.7.8'}).status_code, 429)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment