ceph-volume tests validate parsing of cryptsetup

Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
Alfredo Deza 2018-02-01 15:51:41 -05:00
parent b80b61b90f
commit cce6a12f4a

View 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') == {}