summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorGiovane <giovaneliberato@gmail.com>2016-02-03 14:31:52 -0200
committerGiovane <giovaneliberato@gmail.com>2016-02-03 14:31:58 -0200
commit761f429873cb453f244eaf4cad7848e78f9f78c9 (patch)
tree4a8d9c572ccedc84deb2a3a55db29379a8647bf2 /service
parent18c9144baca1f9b0d3a67cc7f96038d086b847d9 (diff)
Make load test configurable when invites are disabled
Diffstat (limited to 'service')
-rw-r--r--service/test/load/locustfile.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/service/test/load/locustfile.py b/service/test/load/locustfile.py
index 9a83933f..68e39433 100644
--- a/service/test/load/locustfile.py
+++ b/service/test/load/locustfile.py
@@ -13,6 +13,7 @@ LEAP_SERVER_HOST = os.environ.get('LEAP_SERVER_HOST', 'https://api.%s:4430' % LE
LEAP_VERIFY_CERTIFICATE = os.environ.get('LEAP_VERIFY_CERTIFICATE', '~/.leap/ca.crt')
MAX_NUMBER_USER = os.environ.get('MAX_NUMBER_USER', 10000)
INVITES_FILENAME = os.environ.get('INVITES_FILENAME', '/tmp/invite_codes.txt')
+INVITES_ENABLED = os.environ.get('INVITES_ENABLED', 'true') == 'true'
def load_invite_from_number(number):
@@ -32,7 +33,8 @@ class UserBehavior(TaskSet):
try:
srp_auth.authenticate(username, password)
except SRPAuthenticationError:
- srp_auth.register(username, password, load_invite_from_number(number))
+ invite_code = load_invite_from_number(number) if INVITES_ENABLED else None
+ srp_auth.register(username, password, invite_code)
return username, password
def login(self):