]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-volume tests.api verify that Volume object can be removed
authorAlfredo Deza <adeza@redhat.com>
Tue, 13 Nov 2018 22:05:31 +0000 (17:05 -0500)
committerAlfredo Deza <adeza@redhat.com>
Tue, 13 Nov 2018 22:07:01 +0000 (17:07 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/tests/api/test_lvm.py

index e087e55ee3e4284225cc287cd5a94320e5451aa7..3dc1ac6b98a07de315fa7b8f573582305a6aba7b 100644 (file)
@@ -541,6 +541,12 @@ class TestRemoveLV(object):
         monkeypatch.setattr(process, 'call', mock_call)
         assert api.remove_lv("vg/lv")
 
+    def test_removes_lv_object(self, fake_call):
+        foo_volume = api.Volume(lv_name='foo', lv_path='/path', vg_name='foo_group', lv_tags='')
+        api.remove_lv(foo_volume)
+        # last argument from the list passed to process.call
+        assert fake_call.calls[0]['args'][0][-1] == '/path'
+
     def test_fails_to_remove_lv(self, monkeypatch):
         def mock_call(cmd, **kw):
             return ('', '', 1)