From 184ea3d6f75f6adbee63668f633f856989bd2bbc Mon Sep 17 00:00:00 2001 From: Thomas Duval Date: Thu, 8 Sep 2016 11:24:00 +0200 Subject: Add a new user for federation test. Change-Id: I76c620d853179800da548767c3a8484dd2e7d141 --- tests/run_tests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests') 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) -- cgit 1.2.3-korg