mirror of
https://github.com/ceph/ceph
synced 2024-12-28 22:43:29 +00:00
ceph-volume tests validate parsing of cryptsetup
Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
parent
b80b61b90f
commit
cce6a12f4a
19
src/ceph-volume/ceph_volume/tests/util/test_encryption.py
Normal file
19
src/ceph-volume/ceph_volume/tests/util/test_encryption.py
Normal file
@ -0,0 +1,19 @@
|
||||
from ceph_volume.util import encryption
|
||||
|
||||
|
||||
class TestStatus(object):
|
||||
|
||||
def test_skips_unuseful_lines(self, stub_call):
|
||||
out = ['some line here', ' device: /dev/sdc1']
|
||||
stub_call((out, '', 0))
|
||||
assert encryption.status('/dev/sdc1') == {'device': '/dev/sdc1'}
|
||||
|
||||
def test_removes_extra_quotes(self, stub_call):
|
||||
out = ['some line here', ' device: "/dev/sdc1"']
|
||||
stub_call((out, '', 0))
|
||||
assert encryption.status('/dev/sdc1') == {'device': '/dev/sdc1'}
|
||||
|
||||
def test_ignores_bogus_lines(self, stub_call):
|
||||
out = ['some line here', ' ']
|
||||
stub_call((out, '', 0))
|
||||
assert encryption.status('/dev/sdc1') == {}
|
Loading…
Reference in New Issue
Block a user