X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fperf-nntpd.t;h=7abf2249ef32386ad7677fff22272b2e417d216e;hb=3c39f9c942a6975245fda878e9b957d8d3367662;hp=ce3cc409b138e9ff751bea1f0f9955589f65ae70;hpb=0b84d8600368c67080e683e415f7e502a343316b;p=public-inbox.git diff --git a/t/perf-nntpd.t b/t/perf-nntpd.t index ce3cc409..7abf2249 100644 --- a/t/perf-nntpd.t +++ b/t/perf-nntpd.t @@ -1,4 +1,4 @@ -# Copyright (C) 2018 all contributors +# Copyright (C) 2018-2019 all contributors # License: AGPL-3.0+ use strict; use warnings; @@ -27,7 +27,7 @@ if (($ENV{NNTP_TEST_URL} || '') =~ m!\Anntp://([^/]+)/([^/]+)\z!) { $host_port .= ":119" unless index($host_port, ':') > 0; } else { $group = 'inbox.test.perf.nntpd'; - my $ibx = { mainrepo => $pi_dir, newsgroup => $group }; + my $ibx = { inboxdir => $pi_dir, newsgroup => $group }; $ibx = PublicInbox::Inbox->new($ibx); my $nntpd = 'blib/script/public-inbox-nntpd'; my $tmpdir = tempdir('perf-nntpd-XXXXXX', TMPDIR => 1, CLEANUP => 1); @@ -38,20 +38,13 @@ if (($ENV{NNTP_TEST_URL} || '') =~ m!\Anntp://([^/]+)/([^/]+)\z!) { print $fh <<"" or die "print $pi_config: $!"; [publicinbox "test"] newsgroup = $group - mainrepo = $pi_dir + inboxdir = $pi_dir address = test\@example.com close $fh or die "close($pi_config): $!"; } - %opts = ( - LocalAddr => '127.0.0.1', - ReuseAddr => 1, - Proto => 'tcp', - Listen => 1024, - ); - my $sock = IO::Socket::INET->new(%opts); - + my $sock = tcp_server(); ok($sock, 'sock created'); my $cmd = [ $nntpd, '-W0' ]; $pid = spawn_listener({ PI_CONFIG => $pi_config }, $cmd, [$sock]);