From 3eb26fe04dae68612c841e749abd2848ce78ae59 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 30 Jun 2019 22:19:38 +0000 Subject: tests: common tcp_server and unix_server helpers IO::Socket:*->new options are verbose and we can save a bunch of code by putting this into t/common.perl, since the related spawn_listener stuff is already there. --- t/v2writable.t | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 't/v2writable.t') diff --git a/t/v2writable.t b/t/v2writable.t index 8f32fbe5..5406fd1b 100644 --- a/t/v2writable.t +++ b/t/v2writable.t @@ -134,13 +134,6 @@ if ('ensure git configs are correct') { 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 +146,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; -- cgit v1.2.3-24-ge0c7