Enable Bionic as a gate test
Change bionic test from dev to gate for 18.05. Change-Id: Ifbe70a78f93ca0aaeb8491130ef9b6567c1a3d78
This commit is contained in:
parent
901b8731d4
commit
de283cdad2
|
@ -16,6 +16,11 @@
|
|||
|
||||
import amulet
|
||||
import time
|
||||
|
||||
import keystoneclient
|
||||
from keystoneclient.v3 import client as keystone_client_v3
|
||||
from novaclient import client as nova_client
|
||||
|
||||
from charmhelpers.contrib.openstack.amulet.deployment import (
|
||||
OpenStackAmuletDeployment
|
||||
)
|
||||
|
@ -146,10 +151,9 @@ class CephOsdBasicDeployment(OpenStackAmuletDeployment):
|
|||
self._get_openstack_release_string()))
|
||||
|
||||
# Authenticate admin with keystone
|
||||
self.keystone = u.authenticate_keystone_admin(self.keystone_sentry,
|
||||
user='admin',
|
||||
password='openstack',
|
||||
tenant='admin')
|
||||
self.keystone_session, self.keystone = u.get_default_keystone_session(
|
||||
self.keystone_sentry,
|
||||
openstack_release=self._get_openstack_release())
|
||||
|
||||
# Authenticate admin with cinder endpoint
|
||||
self.cinder = u.authenticate_cinder_admin(self.keystone)
|
||||
|
@ -157,37 +161,87 @@ class CephOsdBasicDeployment(OpenStackAmuletDeployment):
|
|||
self.glance = u.authenticate_glance_admin(self.keystone)
|
||||
|
||||
# Authenticate admin with nova endpoint
|
||||
self.nova = u.authenticate_nova_user(self.keystone,
|
||||
user='admin',
|
||||
password='openstack',
|
||||
tenant='admin')
|
||||
self.nova = nova_client.Client(2, session=self.keystone_session)
|
||||
|
||||
keystone_ip = self.keystone_sentry.info['public-address']
|
||||
|
||||
# Create a demo tenant/role/user
|
||||
self.demo_tenant = 'demoTenant'
|
||||
self.demo_role = 'demoRole'
|
||||
self.demo_user = 'demoUser'
|
||||
self.demo_project = 'demoProject'
|
||||
self.demo_domain = 'demoDomain'
|
||||
if self._get_openstack_release() >= self.xenial_queens:
|
||||
self.create_users_v3()
|
||||
self.demo_user_session, auth = u.get_keystone_session(
|
||||
keystone_ip,
|
||||
self.demo_user,
|
||||
'password',
|
||||
api_version=3,
|
||||
user_domain_name=self.demo_domain,
|
||||
project_domain_name=self.demo_domain,
|
||||
project_name=self.demo_project
|
||||
)
|
||||
self.keystone_demo = keystone_client_v3.Client(
|
||||
session=self.demo_user_session)
|
||||
self.nova_demo = nova_client.Client(
|
||||
2,
|
||||
session=self.demo_user_session)
|
||||
else:
|
||||
self.create_users_v2()
|
||||
# Authenticate demo user with keystone
|
||||
self.keystone_demo = \
|
||||
u.authenticate_keystone_user(
|
||||
self.keystone, user=self.demo_user,
|
||||
password='password',
|
||||
tenant=self.demo_tenant)
|
||||
# Authenticate demo user with nova-api
|
||||
self.nova_demo = u.authenticate_nova_user(self.keystone,
|
||||
user=self.demo_user,
|
||||
password='password',
|
||||
tenant=self.demo_tenant)
|
||||
|
||||
def create_users_v3(self):
|
||||
try:
|
||||
self.keystone.projects.find(name=self.demo_project)
|
||||
except keystoneclient.exceptions.NotFound:
|
||||
domain = self.keystone.domains.create(
|
||||
self.demo_domain,
|
||||
description='Demo Domain',
|
||||
enabled=True
|
||||
)
|
||||
project = self.keystone.projects.create(
|
||||
self.demo_project,
|
||||
domain,
|
||||
description='Demo Project',
|
||||
enabled=True,
|
||||
)
|
||||
user = self.keystone.users.create(
|
||||
self.demo_user,
|
||||
domain=domain.id,
|
||||
project=self.demo_project,
|
||||
password='password',
|
||||
email='demov3@demo.com',
|
||||
description='Demo',
|
||||
enabled=True)
|
||||
role = self.keystone.roles.find(name='Admin')
|
||||
self.keystone.roles.grant(
|
||||
role.id,
|
||||
user=user.id,
|
||||
project=project.id)
|
||||
|
||||
def create_users_v2(self):
|
||||
if not u.tenant_exists(self.keystone, self.demo_tenant):
|
||||
tenant = self.keystone.tenants.create(tenant_name=self.demo_tenant,
|
||||
description='demo tenant',
|
||||
enabled=True)
|
||||
|
||||
self.keystone.roles.create(name=self.demo_role)
|
||||
self.keystone.users.create(name=self.demo_user,
|
||||
password='password',
|
||||
tenant_id=tenant.id,
|
||||
email='demo@demo.com')
|
||||
|
||||
# Authenticate demo user with keystone
|
||||
self.keystone_demo = u.authenticate_keystone_user(self.keystone,
|
||||
self.demo_user,
|
||||
'password',
|
||||
self.demo_tenant)
|
||||
|
||||
# Authenticate demo user with nova-api
|
||||
self.nova_demo = u.authenticate_nova_user(self.keystone,
|
||||
self.demo_user,
|
||||
'password',
|
||||
self.demo_tenant)
|
||||
|
||||
def test_100_ceph_processes(self):
|
||||
"""Verify that the expected service processes are running
|
||||
on each ceph unit."""
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright 2016 Canonical Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Amulet tests on a basic ceph-osd deployment on xenial-queens."""
|
||||
|
||||
from basic_deployment import CephOsdBasicDeployment
|
||||
|
||||
if __name__ == '__main__':
|
||||
deployment = CephOsdBasicDeployment(series='xenial',
|
||||
openstack='cloud:xenial-queens',
|
||||
source='cloud:xenial-updates/queens')
|
||||
deployment.run_tests()
|
2
tox.ini
2
tox.ini
|
@ -68,7 +68,7 @@ basepython = python2.7
|
|||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
bundletester -vl DEBUG -r json -o func-results.json gate-basic-xenial-pike --no-destroy
|
||||
bundletester -vl DEBUG -r json -o func-results.json gate-basic-bionic-queens --no-destroy
|
||||
|
||||
[testenv:func27-dfs]
|
||||
# Charm Functional Test
|
||||
|
|
Loading…
Reference in New Issue