[Kimchi-devel] [PATCH] [Kimchi 2/2] Add tests to verify if cache and io of a disk can be changed

Ramon Medeiros posted 2 patches 7 years, 7 months ago
[Kimchi-devel] [PATCH] [Kimchi 2/2] Add tests to verify if cache and io of a disk can be changed
Posted by Ramon Medeiros 7 years, 7 months ago
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com>
---
 tests/test_model.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/test_model.py b/tests/test_model.py
index 95c9e08..e49e556 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -198,6 +198,13 @@ class ModelTests(unittest.TestCase):
             task = inst.task_lookup(task['id'])
             self.assertEquals('finished', task['status'])
 
+            # add io and cache to disk
+            inst.vmstorage_update("kimchi-vm", "vda", {"io": "threads"})
+            inst.vmstorage_update("kimchi-vm", "vda", {"cache": "unsafe"})
+            vda = inst.vmstorage_lookup("kimchi-vm", "vda")
+            self.assertEquals("unsafe", vda["cache"])
+            self.assertEquals("threads", vda["io"])
+
             vms = inst.vms_get_list()
             self.assertTrue('kimchi-vm' in vms)
 
-- 
2.9.3

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel
Re: [Kimchi-devel] [PATCH] [Kimchi 2/2] Add tests to verify if cache and io of a disk can be changed
Posted by Aline Manera 7 years, 7 months ago
Hi Ramon,

Please, add tests using the REST API as well. Just to confirm it is 
working as expected

On 02/28/2017 04:06 PM, Ramon Medeiros wrote:
> Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com>
> ---
>   tests/test_model.py | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/tests/test_model.py b/tests/test_model.py
> index 95c9e08..e49e556 100644
> --- a/tests/test_model.py
> +++ b/tests/test_model.py
> @@ -198,6 +198,13 @@ class ModelTests(unittest.TestCase):
>               task = inst.task_lookup(task['id'])
>               self.assertEquals('finished', task['status'])
>
> +            # add io and cache to disk
> +            inst.vmstorage_update("kimchi-vm", "vda", {"io": "threads"})
> +            inst.vmstorage_update("kimchi-vm", "vda", {"cache": "unsafe"})
> +            vda = inst.vmstorage_lookup("kimchi-vm", "vda")
> +            self.assertEquals("unsafe", vda["cache"])
> +            self.assertEquals("threads", vda["io"])
> +
>               vms = inst.vms_get_list()
>               self.assertTrue('kimchi-vm' in vms)
>

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel