@@ -0,0 +1,2090 @@
+from time import sleep%0A%0Aimport locust%0Aimport json%0A%0A%0Aclass Authenticate(locust.TaskSet):%0A%0A    @locust.task%0A    def authenticate(self):%0A        # Set header information and path%0A        headers = %7B'content-type': 'application/json'%7D%0A        path = '/v3/auth/tokens'%0A        # Build authentication request with an existing user. This will be%0A        # an unscoped token request.%0A        request = %7B%0A            'auth': %7B%0A                'identity': %7B%0A                    'methods': %5B%0A                        'password'%0A                    %5D,%0A                    'password': %7B%0A                        'user': %7B%0A                            'id': '9fff846eb28442418612b94fccda9264',%0A                            'password': 'sup3rs3cr3t'%0A                        %7D%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A%0A        # Since this is a python-request object handed to us on HttpLocust()%0A        # object initialization, we can pass extra stuff if necessary using%0A        # kwargs. Call to POST %60/v3/auth/tokens%60 and capture the response%0A        # object.%0A        response = self.client.post(path, data=json.dumps(request),%0A                headers=headers)%0A%0A        # If we know we can pull a token out of the %60X-Subject-Token%60 header,%0A        # then proceed with the test plan and immediately attempt to validate%0A        # the token several times. Here we are trying to see if we can get %0A        # Keystone to throw a 404.%0A        if response.status_code == 201:%0A            token = response.headers%5B'X-Subject-Token'%5D%0A            # TODO(lbragstad): Turn this test case into one that supports%0A            # generating an admin token with an admin user, instead of using%0A            # auth_token.%0A            admin_token = 'ADMIN'%0A            headers = %7B'X-Subject-Token': token,%0A                       'X-Auth-Token': admin_token%7D%0A            for i in range(5):%0A                response = self.client.get(path, headers=headers)%0A%0A%0Aclass KeystoneUser(locust.HttpLocust):%0A    task_set = Authenticate%0A    host = 'http://%3Capi_haproxy_ip%3E:%3Cport%3E'%0A    min_wait=1000%0A    max_wait=1000%0A

Add initial locustfile.py