Spawn a VM with Ceph RBD volume using flexvolumes
- Add test to deploy a virtlet VM with Ceph RBD volume
using flexvolumeDriver.
Change-Id: I9cd85fa97a0a930af7c640a7911cff49e9dfeab9
Reviewed-on: https://review.gerrithub.io/366399
Reviewed-by: <vrovachev@mirantis.com>
Reviewed-by: Dennis Dmitriev <dis.xcom@gmail.com>
Tested-by: Dennis Dmitriev <dis.xcom@gmail.com>
diff --git a/tcp_tests/tests/system/test_virtlet_actions.py b/tcp_tests/tests/system/test_virtlet_actions.py
index 4db505c..e5c01a1 100644
--- a/tcp_tests/tests/system/test_virtlet_actions.py
+++ b/tcp_tests/tests/system/test_virtlet_actions.py
@@ -78,3 +78,23 @@
'Correct is {1}'.format(cpu, target_cpu)
assert target_cpu == cpu, fail_msg
virtlet_actions.delete_vm(target_yaml)
+
+ def test_rbd_flexvolume_driver(self, underlay, virtlet_ceph_deployed,
+ show_step, virtlet_actions):
+ """Test for deploying a VM with Ceph RBD volume using flexvolumeDriver
+
+ Scenario:
+ 1. Start VM with prepared yaml from run-ceph.sh scripts
+ 2. Check that RBD volume is listed in virsh domblklist for VM
+ 3. Destroy VM
+
+ """
+ # From:
+ # https://github.com/Mirantis/virtlet/blob/master/tests/e2e/run_ceph.sh
+ target_yaml = "virtlet/tests/e2e/cirros-vm-rbd-volume.yaml"
+ vm_name = virtlet_actions.run_vm(target_yaml)
+ virtlet_actions.wait_active_state(vm_name)
+ domain_name = virtlet_actions.get_domain_name(vm_name)
+ vm_volumes_list = virtlet_actions.list_vm_volumes(domain_name)
+ assert 'rbd' in vm_volumes_list
+ virtlet_actions.delete_vm(target_yaml)