]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/ceph-volume/ceph_volume/tests/devices/test_zap.py
update sources to 12.2.8
[ceph.git] / ceph / src / ceph-volume / ceph_volume / tests / devices / test_zap.py
index 5e267fca77e5978b4ebe7760ec61c34d40dbfb08..493c74c509c733be891712414f5a1f95cb30e20a 100644 (file)
@@ -7,11 +7,20 @@ class TestZap(object):
     def test_main_spits_help_with_no_arguments(self, capsys):
         lvm.zap.Zap([]).main()
         stdout, stderr = capsys.readouterr()
-        assert 'Zaps the given logical volume, raw device or partition' in stdout
+        assert 'Zaps the given logical volume(s), raw device(s) or partition(s)' in stdout
 
     def test_main_shows_full_help(self, capsys):
         with pytest.raises(SystemExit):
             lvm.zap.Zap(argv=['--help']).main()
         stdout, stderr = capsys.readouterr()
         assert 'optional arguments' in stdout
-        assert 'positional arguments' in stdout
+
+    @pytest.mark.parametrize('device_name', [
+        '/dev/mapper/foo',
+        '/dev/dm-0',
+    ])
+    def test_can_not_zap_mapper_device(self, capsys, is_root, device_name):
+        with pytest.raises(SystemExit):
+            lvm.zap.Zap(argv=[device_name]).main()
+        stdout, stderr = capsys.readouterr()
+        assert 'Refusing to zap' in stdout