
During upgrade testing, move Keystone containers behind an HAProxy load balancer and run a benchmarking tool to make continuous requests against the keystone API, providing summary output at the end of the play. This should help ensure the upgrade process between releases remains without downtime. To avoid service interruptions because of files being replaced during installations: - set the 'keystone_venv_tag' var so that it changes between releases - perform the 'Create WSGI symlinks' task only after the files being linked to exist Benchmarking scripts were provided by: https://github.com/lbragstad/keystone-performance-upgrade Co-Authored-By: Lance Bragstad <lbragstad@gmail.com> Change-Id: I462e6496f125c7e263bbab188e86c45e1f4f7f1e
26 lines
712 B
Python
26 lines
712 B
Python
import json
|
|
|
|
import locust
|
|
|
|
TOKEN_PATH = 'http://{{ external_lb_vip_address }}:5000/v3/auth/tokens'
|
|
|
|
|
|
class Task(locust.TaskSet):
|
|
@locust.task
|
|
def authenticate(self):
|
|
# authenticate for a token and validate it
|
|
with open('/opt/auth.json', 'r') as f:
|
|
body = json.loads(f.read())
|
|
headers = {'Content-Type': 'application/json'}
|
|
response = self.client.post(TOKEN_PATH, json=body, headers=headers)
|
|
token = response.headers.get('X-Subject-Token')
|
|
headers = {
|
|
'X-Subject-Token': token,
|
|
'X-Auth-Token': token
|
|
}
|
|
self.client.get(TOKEN_PATH, headers=headers)
|
|
|
|
|
|
class MyLocust(locust.HttpLocust):
|
|
task_set = Task
|