[Kimchi-devel] [PATCH V5 3/5] 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
Wed Apr 23 10:05:19 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 2fb4446..6853ec1 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -601,6 +601,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')
             params = {'name': u'пeω-∨м'}
             self.assertRaises(OperationFailed, inst.vm_update,
-- 
1.9.0




More information about the Kimchi-devel mailing list