X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fnntpd.t;h=c7ea3197c20f3808fc037e5144ee5aad2fd89c5f;hb=0b1de991a099b5e8b9a9e3e85b5eaaacc9362dbb;hp=6b13f81e7679f77a893442de74fadb4a48f0308e;hpb=b0e5062d43a96372801713ef78a78d6a1bc852bc;p=public-inbox.git diff --git a/t/nntpd.t b/t/nntpd.t index 6b13f81e..c7ea3197 100644 --- a/t/nntpd.t +++ b/t/nntpd.t @@ -3,16 +3,15 @@ use strict; use warnings; use Test::More; -foreach my $mod (qw(DBD::SQLite Search::Xapian Danga::Socket)) { +foreach my $mod (qw(DBD::SQLite)) { eval "require $mod"; plan skip_all => "$mod missing for nntpd.t" if $@; } require PublicInbox::SearchIdx; require PublicInbox::Msgmap; -use Cwd; use Email::Simple; use IO::Socket; -use Socket qw(SO_KEEPALIVE IPPROTO_TCP TCP_NODELAY); +use Socket qw(IPPROTO_TCP TCP_NODELAY); use File::Temp qw/tempdir/; use Net::NNTP; use Sys::Hostname; @@ -56,12 +55,13 @@ my $ibx = { name => $group, version => $version, -primary_address => $addr, + indexlevel => 'basic', }; $ibx = PublicInbox::Inbox->new($ibx); { local $ENV{HOME} = $home; my @cmd = ($init, $group, $mainrepo, 'http://example.com/', $addr); - push @cmd, "-V$version"; + push @cmd, "-V$version", '-Lbasic'; is(system(@cmd), 0, 'init OK'); is(system(qw(git config), "--file=$home/.public-inbox/config", "publicinbox.$group.newsgroup", $group), @@ -72,8 +72,8 @@ $ibx = PublicInbox::Inbox->new($ibx); if ($version == 2) { $im = PublicInbox::V2Writable->new($ibx); } elsif ($version == 1) { - my $git = PublicInbox::Git->new($mainrepo); - $im = PublicInbox::Import->new($git, 'test', $addr); + use_ok 'PublicInbox::V1Writable'; + $im = PublicInbox::V1Writable->new($ibx); } else { die "unsupported version: $version"; } @@ -262,6 +262,12 @@ EOF is($rdr, waitpid($rdr, 0), 'reader done'); is($? >> 8, 0, 'no errors'); } + SKIP: { + my @of = `lsof -p $pid 2>/dev/null`; + skip('lsof broken', 1) if (!scalar(@of) || $?); + my @xap = grep m!Search/Xapian!, @of; + is_deeply(\@xap, [], 'Xapian not loaded in nntpd'); + } { setsockopt($s, IPPROTO_TCP, TCP_NODELAY, 1); syswrite($s, 'HDR List-id 1-');