<commit_before>#!/usr/bin/perl
#
# Warning: do not run this test on a live server; it will kill your
# spamd children ;)

my $RUN_THIS_TEST = 1;          # edit and set to 1 if you really want

use lib '.'; use lib 't';
use SATest; sa_t_init("spamd_prefork_stress");
use Test;

# require pkill and pgrep be installed to run this test
BEGIN {
  (-x "/usr/bin/pkill") or $RUN_THIS_TEST = 0;
  (-x "/usr/bin/pgrep") or $RUN_THIS_TEST = 0;
  plan tests => ($SKIP_SPAMD_TESTS || !$RUN_THIS_TEST ? 0 : 14) 
};

exit if $SKIP_SPAMD_TESTS;

print "NOTE: this test requires /usr/bin/pkill, /usr/bin/pgrep.\n";
exit unless $RUN_THIS_TEST;

system("pgrep", "spamd child");
if ($? >> 8 == 0) {
  die "not running test: existing 'spamd child' processes would be killed.\n";
}

# ---------------------------------------------------------------------------

%patterns = (

q{ X-Spam-Status: Yes, score=}, 'status',<commit_msg>don't run spamd_prefork_stress by default<commit_after>#!/usr/bin/perl
#
# Warning: do not run this test on a live server; it will kill your
# spamd children ;)

my $RUN_THIS_TEST = 0;          # edit and set to 1 if you really want

use lib '.'; use lib 't';
use SATest; sa_t_init("spamd_prefork_stress");
use Test;

# require pkill and pgrep be installed to run this test
BEGIN {
  (-x "/usr/bin/pkill") or $RUN_THIS_TEST = 0;
  (-x "/usr/bin/pgrep") or $RUN_THIS_TEST = 0;
  plan tests => ($SKIP_SPAMD_TESTS || !$RUN_THIS_TEST ? 0 : 14) 
};

exit if $SKIP_SPAMD_TESTS;

print "NOTE: this test requires /usr/bin/pkill, /usr/bin/pgrep.\n";
exit unless $RUN_THIS_TEST;

system("pgrep", "spamd child");
if ($? >> 8 == 0) {
  die "not running test: existing 'spamd child' processes would be killed.\n";
}

# ---------------------------------------------------------------------------

%patterns = (

q{ X-Spam-Status: Yes, score=}, 'status',
{'fraction_non_alphanumeric': 0.22, 'fraction_numerical': 0.00972972972972973, 'mean_word_length': 2.6365422396856584, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6506208', 'n_tokens_mistral': 694, 'n_tokens_neox': 645, 'n_words': 207}