use_ok 'PublicInbox::V2Writable';
}
-my %opts = (
- LocalAddr => '127.0.0.1',
- ReuseAddr => 1,
- Proto => 'tcp',
- Type => SOCK_STREAM,
- Listen => 1024,
-);
-my $sock = IO::Socket::INET->new(%opts);
+my %opts;
+my $sock = tcp_server();
my $pid;
my $len;
END { kill 'TERM', $pid if defined $pid };
$im->add($mime);
$im->done;
if ($version == 1) {
- my $s = PublicInbox::SearchIdx->new($mainrepo, 1);
+ my $s = PublicInbox::SearchIdx->new($ibx, 1);
$s->index_sync;
}
}
is_deeply([$n->group($group)], [ qw(0 1 1), $group ], 'GROUP works');
is_deeply($n->listgroup($group), [1], 'listgroup OK');
+ SKIP: {
+ $n->can('starttls') or
+ skip('Net::NNTP too old to support STARTTLS', 2);
+ ok(!$n->starttls, 'STARTTLS fails when unconfigured');
+ is($n->code, 580, 'got 580 code on server w/o TLS');
+ };
+
%opts = (
PeerAddr => $host_port,
Proto => 'tcp',
'got greeting');
$s->autoflush(1);
+ syswrite($s, "CAPABILITIES\r\n");
+ $buf = read_til_dot($s);
+ like($buf, qr/\r\nVERSION 2\r\n/s, 'CAPABILITIES works');
+ unlike($buf, qr/STARTTLS/s, 'STARTTLS not advertised');
+
syswrite($s, "NEWGROUPS 19990424 000000 GMT\r\n");
$buf = read_til_dot($s);
like($buf, qr/\A231 list of /, 'newgroups OK');
$im->add($for_leafnode);
$im->done;
if ($version == 1) {
- my $s = PublicInbox::SearchIdx->new($mainrepo, 1);
+ my $s = PublicInbox::SearchIdx->new($ibx, 1);
$s->index_sync;
}
my $hdr = $n->head("<$long_hdr>");