]> git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/tests/devices/lvm/test_prepare.py
update sources to v12.1.3
[ceph.git] / ceph / src / ceph-volume / ceph_volume / tests / devices / lvm / test_prepare.py
1 import pytest
2 from ceph_volume.devices import lvm
3
4
5 class TestLVM(object):
6
7 def test_main_spits_help_with_no_arguments(self, capsys):
8 lvm.main.LVM([]).main()
9 stdout, stderr = capsys.readouterr()
10 assert 'Use LVM and LVM-based technologies like dmcache to deploy' in stdout
11
12 def test_main_shows_activate_subcommands(self, capsys):
13 lvm.main.LVM([]).main()
14 stdout, stderr = capsys.readouterr()
15 assert 'activate ' in stdout
16 assert 'Discover and mount' in stdout
17
18 def test_main_shows_prepare_subcommands(self, capsys):
19 lvm.main.LVM([]).main()
20 stdout, stderr = capsys.readouterr()
21 assert 'prepare ' in stdout
22 assert 'Format an LVM device' in stdout
23
24
25 class TestPrepare(object):
26
27 def test_main_spits_help_with_no_arguments(self, capsys):
28 lvm.prepare.Prepare([]).main()
29 stdout, stderr = capsys.readouterr()
30 assert 'Prepare an OSD by assigning an ID and FSID' in stdout
31
32 def test_main_shows_full_help(self, capsys):
33 with pytest.raises(SystemExit):
34 lvm.prepare.Prepare(argv=['--help']).main()
35 stdout, stderr = capsys.readouterr()
36 assert 'required arguments:' in stdout
37 assert 'A logical group name or a path' in stdout
38
39
40 class TestActivate(object):
41
42 def test_main_spits_help_with_no_arguments(self, capsys):
43 lvm.activate.Activate([]).main()
44 stdout, stderr = capsys.readouterr()
45 assert 'Activate OSDs by discovering them with' in stdout
46
47 def test_main_shows_full_help(self, capsys):
48 with pytest.raises(SystemExit):
49 lvm.activate.Activate(argv=['--help']).main()
50 stdout, stderr = capsys.readouterr()
51 assert 'optional arguments' in stdout
52 assert 'positional arguments' in stdout
53