diff options
author | Eric Wong <e@80x24.org> | 2023-12-01 02:07:04 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-12-01 21:12:13 +0000 |
commit | 5de5b7773970f92f140e6de7da1987bab4cfac04 (patch) | |
tree | 827e30dcbfcd5dbe51b57dd610229021e6940344 /lib/PublicInbox/TestCommon.pm | |
parent | 2a71ffab935d66cf2a985bc1c01540e721ea72e8 (diff) | |
download | public-inbox-5de5b7773970f92f140e6de7da1987bab4cfac04.tar.gz |
tests: note kevent+tmpfs failures on DragonFly <= 6.4
I forgot to set TMPDIR=/path/to/non-tmpfs again.
Diffstat (limited to 'lib/PublicInbox/TestCommon.pm')
-rw-r--r-- | lib/PublicInbox/TestCommon.pm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 8e7eb950..f2914d09 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -24,7 +24,7 @@ BEGIN { @EXPORT = qw(tmpdir tcp_server tcp_connect require_git require_mods run_script start_script key2sub xsys xsys_e xqx eml_load tick have_xapian_compact json_utf8 setup_public_inboxes create_inbox - create_coderepo require_bsd + create_coderepo require_bsd kernel_version check_broken_tmpfs quit_waiter_pipe wait_for_eof tcp_host_port test_lei lei lei_ok $lei_out $lei_err $lei_opt test_httpd xbail require_cmd is_xdeeply tail_f @@ -37,6 +37,27 @@ BEGIN { push @EXPORT, @methods; } +sub kernel_version () { + state $version = do { + require POSIX; + my @u = POSIX::uname(); + if ($u[2] =~ /\A([0-9]+(?:\.[0-9]+)+)/) { + eval "v$1"; + } else { + local $" = "', `"; + diag "Unable to get kernel version from: `@u'"; + undef; + } + }; +} + +sub check_broken_tmpfs () { + return if $^O ne 'dragonfly' || kernel_version ge v6.5; + diag 'EVFILT_VNODE + tmpfs is broken on dragonfly <= 6.4 (have: '. + sprintf('%vd', kernel_version).')'; + 1; +} + sub require_bsd (;$) { state $ok = ($^O =~ m!\A(?:free|net|open)bsd\z! || $^O eq 'dragonfly'); |