]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume tests verify that luminous doesn't use stdin 23367/head
authorAlfredo Deza <adeza@redhat.com>
Tue, 31 Jul 2018 20:47:05 +0000 (16:47 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 1 Aug 2018 14:55:58 +0000 (10:55 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit a97a63540290c93e05857ac175f3c9c45a4602c6)

src/ceph-volume/ceph_volume/tests/util/test_prepare.py

index ec253e373b5ffe7693fecdff943ea0a3e3c9dc5a..e41ddfe59b93af7965ee03b975c1896e392b636e 100644 (file)
@@ -149,6 +149,12 @@ class TestOsdMkfsFilestore(object):
         prepare.osd_mkfs_filestore(1, 'asdf', keyring='secret')
         assert flag in fake_call.calls[0]['args'][0]
 
+    def test_keyring_is_used_luminous(self, fake_call, monkeypatch):
+        monkeypatch.setattr(prepare, '__release__', 'luminous')
+        monkeypatch.setattr(system, 'chown', lambda path: True)
+        prepare.osd_mkfs_filestore(1, 'asdf', keyring='secret')
+        assert '--keyfile' not in fake_call.calls[0]['args'][0]
+
 
 class TestOsdMkfsBluestore(object):
 
@@ -162,6 +168,12 @@ class TestOsdMkfsBluestore(object):
         prepare.osd_mkfs_bluestore(1, 'asdf')
         assert '--keyfile' not in fake_call.calls[0]['args'][0]
 
+    def test_keyring_is_not_added_luminous(self, fake_call, monkeypatch):
+        monkeypatch.setattr(system, 'chown', lambda path: True)
+        prepare.osd_mkfs_bluestore(1, 'asdf')
+        monkeypatch.setattr(prepare, '__release__', 'luminous')
+        assert '--keyfile' not in fake_call.calls[0]['args'][0]
+
     def test_wal_is_added(self, fake_call, monkeypatch):
         monkeypatch.setattr(system, 'chown', lambda path: True)
         prepare.osd_mkfs_bluestore(1, 'asdf', wal='/dev/smm1')