From 761f429873cb453f244eaf4cad7848e78f9f78c9 Mon Sep 17 00:00:00 2001 From: Giovane Date: Wed, 3 Feb 2016 14:31:52 -0200 Subject: Make load test configurable when invites are disabled --- service/test/load/locustfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'service/test/load') 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): -- cgit v1.2.3