diff --git a/tests/post/features/volume.feature b/tests/post/features/volume.feature index cb36912a33..1583f01732 100644 --- a/tests/post/features/volume.feature +++ b/tests/post/features/volume.feature @@ -166,3 +166,20 @@ Feature: Volume management When I delete the Volume 'test-volume11' Then the Volume 'test-volume11' does not exist And the PersistentVolume 'test-volume11' does not exist + + Scenario: Test volume creation (raw sparseLoopDevice) + Given the Kubernetes API is available + When I create the following Volume: + apiVersion: storage.metalk8s.scality.com/v1alpha1 + kind: Volume + metadata: + name: test-volume12 + spec: + nodeName: bootstrap + storageClassName: metalk8s-prometheus + sparseLoopDevice: + size: 10Gi + noFormat: true + Then the Volume 'test-volume12' is 'Available' + And the PersistentVolume 'test-volume12' has size '10Gi' + And the backing storage for Volume 'test-volume12' is created diff --git a/tests/post/steps/test_volume.py b/tests/post/steps/test_volume.py index d138738a9d..890d58bb95 100644 --- a/tests/post/steps/test_volume.py +++ b/tests/post/steps/test_volume.py @@ -434,7 +434,10 @@ def check_storage_is_created(context, host, name): size = int(host.check_output('stat -c %s {}'.format(path))) assert _quantity_to_bytes(capacity) == size # Check that the loop device is mounted. - host.run_test('test -b /dev/disk/by-uuid/{}'.format(uuid)) + if volume['spec']['sparseLoopDevice'].get('noFormat', False): + host.run_test('test -b /dev/disk/by-partlabel/{}'.format(uuid)) + else: + host.run_test('test -b /dev/disk/by-uuid/{}'.format(uuid)) @then(parsers.parse("the backing storage for Volume '{name}' is deleted"))