Update ODL testcase to Keystone v3 63/41363/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Fri, 8 Sep 2017 05:33:23 +0000 (07:33 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Fri, 8 Sep 2017 08:14:33 +0000 (10:14 +0200)
As basic neutron tests have been updated [1], ODL testcase must
manage user domain and project domain names.

[1] https://git.opendaylight.org/gerrit/#/c/62846/

JIRA: FUNCTEST-862

Change-Id: I61ef622f840b8d825cf45a3557bd6da14a4d3cb7
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
docker/Dockerfile
docker/smoke/Dockerfile
functest/opnfv_tests/sdn/odl/odl.py
functest/tests/unit/odl/test_odl.py

index 603bc38..072ea1d 100644 (file)
@@ -14,7 +14,7 @@ LABEL version="0.1" description="OPNFV Functest Docker container"
 # Environment variables
 ARG BRANCH=master
 ARG RALLY_TAG=stable/0.9
-ARG ODL_TAG=27b7911a5c2315145f2cf06726303dadfe508940
+ARG ODL_TAG=35e415b6873b39d72775c88a337e92dac26012e2
 ARG OPENSTACK_TAG=stable/ocata
 ARG VIMS_TAG=stable
 ARG REPOS_DIR=/home/opnfv/repos
index 3b1e8d2..3e73d19 100644 (file)
@@ -2,7 +2,7 @@ FROM opnfv/functest-core
 
 ARG BRANCH=master
 ARG OPENSTACK_TAG=stable/ocata
-ARG ODL_TAG=27b7911a5c2315145f2cf06726303dadfe508940
+ARG ODL_TAG=35e415b6873b39d72775c88a337e92dac26012e2
 ARG FDS_TAG=master
 
 COPY thirdparty-requirements.txt thirdparty-requirements.txt
index ab70ba1..d09532c 100644 (file)
@@ -157,7 +157,11 @@ class ODLTests(testcase.TestCase):
                          'NEUTRON:' + kwargs['neutronip'],
                          'OS_AUTH_URL:"' + osauthurl + '"',
                          'OSUSERNAME:"' + kwargs['osusername'] + '"',
+                         ('OSUSERDOMAINNAME:"' +
+                          kwargs['osuserdomainname'] + '"'),
                          'OSTENANTNAME:"' + kwargs['ostenantname'] + '"',
+                         ('OSPROJECTDOMAINNAME:"' +
+                          kwargs['osprojectdomainname'] + '"'),
                          'OSPASSWORD:"' + kwargs['ospassword'] + '"',
                          'ODL_SYSTEM_IP:' + kwargs['odlip'],
                          'PORT:' + kwargs['odlwebport'],
@@ -221,7 +225,11 @@ class ODLTests(testcase.TestCase):
             if 'INSTALLER_TYPE' in os.environ:
                 installer_type = os.environ['INSTALLER_TYPE']
             kwargs['osusername'] = os.environ['OS_USERNAME']
+            kwargs['osuserdomainname'] = os.environ.get(
+                'OS_USER_DOMAIN_NAME', 'Default')
             kwargs['ostenantname'] = os.environ['OS_TENANT_NAME']
+            kwargs['osprojectdomainname'] = os.environ.get(
+                'OS_PROJECT_DOMAIN_NAME', 'Default')
             kwargs['osauthurl'] = os.environ['OS_AUTH_URL']
             kwargs['ospassword'] = os.environ['OS_PASSWORD']
             if installer_type == 'fuel':
@@ -263,13 +271,20 @@ class ODLParser(object):  # pylint: disable=too-few-public-methods
             default='127.0.0.1')
         self.parser.add_argument(
             '-k', '--osauthurl', help='OS_AUTH_URL as defined by OpenStack',
-            default='http://127.0.0.1:5000/v2.0')
+            default='http://127.0.0.1:5000/v3')
         self.parser.add_argument(
             '-a', '--osusername', help='Username for OpenStack',
             default='admin')
+        self.parser.add_argument(
+            '-f', '--osuserdomainname', help='User domain name for OpenStack',
+            default='Default')
         self.parser.add_argument(
             '-b', '--ostenantname', help='Tenantname for OpenStack',
             default='admin')
+        self.parser.add_argument(
+            '-g', '--osprojectdomainname',
+            help='Project domain name for OpenStack',
+            default='Default')
         self.parser.add_argument(
             '-c', '--ospassword', help='Password for OpenStack',
             default='admin')
index 878d47d..338a4e6 100644 (file)
@@ -69,7 +69,7 @@ class ODLTesting(unittest.TestCase):
     _keystone_ip = "127.0.0.1"
     _neutron_ip = "127.0.0.2"
     _sdn_controller_ip = "127.0.0.3"
-    _os_auth_url = "http://{}:5000/v2.0".format(_keystone_ip)
+    _os_auth_url = "http://{}:5000/v3".format(_keystone_ip)
     _os_tenantname = "admin"
     _os_username = "admin"
     _os_password = "admin"
@@ -77,6 +77,8 @@ class ODLTesting(unittest.TestCase):
     _odl_restconfport = "8181"
     _odl_username = "admin"
     _odl_password = "admin"
+    _os_userdomainname = 'Default'
+    _os_projectdomainname = 'Default'
 
     def setUp(self):
         for var in ("INSTALLER_TYPE", "SDN_CONTROLLER", "SDN_CONTROLLER_IP"):
@@ -84,15 +86,20 @@ class ODLTesting(unittest.TestCase):
                 del os.environ[var]
         os.environ["OS_AUTH_URL"] = self._os_auth_url
         os.environ["OS_USERNAME"] = self._os_username
+        os.environ["OS_USER_DOMAIN_NAME"] = self._os_userdomainname
         os.environ["OS_PASSWORD"] = self._os_password
         os.environ["OS_TENANT_NAME"] = self._os_tenantname
+        os.environ["OS_PROJECT_DOMAIN_NAME"] = self._os_projectdomainname
+        os.environ["OS_PASSWORD"] = self._os_password
         self.test = odl.ODLTests(case_name='odl', project_name='functest')
         self.defaultargs = {'odlusername': self._odl_username,
                             'odlpassword': self._odl_password,
                             'neutronip': self._keystone_ip,
                             'osauthurl': self._os_auth_url,
                             'osusername': self._os_username,
+                            'osuserdomainname': self._os_userdomainname,
                             'ostenantname': self._os_tenantname,
+                            'osprojectdomainname': self._os_projectdomainname,
                             'ospassword': self._os_password,
                             'odlip': self._keystone_ip,
                             'odlwebport': self._odl_webport,
@@ -211,7 +218,9 @@ class ODLMainTesting(ODLTesting):
                   'neutronip': self._neutron_ip,
                   'osauthurl': self._os_auth_url,
                   'osusername': self._os_username,
+                  'osuserdomainname': self._os_userdomainname,
                   'ostenantname': self._os_tenantname,
+                  'osprojectdomainname': self._os_projectdomainname,
                   'ospassword': self._os_password,
                   'odlip': self._sdn_controller_ip,
                   'odlwebport': self._odl_webport,
@@ -231,7 +240,11 @@ class ODLMainTesting(ODLTesting):
                         'NEUTRON:{}'.format(self._neutron_ip),
                         'OS_AUTH_URL:"{}"'.format(self._os_auth_url),
                         'OSUSERNAME:"{}"'.format(self._os_username),
+                        'OSUSERDOMAINNAME:"{}"'.format(
+                            self._os_userdomainname),
                         'OSTENANTNAME:"{}"'.format(self._os_tenantname),
+                        'OSPROJECTDOMAINNAME:"{}"'.format(
+                            self._os_projectdomainname),
                         'OSPASSWORD:"{}"'.format(self._os_password),
                         'ODL_SYSTEM_IP:{}'.format(self._sdn_controller_ip),
                         'PORT:{}'.format(self._odl_webport),
@@ -383,7 +396,9 @@ class ODLRunTesting(ODLTesting):
                 odlusername=self._odl_username, odlwebport=odlwebport,
                 osauthurl=self._os_auth_url,
                 ospassword=self._os_password, ostenantname=self._os_tenantname,
-                osusername=self._os_username)
+                osusername=self._os_username,
+                osprojectdomainname=self._os_projectdomainname,
+                osuserdomainname=self._os_userdomainname)
 
     def _test_multiple_suites(self, suites,
                               status=testcase.TestCase.EX_OK, **kwargs):
@@ -404,7 +419,9 @@ class ODLRunTesting(ODLTesting):
                 odlusername=self._odl_username, odlwebport=odlwebport,
                 osauthurl=self._os_auth_url,
                 ospassword=self._os_password, ostenantname=self._os_tenantname,
-                osusername=self._os_username)
+                osusername=self._os_username,
+                osprojectdomainname=self._os_projectdomainname,
+                osuserdomainname=self._os_userdomainname)
 
     def test_exc(self):
         with mock.patch('functest.utils.openstack_utils.get_endpoint',
@@ -579,9 +596,15 @@ class ODLArgParserTesting(ODLTesting):
     def test_osusername(self):
         self._test_arg('osusername', 'foo')
 
+    def test_osuserdomainname(self):
+        self._test_arg('osuserdomainname', 'domain')
+
     def test_ostenantname(self):
         self._test_arg('ostenantname', 'foo')
 
+    def test_osprojectdomainname(self):
+        self._test_arg('osprojectdomainname', 'domain')
+
     def test_ospassword(self):
         self._test_arg('ospassword', 'foo')