]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/cmd_ipc.t
xt/mem-imapd-tls: update aliases to DSdeflate subs
[public-inbox.git] / t / cmd_ipc.t
index c5e715a1cd8aa6fc0d3d58328ea374f87fafc79a..75697a1539e3e8b2b80bb4d1cfa80d685e7d57d5 100644 (file)
@@ -1,5 +1,5 @@
 #!perl -w
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use v5.10.1;
@@ -85,7 +85,9 @@ my $do_test = sub { SKIP: {
                        $nsent += $n;
                        fail "sent 0 bytes" if $n == 0;
                }
-               ok($!{EAGAIN}, "hit EAGAIN on send $desc");
+               ok($!{EAGAIN} || $!{ETOOMANYREFS},
+                       "hit EAGAIN || ETOOMANYREFS on send $desc") or
+                       diag "send failed with: $!";
                ok($nsent > 0, 'sent some bytes');
 
                socketpair($s1, $s2, AF_UNIX, $type, 0) or BAIL_OUT $!;
@@ -105,8 +107,9 @@ my $do_test = sub { SKIP: {
                                diag "sent $nr, retrying with more";
                                $nr += 2 * 1024 * 1024;
                        } else {
-                               ok($!{EMSGSIZE}, 'got EMSGSIZE');
-                               # diag "$nr bytes hits EMSGSIZE";
+                               ok($!{EMSGSIZE} || $!{ENOBUFS},
+                                       'got EMSGSIZE or ENOBUFS') or
+                                       diag "$nr bytes fails with: $!";
                                last;
                        }
                }
@@ -139,4 +142,15 @@ SKIP: {
        }
 }
 
+SKIP: {
+       skip 'not Linux', 1 if $^O ne 'linux';
+       require_ok 'PublicInbox::Syscall';
+       $send = PublicInbox::Syscall->can('send_cmd4') or
+               skip 'send_cmd4 not defined for arch';
+       $recv = PublicInbox::Syscall->can('recv_cmd4') or
+               skip 'recv_cmd4 not defined for arch';
+       $do_test->(SOCK_STREAM, 0, 'PP Linux stream');
+       $do_test->($SOCK_SEQPACKET, MSG_EOR, 'PP Linux seqpacket');
+}
+
 done_testing;