Skip to content

Commit

Permalink
test/volume: add test for noformat volume
Browse files Browse the repository at this point in the history
Closes: #2421
Signed-off-by: Sylvain Laperche <[email protected]>
  • Loading branch information
slaperche-scality committed Jun 30, 2020
1 parent 003c9bf commit ed7c3f1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
17 changes: 17 additions & 0 deletions tests/post/features/volume.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion tests/post/steps/test_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit ed7c3f1

Please sign in to comment.