]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/v2writable.t
respect umask if core.sharedRepository is not set
[public-inbox.git] / t / v2writable.t
index d37fb06eae1bdf08582db8ec5771d1841e68a793..9e3bb755d9c233e7e90a5d2f22aa6278d71d95f5 100644 (file)
@@ -11,6 +11,7 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
        plan skip_all => "$mod missing for nntpd.t" if $@;
 }
 use_ok 'PublicInbox::V2Writable';
+umask 007;
 my $mainrepo = tempdir('pi-v2writable-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
        mainrepo => $mainrepo,
@@ -36,6 +37,15 @@ my $im = eval {
 };
 is($im->{partitions}, 1, 'one partition when forced');
 ok($im->add($mime), 'ordinary message added');
+foreach my $f ("$mainrepo/msgmap.sqlite3",
+               glob("$mainrepo/xap*/*"),
+               glob("$mainrepo/xap*/*/*")) {
+       my @st = stat($f);
+       my ($bn) = (split(m!/!, $f))[-1];
+       is($st[2] & 07777, -f _ ? 0660 : 0770,
+               "default sharedRepository respected for $bn");
+}
+
 my $git0;
 
 if ('ensure git configs are correct') {