From 546882333e6cf73e75c4e2a3140814080b6e9009 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Fri, 9 Dec 2016 16:26:43 -0600 Subject: [PATCH] Enable Nova driver in gate pipeline This setup the CI to run devstack with Nova driver. Then, run the tempest tests againest it. In addition, this commit performed the following fixes in order to pass the CI check: * Switch from hv_type to fields.HVType * Switch from vm_mode to fields.VMMode See the related changes in Nova [1][2]. [1] https://review.openstack.org/#/c/356424/ [2] https://review.openstack.org/#/c/356553/ Closes-Bug: #1649021 Change-Id: Icf3c48d00b49ee16fe42adfc6d0bd41bfecaf938 --- devstack/gate_hook.sh | 9 +++++++++ nova/virt/docker/driver.py | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/devstack/gate_hook.sh b/devstack/gate_hook.sh index b2ba47341..7f0a350b9 100755 --- a/devstack/gate_hook.sh +++ b/devstack/gate_hook.sh @@ -18,4 +18,13 @@ # Keep all devstack settings here instead of project-config for easy # maintain if we want to change devstack config settings in future. +driver=$1 + +if [ "$driver" = "docker" ]; then + export DEVSTACK_LOCAL_CONFIG+=$'\n'"ZUN_DRIVER=docker" +elif [ "$driver" = "nova-docker" ]; then + export DEVSTACK_LOCAL_CONFIG+=$'\n'"ZUN_DRIVER=nova-docker" + export DEVSTACK_LOCAL_CONFIG+=$'\n'"IP_VERSION=4" +fi + $BASE/new/devstack-gate/devstack-vm-gate.sh diff --git a/nova/virt/docker/driver.py b/nova/virt/docker/driver.py index 6026d4f33..f63a0feb6 100644 --- a/nova/virt/docker/driver.py +++ b/nova/virt/docker/driver.py @@ -34,9 +34,7 @@ from oslo_utils import units from oslo_utils import versionutils from nova.compute import flavors -from nova.compute import hv_type from nova.compute import power_state -from nova.compute import vm_mode from nova import exception from nova.i18n import _ from nova.i18n import _LE @@ -322,8 +320,10 @@ class DockerDriver(driver.ComputeDriver): 'cpu_info': '?', 'numa_topology': None, 'supported_instances': [ - (fields.Architecture.I686, hv_type.DOCKER, vm_mode.EXE), - (fields.Architecture.X86_64, hv_type.DOCKER, vm_mode.EXE) + (fields.Architecture.I686, fields.HVType.DOCKER, + fields.VMMode.EXE), + (fields.Architecture.X86_64, fields.HVType.DOCKER, + fields.VMMode.EXE) ] } return stats