[Kimchi-devel] [PATCH][Kimchi 4/4] Add new tests to verify source_media feature

Ramon Medeiros ramonn at linux.vnet.ibm.com
Fri Apr 8 18:50:37 UTC 2016


Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
---
 tests/test_model.py    | 4 ++++
 tests/test_template.py | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/test_model.py b/tests/test_model.py
index 90ecd40..dc81b18 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -274,6 +274,10 @@ class ModelTests(unittest.TestCase):
             inst.templates_create(tmpl_info)
             rollback.prependDefer(inst.template_delete, tmpl_name)
 
+            # verify disk
+            tmpl = inst.template_lookup(tmpl_name)
+            self.assertEquals(vol_path, tmpl["disks"][0]["base"])
+
             params = {'name': 'kimchi-vm',
                       'template': '/plugins/kimchi/templates/img-tmpl'}
             task = inst.vms_create(params)
diff --git a/tests/test_template.py b/tests/test_template.py
index 6fd936c..92a4de9 100644
--- a/tests/test_template.py
+++ b/tests/test_template.py
@@ -93,7 +93,7 @@ class TemplateTests(unittest.TestCase):
             self.request('/plugins/kimchi/templates/test').read()
         )
         self.assertEquals(sorted(tmpl.keys()), sorted(keys))
-
+        self.assertEquals(t['source_media'], tmpl["cdrom"])
         disk_keys = ['index', 'pool', 'size', 'format']
         disk_pool_keys = ['name', 'type']
         self.assertEquals(sorted(tmpl['disks'][0].keys()), sorted(disk_keys))
-- 
2.5.5




More information about the Kimchi-devel mailing list