<commit_before>import os
import pytest


securedrop_test_vars = pytest.securedrop_test_vars


@pytest.mark.parametrize('package', [
    'mailutils',
    'ossec-server',
    'postfix',
    'procmail',
    'securedrop-ossec-server',
])
def test_ossec_package(Package, package):
    """
    Ensure required packages for OSSEC are installed.
    Includes mail utilities and the FPF-maintained metapackage.
    """
    assert Package(package).is_installed


def test_ossec_connectivity(Command, Sudo):
    """
    Ensure ossec-server machine has active connection to the ossec-agent.
    The ossec service will report all available agents, and we can inspect
    that list to make sure it's the host we expect.
    """
    desired_output = "{}-{} is available.".format(
        securedrop_test_vars.app_hostname,
        os.environ.get('APP_IP', securedrop_test_vars.app_ip))
    with Sudo():
        c = Command.check_output("/var/ossec/bin/list_agents -a")
        assert c == desired_output

<commit_msg>reverting change to ossec test<commit_after>import os
import pytest


securedrop_test_vars = pytest.securedrop_test_vars


@pytest.mark.parametrize('package', [
    'mailutils',
    'ossec-server',
    'postfix',
    'procmail',
    'securedrop-ossec-server',
])
def test_ossec_package(Package, package):
    """
    Ensure required packages for OSSEC are installed.
    Includes mail utilities and the FPF-maintained metapackage.
    """
    assert Package(package).is_installed


@pytest.mark.xfail(strict=True)
def test_ossec_connectivity(Command, Sudo):
    """
    Ensure ossec-server machine has active connection to the ossec-agent.
    The ossec service will report all available agents, and we can inspect
    that list to make sure it's the host we expect.
    """
    desired_output = "{}-{} is available.".format(
        securedrop_test_vars.app_hostname,
        os.environ.get('APP_IP', securedrop_test_vars.app_ip))
    with Sudo():
        c = Command.check_output("/var/ossec/bin/list_agents -a")
        assert c == desired_output


{'fraction_non_alphanumeric': 0.10326351680467609, 'fraction_numerical': 0.0, 'mean_word_length': 3.504385964912281, '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': '5496702', 'n_tokens_mistral': 658, 'n_tokens_neox': 650, 'n_words': 163}