3 from ceph_volume.devices.simple import activate
6 class TestActivate(object):
8 def test_no_data_uuid(self, factory, tmpfile, is_root, monkeypatch, capture):
9 json_config = tmpfile(contents='{}')
10 args = factory(osd_id='0', osd_fsid='1234', json_config=json_config)
11 with pytest.raises(RuntimeError):
12 activate.Activate([]).activate(args)
14 def test_invalid_json_path(self):
15 os.environ['CEPH_VOLUME_SIMPLE_JSON_DIR'] = '/non/existing/path'
16 with pytest.raises(RuntimeError) as error:
17 activate.Activate(['1', 'asdf']).main()
18 assert 'RuntimeError: Expected JSON config path not found' in str(error)
20 def test_main_spits_help_with_no_arguments(self, capsys):
21 activate.Activate([]).main()
22 stdout, stderr = capsys.readouterr()
23 assert 'Activate OSDs by mounting devices previously configured' in stdout