Add amulet test for pci-alias
Add an amulet test to check pci-alias setting is propagated properly into nova.conf. This is a prerequisite for work to support setting multiple aliases. Depends-On: I6ac49b0a2782df2ebc8f3d1fe299dec3cc078d7c Change-Id: Ic8d51dfb3130670cd6810ca80378d6ef8c0d0346
This commit is contained in:
parent
0f14eac672
commit
0a9b1a21a7
|
@ -13,6 +13,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
import amulet
|
||||
import json
|
||||
|
||||
from charmhelpers.contrib.openstack.amulet.deployment import (
|
||||
OpenStackAmuletDeployment
|
||||
|
@ -769,6 +770,49 @@ class NovaCCBasicDeployment(OpenStackAmuletDeployment):
|
|||
message = "api paste config error: {}".format(ret)
|
||||
amulet.raise_status(amulet.FAIL, msg=message)
|
||||
|
||||
def test_310_pci_alias_config(self):
|
||||
"""Verify the pci alias data is rendered properly."""
|
||||
u.log.debug('Checking pci aliases in nova config')
|
||||
|
||||
os_release = self._get_openstack_release_string()
|
||||
if CompareOpenStackReleases(os_release) < 'kilo':
|
||||
u.log.info('Skipping test, {} < kilo'.format(os_release))
|
||||
return
|
||||
|
||||
_pci_alias1 = {
|
||||
"name": "IntelNIC",
|
||||
"capability_type": "pci",
|
||||
"product_id": "1111",
|
||||
"vendor_id": "8086",
|
||||
"device_type": "type-PF"}
|
||||
|
||||
if CompareOpenStackReleases(os_release) >= 'ocata':
|
||||
section = "pci"
|
||||
key_name = "alias"
|
||||
else:
|
||||
section = "DEFAULT"
|
||||
key_name = "pci_alias"
|
||||
|
||||
unit = self.nova_cc_sentry
|
||||
conf = '/etc/nova/nova.conf'
|
||||
self.d.configure(
|
||||
'nova-cloud-controller',
|
||||
{'pci-alias': json.dumps(_pci_alias1, sort_keys=True)})
|
||||
self.d.sentry.wait()
|
||||
ret = u.validate_config_data(
|
||||
unit,
|
||||
conf,
|
||||
section,
|
||||
{key_name: ('{"capability_type": "pci", "device_type": "type-PF", '
|
||||
'"name": "IntelNIC", "product_id": "1111", '
|
||||
'"vendor_id": "8086"}')})
|
||||
if ret:
|
||||
message = "PCI Alias config error in section {}: {}".format(
|
||||
section,
|
||||
ret)
|
||||
amulet.raise_status(amulet.FAIL, msg=message)
|
||||
self.d.configure('nova-cloud-controller', {'pci-alias': ''})
|
||||
|
||||
def test_400_image_instance_create(self):
|
||||
"""Create an image/instance, verify they exist, and delete them."""
|
||||
u.log.debug('Checking nova instance creation...')
|
||||
|
|
Loading…
Reference in New Issue