[Kimchi-devel] [PATCh V12 6/7] update test case to set/get user and group when VM is running

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Tue Apr 29 15:45:36 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

When vm is live, we should also get user and group correctly.

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
---
 tests/test_model.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/test_model.py b/tests/test_model.py
index 05e5741..c9af745 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -603,6 +603,19 @@ class ModelTests(unittest.TestCase):
             self.assertRaises(InvalidParameter, inst.vm_update,
                               'kimchi-vm1', params)
 
+            # change VM users and groups, when wm is running.
+            inst.vm_update(u'kimchi-vm1',
+                           {'users': ['root'], 'groups': ['root']})
+            vm_info = inst.vm_lookup(u'kimchi-vm1')
+            self.assertEquals(['root'], vm_info['users'])
+            self.assertEquals(['root'], vm_info['groups'])
+            # change VM users and groups by removing all elements,
+            # when wm is running.
+            inst.vm_update(u'kimchi-vm1', {'users': [], 'groups': []})
+            vm_info = inst.vm_lookup(u'kimchi-vm1')
+            self.assertEquals([], vm_info['users'])
+            self.assertEquals([], vm_info['groups'])
+
             inst.vm_poweroff('kimchi-vm1')
             self.assertRaises(OperationFailed, inst.vm_update,
                               'kimchi-vm1', {'name': 'kimchi-vm2'})
-- 
1.9.0




More information about the Kimchi-devel mailing list