aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Duval <thomas.duval@orange.com>2016-09-14 11:29:03 +0200
committerThomas Duval <thomas.duval@orange.com>2016-09-14 11:29:03 +0200
commitf102f1d6a94516422191a9d70c88afc603c380af (patch)
tree69e3d7213db6ab8a79b6b83665ade9356c9f8887 /tests
parent91dca3635e79277e58ab1f413ca840654e33635b (diff)
Bug fix
Change-Id: If164c726141f36e46e0dba75be17c499f9b15ccc
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run_tests.py18
1 files 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)