diff options
author | 2016-09-01 18:26:54 +0200 | |
---|---|---|
committer | 2016-09-01 18:26:54 +0200 | |
commit | 9899dca1f0a2b8b6e9c5dfa96c9288dd64535d1a (patch) | |
tree | 49fa393f82b552ed1fba2dd22067c16e53443345 /tests/run_tests.py | |
parent | 9cbb9e45a48c48e6e4d090e48c5a20367cbfb2bf (diff) |
Fix errors with Functest.
Change-Id: Iff86047633b89c5a27d56f91e78cdf1377038f5f
Diffstat (limited to 'tests/run_tests.py')
-rwxr-xr-x | tests/run_tests.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py index e953e86b..8030294f 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -14,6 +14,10 @@ import sys import time import yaml + +PORT_ODL = 8181 +HOST_ODL = "localhost" + parser = argparse.ArgumentParser() parser.add_argument("-r", "--report", @@ -41,31 +45,31 @@ except ImportError: def test_federation(): # Retrieve Moon token - url = urlopen('http://localhost:8080/moon/token', + url = urlopen('http://{host}:{port}/moon/token'.format(host=HOST_ODL, port=PORT_ODL), data='grant_type=password&username=admin&password=console'.encode('utf-8')) code = url.getcode() if code not in (200, 201, 202, 204): - return False, "Not able to retrieve Moon token." + return False, "Not able to retrieve Moon token (error code: {}).".format(code) # Retrieve ODL token auth_handler = HTTPBasicAuthHandler() auth_handler.add_password(realm='Moon', - uri='http://localhost:8080/auth/v1/domains', + uri='http://{host}:{port}/auth/v1/domains'.format(host=HOST_ODL, port=PORT_ODL), user='admin', passwd='console') opener = build_opener(auth_handler) install_opener(opener) - url = urlopen('http://www.example.com/login.html') + url = urlopen('http://{host}:{port}/auth/v1/domains'.format(host=HOST_ODL, port=PORT_ODL)) code = url.getcode() if code not in (200, 201, 202, 204): - return False, "Not able to retrieve ODL token." + return False, "Not able to retrieve ODL token (error code: {}).".format(code) return True, "" def test_moon_openstack(): cmd = "moon test --password console --self" - ret_val = functest_utils.execute_command(cmd, logger, exit_on_error=False) + ret_val = functest_utils.execute_command(cmd, logger) return ret_val @@ -89,6 +93,10 @@ def main(): 'timestart': start_time, 'duration': duration, 'status': test_status, + 'results': { + 'openstack': result_os, + 'opendaylight': result_odl + } } functest_utils.logger_test_results(logger, "moon", |