Check whether doing so raises an exception.
---
test/py/ganeti.hypervisor.hv_xen_unittest.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/test/py/ganeti.hypervisor.hv_xen_unittest.py
b/test/py/ganeti.hypervisor.hv_xen_unittest.py
index 134182d..18b94a1 100755
--- a/test/py/ganeti.hypervisor.hv_xen_unittest.py
+++ b/test/py/ganeti.hypervisor.hv_xen_unittest.py
@@ -366,6 +366,16 @@ class _TestXenHypervisor(object):
"", "This command failed", None,
NotImplemented, NotImplemented)
+ def testReadingNonExistentConfigFile(self):
+ hv = self._GetHv()
+
+ try:
+ hv._ReadConfigFile("inst15780.example.com")
+ except errors.HypervisorError, err:
+ self.assertTrue(str(err).startswith("Failed to load Xen config file:"))
+ else:
+ self.fail("Exception was not raised")
+
def testRemovingAutoConfigFile(self):
name = "inst8206.example.com"
cfgfile = utils.PathJoin(self.tmpdir, name)
--
1.8.1