daemon_type = 'cephadm-exporter'
default_port = 9443
- bin_name = 'cephadm'
key_name = 'key'
crt_name = 'crt'
token_name = 'token'
@property
def binary_path(self):
- return os.path.join(
- self.ctx.data_dir,
- self.fsid,
- CephadmDaemon.bin_name
- )
+ path = os.path.realpath(__file__)
+ assert os.path.isfile(path)
+ return path
def _handle_thread_exception(self, exc, thread_type):
e_msg = f'{exc.__class__.__name__} exception: {str(exc)}'
assert exporter.unit_run
lines = exporter.unit_run.split('\n')
assert len(lines) == 2
- assert "/var/lib/ceph/foobar/cephadm exporter --fsid foobar --id test --port 9443 &" in lines[1]
+ assert "cephadm exporter --fsid foobar --id test --port 9443 &" in lines[1]
def test_binary_path(self, exporter):
- # fsid = foobar
- args = cd._parse_args([])
- cd.args = args
- assert exporter.binary_path == "/var/lib/ceph/foobar/cephadm"
+ assert os.path.isfile(exporter.binary_path)
def test_systemd_unit(self, exporter):
assert exporter.unit_file