summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-21 22:57:37 +0000
committerGerrit Code Review <review@openstack.org>2013-01-21 22:57:37 +0000
commit5ac99deadc12876a532ba66b0a3a33ddb702feb9 (patch)
tree4962f7c7380e1d6c2820e8f12f52dcc6dae0ebfc /nova/tests
parentfce9219eedf678b3f1bddc624c3233c105331b64 (diff)
parent2af896ceccc6fa947bbdb8b06442439db1c6dc1f (diff)
Merge "PXE driver should not accept empty kernel UUID."
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/baremetal/test_pxe.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/nova/tests/baremetal/test_pxe.py b/nova/tests/baremetal/test_pxe.py
index ad4975849..73ef8caa3 100644
--- a/nova/tests/baremetal/test_pxe.py
+++ b/nova/tests/baremetal/test_pxe.py
@@ -248,6 +248,13 @@ class PXEClassMethodsTestCase(BareMetalPXETestCase):
pxe.get_tftp_image_info,
self.instance)
+ # Test that other non-true values also raise an exception
+ CONF.baremetal.deploy_kernel = ""
+ CONF.baremetal.deploy_ramdisk = ""
+ self.assertRaises(exception.NovaException,
+ pxe.get_tftp_image_info,
+ self.instance)
+
# Even if the instance includes kernel_id and ramdisk_id,
# we still need deploy_kernel_id and deploy_ramdisk_id.
# If those aren't present in instance[], and not specified in
@@ -289,6 +296,17 @@ class PXEClassMethodsTestCase(BareMetalPXETestCase):
self.assertEqual(res['deploy_kernel'][0], 'eeee')
self.assertEqual(res['deploy_ramdisk'][0], 'ffff')
+ # However, if invalid values are passed on the image extra_specs,
+ # this should still raise an exception.
+ extra_specs = {
+ 'deploy_kernel_id': '',
+ 'deploy_ramdisk_id': '',
+ }
+ self.instance['extra_specs'] = extra_specs
+ self.assertRaises(exception.NovaException,
+ pxe.get_tftp_image_info,
+ self.instance)
+
class PXEPrivateMethodsTestCase(BareMetalPXETestCase):