summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/basic_deployment.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py
index 0ad4286..4d774de 100644
--- a/tests/basic_deployment.py
+++ b/tests/basic_deployment.py
@@ -13,6 +13,7 @@
13# limitations under the License. 13# limitations under the License.
14 14
15import amulet 15import amulet
16import json
16 17
17from charmhelpers.contrib.openstack.amulet.deployment import ( 18from charmhelpers.contrib.openstack.amulet.deployment import (
18 OpenStackAmuletDeployment 19 OpenStackAmuletDeployment
@@ -769,6 +770,49 @@ class NovaCCBasicDeployment(OpenStackAmuletDeployment):
769 message = "api paste config error: {}".format(ret) 770 message = "api paste config error: {}".format(ret)
770 amulet.raise_status(amulet.FAIL, msg=message) 771 amulet.raise_status(amulet.FAIL, msg=message)
771 772
773 def test_310_pci_alias_config(self):
774 """Verify the pci alias data is rendered properly."""
775 u.log.debug('Checking pci aliases in nova config')
776
777 os_release = self._get_openstack_release_string()
778 if CompareOpenStackReleases(os_release) < 'kilo':
779 u.log.info('Skipping test, {} < kilo'.format(os_release))
780 return
781
782 _pci_alias1 = {
783 "name": "IntelNIC",
784 "capability_type": "pci",
785 "product_id": "1111",
786 "vendor_id": "8086",
787 "device_type": "type-PF"}
788
789 if CompareOpenStackReleases(os_release) >= 'ocata':
790 section = "pci"
791 key_name = "alias"
792 else:
793 section = "DEFAULT"
794 key_name = "pci_alias"
795
796 unit = self.nova_cc_sentry
797 conf = '/etc/nova/nova.conf'
798 self.d.configure(
799 'nova-cloud-controller',
800 {'pci-alias': json.dumps(_pci_alias1, sort_keys=True)})
801 self.d.sentry.wait()
802 ret = u.validate_config_data(
803 unit,
804 conf,
805 section,
806 {key_name: ('{"capability_type": "pci", "device_type": "type-PF", '
807 '"name": "IntelNIC", "product_id": "1111", '
808 '"vendor_id": "8086"}')})
809 if ret:
810 message = "PCI Alias config error in section {}: {}".format(
811 section,
812 ret)
813 amulet.raise_status(amulet.FAIL, msg=message)
814 self.d.configure('nova-cloud-controller', {'pci-alias': ''})
815
772 def test_400_image_instance_create(self): 816 def test_400_image_instance_create(self):
773 """Create an image/instance, verify they exist, and delete them.""" 817 """Create an image/instance, verify they exist, and delete them."""
774 u.log.debug('Checking nova instance creation...') 818 u.log.debug('Checking nova instance creation...')