From 486aa04d222b323fab8f8aab459a97c2fcf82e5b Mon Sep 17 00:00:00 2001 From: Thomas Duval Date: Wed, 14 Sep 2016 11:29:03 +0200 Subject: Bug fix Change-Id: If164c726141f36e46e0dba75be17c499f9b15ccc (cherry picked from commit f102f1d6a94516422191a9d70c88afc603c380af) --- tests/run_tests.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index e28f7614..6d524122 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -75,6 +75,14 @@ def test_federation(): proc = subprocess.Popen(["openstack", "role", "add ", "--project", "admin", "--user", username, "admin", "-f", "yaml"], stdout=subprocess.PIPE) logger.info("Add the role admin to our new user ({})".format(proc.stdout.read())) + # Add the sdn tenant + proc = subprocess.Popen(["openstack", "project", "add ", "sdn", "-f", "yaml"], stdout=subprocess.PIPE) + logger.info("Add the tenant sdn ({})".format(proc.stdout.read())) + + # Add the role admin to test_fede in tenant sdn + proc = subprocess.Popen(["openstack", "role", "add ", "--project", "sdn", "--user", username, "admin", "-f", "yaml"], stdout=subprocess.PIPE) + logger.info("Add the role admin for the user test_fede in the tenant sdn ({})".format(proc.stdout.read())) + # Retrieve Moon token nhost, nport = __get_endpoint_url() auth_data = {'username': username, 'password': password} @@ -91,11 +99,11 @@ def test_federation(): nport = "8181" # Test with basic login/pass - auth = HTTPBasicAuth("admin", "console") - req = requests.get(url='http://{host}:{port}/auth/v1/domains'.format(host=nhost, port=nport), auth=auth) - code = req.status_code - if code not in (200, 201, 202, 204): - return False, "Not able to authenticate to ODL with admin (error code: {}).".format(code) + #auth = HTTPBasicAuth("admin", "console") + #req = requests.get(url='http://{host}:{port}/auth/v1/domains'.format(host=nhost, port=nport), auth=auth) + #code = req.status_code + #if code not in (200, 201, 202, 204): + # return False, "Not able to authenticate to ODL with admin (error code: {}).".format(code) auth = HTTPBasicAuth(username, password) req = requests.get(url='http://{host}:{port}/auth/v1/domains'.format(host=nhost, port=nport), auth=auth) -- cgit 1.2.3-korg