X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Finit.t;h=6f4c9dceeb33e60afcffe2f7ea242abc306add65;hb=1c3e60b66e01df89afdf74990a849a5a7386f9c7;hp=efa3314d365b03c049a9c2939b2529992d2a6874;hpb=4c6f9a39621fdae852e0655b7db3d61f03c716c5;p=public-inbox.git diff --git a/t/init.t b/t/init.t index efa3314d..6f4c9dce 100644 --- a/t/init.t +++ b/t/init.t @@ -97,8 +97,17 @@ sub quiet_fail { $cmd = [ '-init', 'deep-non-existent', "$tmpdir/a/b/c/d", qw(http://example.com/abcd abcd@example.com) ]; $err = ''; + my $umask = umask(022) // xbail "umask: $!"; ok(run_script($cmd, $env, $rdr), 'initializes non-existent hierarchy'); + umask($umask) // xbail "umask: $!"; ok(-d "$tmpdir/a/b/c/d", 'directory created'); + my $desc = "$tmpdir/a/b/c/d/description"; + is(PublicInbox::Inbox::try_cat($desc), + "public inbox for abcd\@example.com\n", 'description set'); + my $mode = (stat($desc))[2]; + is(sprintf('0%03o', $mode & 0777), '0644', + 'description respects umask'); + open my $fh, '>', "$tmpdir/d" or BAIL_OUT "open: $!"; close $fh; $cmd = [ '-init', 'd-f-conflict', "$tmpdir/d/f/conflict", @@ -196,7 +205,8 @@ SKIP: { $err = ''; ok(run_script([qw(-mda --no-precheck)], $env, $rdr), 'deliver V1'); diag "err=$err" if $err; - $mm = PublicInbox::Msgmap->new("$tmpdir/skip4"); + $mm = PublicInbox::Msgmap->new_file( + "$tmpdir/skip4/public-inbox/msgmap.sqlite3"); $n = $mm->num_for($mid); is($n, 13, 'V1 NNTP article numbers skipped via --skip-artnum'); }