[Kimchi-devel] [PATCH V5 3/4] add template_delete to rollback after create a template
shaohef at linux.vnet.ibm.com
shaohef at linux.vnet.ibm.com
Mon Mar 24 14:58:42 UTC 2014
From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
We know ModelTests will tear down the template datebase.
But it is better to delete the template explicitly.
In this way, the test case also can test the template_delete.
Also this can make pyflakes happy.
Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
---
tests/test_model.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/test_model.py b/tests/test_model.py
index c8c54c0..69f9b5b 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -513,9 +513,11 @@ class ModelTests(unittest.TestCase):
orig_params = {'name': 'test-template', 'memory': 1024,
'cpus': 1, 'cdrom': self.kimchi_iso}
inst.templates_create(orig_params)
+ rollback.prependDefer(inst.template_delete, 'test-template')
orig_temp = inst.template_lookup(orig_params['name'])
ident = inst.template_clone('test-template')
+ rollback.prependDefer(inst.template_delete, ident)
clone_temp = inst.template_lookup(ident)
clone_temp['name'] = orig_temp['name']
--
1.8.5.3
More information about the Kimchi-devel
mailing list