]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/v2writable.t
tests: add tcp_connect() helper
[public-inbox.git] / t / v2writable.t
index 8f32fbe5d9c42e9abfd31e33ce70200c46ca03b6..8e96ff00d106ef03ac695a458098620454d93b70 100644 (file)
@@ -131,16 +131,8 @@ if ('ensure git configs are correct') {
 
 {
        use Net::NNTP;
-       use IO::Socket::INET;
        my $err = "$mainrepo/stderr.log";
        my $out = "$mainrepo/stdout.log";
-       my %opts = (
-               LocalAddr => '127.0.0.1',
-               ReuseAddr => 1,
-               Proto => 'tcp',
-               Type => SOCK_STREAM,
-               Listen => 1024,
-       );
        my $group = 'inbox.comp.test.v2writable';
        my $pi_config = "$mainrepo/pi_config";
        open my $fh, '>', $pi_config or die "open: $!\n";
@@ -153,7 +145,7 @@ if ('ensure git configs are correct') {
 EOF
        ;
        close $fh or die "close: $!\n";
-       my $sock = IO::Socket::INET->new(%opts);
+       my $sock = tcp_server();
        ok($sock, 'sock created');
        my $pid;
        my $len;