<commit_before>

class TestAll(object):

    def test_ceph_version(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='ceph --version')
        result = client.exec_start(command)
        assert 'ceph version' in result

    def test_etc_ceph_conf_exists(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='stat /etc/ceph/ceph.conf')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)

    def test_socket_dir_exists(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='stat /var/run/ceph')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)

    def test_ceph_health(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='ceph health')
        result = client.exec_start(command)
        assert result.startswith('HEALTH_ERR ')

    def test_keyring_exists(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='stat /etc/ceph/ceph.mon.keyring')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)


class TestJewel(object):

    def test_socket_dir_is_owned_by_ceph(self, jewel_containers, client):
        command = client.exec_create(jewel_containers, cmd='ls -ld /var/run/ceph')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)
        assert result.split()[2] == 'ceph'

    def test_monmap_exists(self, jewel_containers, client):
        command = client.exec_create(jewel_containers, cmd='stat /etc/ceph/ceph.monmap')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)


class TestHammer(object):

    def test_socket_dir_is_owned_by_root(self, hammer_containers, client):
        command = client.exec_create(hammer_containers, cmd='ls -ld /var/run/ceph')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)
        assert result.split()[2] == 'root'

    def test_monmap_exists(self, hammer_containers, client):
        command = client.exec_create(hammer_containers, cmd='stat /etc/ceph/monmap-ceph')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)<commit_msg>test: fix monmap name check<commit_after>

class TestAll(object):

    def test_ceph_version(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='ceph --version')
        result = client.exec_start(command)
        assert 'ceph version' in result

    def test_etc_ceph_conf_exists(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='stat /etc/ceph/ceph.conf')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)

    def test_socket_dir_exists(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='stat /var/run/ceph')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)

    def test_ceph_health(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='ceph health')
        result = client.exec_start(command)
        assert result.startswith('HEALTH_ERR ')

    def test_keyring_exists(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='stat /etc/ceph/ceph.mon.keyring')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)

    def test_monmap_exists(self, mon_containers, client):
        command = client.exec_create(mon_containers, cmd='stat /etc/ceph/monmap-ceph')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)


class TestJewel(object):

    def test_socket_dir_is_owned_by_ceph(self, jewel_containers, client):
        command = client.exec_create(jewel_containers, cmd='ls -ld /var/run/ceph')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)
        assert result.split()[2] == 'ceph'


class TestHammer(object):

    def test_socket_dir_is_owned_by_root(self, hammer_containers, client):
        command = client.exec_create(hammer_containers, cmd='ls -ld /var/run/ceph')
        result = client.exec_start(command)
        if client.exec_inspect(command)['ExitCode'] != 0:
            raise AssertionError(result)
        assert result.split()[2] == 'root'
{'fraction_non_alphanumeric': 0.11278637164675935, 'fraction_numerical': 0.0033287644409633835, 'mean_word_length': 3.5004405286343614, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2200482', 'n_tokens_mistral': 1619, 'n_tokens_neox': 1574, 'n_words': 282}