aboutsummaryrefslogtreecommitdiffstats
path: root/tests/run_tests.py
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-20 10:38:38 +0200
commit486aa04d222b323fab8f8aab459a97c2fcf82e5b (patch)
tree15656d006f91210bfbab64279ec61f48d1a7862c /tests/run_tests.py
parent1fc5900218897aa694134019c47671ab789eee1e (diff)
Bug fix
Change-Id: If164c726141f36e46e0dba75be17c499f9b15ccc (cherry picked from commit f102f1d6a94516422191a9d70c88afc603c380af)
Diffstat (limited to 'tests/run_tests.py')
-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)