- my $cmd = [ $httpd, "--stdout=$out", "--stderr=$err" ];
- $pid = spawn_listener($env, $cmd, [$sock]);
- $sock = undef;
-
- tiny_test($host, $port);
-
- skip 'skipping grok-pull integration test', 2 if !which('grok-pull');
+ my $cmd = [ '-httpd', '-W0', "--stdout=$out", "--stderr=$err" ];
+ $td = start_script($cmd, $env, { 3 => $sock });
+
+ # default publicinboxGrokManifest match=domain default
+ tiny_test($json, $host, $port);
+ undef $td;
+
+ print $fh <<"" or xbail "print $!";
+[publicinbox]
+ wwwlisting = all
+
+ close $fh or xbail "close $!";
+ $td = start_script($cmd, $env, { 3 => $sock });
+ tiny_test($json, $host, $port, 1);
+ undef $sock;
+
+ skip 'TEST_GROK unset', 12 unless $ENV{TEST_GROK};
+ my $grok_pull = require_cmd('grok-pull', 1) or
+ skip('grok-pull not available', 12);
+ my ($grok_version) = (xqx([$grok_pull, "--version"])
+ =~ /(\d+)\.(?:\d+)(?:\.(\d+))?/);
+ $grok_version >= 2 or
+ skip('grok-pull v2 or later not available', 12);
+ my $grok_loglevel = $ENV{TEST_GROK_LOGLEVEL} // 'info';