diff options
author | 2016-09-08 11:24:00 +0200 | |
---|---|---|
committer | 2016-09-08 11:24:00 +0200 | |
commit | 184ea3d6f75f6adbee63668f633f856989bd2bbc (patch) | |
tree | 3747b31b2030f9bc504039e44e79882d5fadb782 /tests/run_tests.py | |
parent | 6c3682d22c3b1758b8fca440012dfe2a4b349f5c (diff) |
Add a new user for federation test.
Change-Id: I76c620d853179800da548767c3a8484dd2e7d141
Diffstat (limited to 'tests/run_tests.py')
-rwxr-xr-x | tests/run_tests.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py index 9b0c1279..eb914a45 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -60,9 +60,17 @@ def __get_endpoint_url(name="keystone"): def test_federation(): + + username = "test_fede" + password = "pass_fede" + + # Create a new user in OpenStack + proc = subprocess.Popen(["openstack", "user", "create", "--password", password, username, "-f", "yaml"], stdout=subprocess.PIPE) + logger.info("Create new user ({})".format(proc.stdout.read())) + # Retrieve Moon token nhost, nport = __get_endpoint_url() - auth_data = {'username': 'admin', 'password': 'console'} + auth_data = {'username': username, 'password': password} conn = client.HTTPConnection(nhost, nport) headers = {"Content-type": "application/json"} conn.request("POST", "/moon/auth/tokens", json.dumps(auth_data).encode('utf-8'), headers=headers) |