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

Royce Lv lvroyce at linux.vnet.ibm.com
Mon Apr 28 07:06:54 UTC 2014


Reviewed-by: Royce Lv<lvroyce at linux.vnet.ibm.com>
On 2014年04月25日 22:14, shaohef at linux.vnet.ibm.com wrote:
> 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 b17ce00..ab22012 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'})




More information about the Kimchi-devel mailing list