]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/nntpd.t
tests: disable daemon workers in a few more places
[public-inbox.git] / t / nntpd.t
index 153204dfdc14d39e3393e451b43dbfc15661b7bb..4795dc008d58feb841215b5ca2dd9d8ffbc5f4a8 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -26,11 +26,10 @@ my $tmpdir = tempdir('pi-nntpd-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $home = "$tmpdir/pi-home";
 my $err = "$tmpdir/stderr.log";
 my $out = "$tmpdir/stdout.log";
-my $mainrepo = "$tmpdir/main.git";
+my $inboxdir = "$tmpdir/main.git";
 my $group = 'test-nntpd';
 my $addr = $group . '@example.com';
 my $nntpd = 'blib/script/public-inbox-nntpd';
-my $init = 'blib/script/public-inbox-init';
 SKIP: {
        skip "git 2.6+ required for V2Writable", 1 if $version == 1;
        use_ok 'PublicInbox::V2Writable';
@@ -43,7 +42,7 @@ my $len;
 END { kill 'TERM', $pid if defined $pid };
 
 my $ibx = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => $group,
        version => $version,
        -primary_address => $addr,
@@ -52,9 +51,9 @@ my $ibx = {
 $ibx = PublicInbox::Inbox->new($ibx);
 {
        local $ENV{HOME} = $home;
-       my @cmd = ($init, $group, $mainrepo, 'http://example.com/', $addr);
+       my @cmd = ('-init', $group, $inboxdir, 'http://example.com/', $addr);
        push @cmd, "-V$version", '-Lbasic';
-       is(system(@cmd), 0, 'init OK');
+       ok(run_script(\@cmd), 'init OK');
        is(system(qw(git config), "--file=$home/.public-inbox/config",
                        "publicinbox.$group.newsgroup", $group),
                0, 'enabled newsgroup');
@@ -91,7 +90,7 @@ EOF
        }
 
        ok($sock, 'sock created');
-       my $cmd = [ $nntpd, "--stdout=$out", "--stderr=$err" ];
+       my $cmd = [ $nntpd, '-W0', "--stdout=$out", "--stderr=$err" ];
        $pid = spawn_listener(undef, $cmd, [ $sock ]);
        ok(defined $pid, 'forked nntpd process successfully');
        my $host_port = $sock->sockhost . ':' . $sock->sockport;