Patchwork [STABLE] blackbox: don't run permission tests on non-unix systems

login
register
mail settings
Submitter Durham Goode
Date April 23, 2013, 1:59 a.m.
Message ID <f3b82da3de1b2a39d656.1366682346@dev350.prn1.facebook.com>
Download mbox | patch
Permalink /patch/1472/
State Accepted
Commit 63dda3c3bb114150ea88b90eaccce8123b9e7d52
Headers show

Comments

Durham Goode - April 23, 2013, 1:59 a.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1366678859 25200
#      Mon Apr 22 18:00:59 2013 -0700
# Branch stable
# Node ID f3b82da3de1b2a39d6564322cb3ffeba98f5e9b6
# Parent  e97ce4a5afc5c68764a951f125c125880018adbf
blackbox: don't run permission tests on non-unix systems

The windows and vfat test runs were failing due to read/write permissions not
working the same on those systems.  On vfat, permissions can't be changed
at all, and on windows it seems the chmod emulation doesn't remove read
permissions.  We could theoretically get the 'cannot write to blacklog.log'
test to pass on windows but there's no #if condition to let us exclude vfat
only.

Verified that test-blackbox passes on windows now.
Matt Mackall - April 23, 2013, 3:38 a.m.
On Mon, 2013-04-22 at 18:59 -0700, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1366678859 25200
> #      Mon Apr 22 18:00:59 2013 -0700
> # Branch stable
> # Node ID f3b82da3de1b2a39d6564322cb3ffeba98f5e9b6
> # Parent  e97ce4a5afc5c68764a951f125c125880018adbf
> blackbox: don't run permission tests on non-unix systems
> 
> The windows and vfat test runs were failing due to read/write permissions not
> working the same on those systems.  On vfat, permissions can't be changed
> at all, and on windows it seems the chmod emulation doesn't remove read
> permissions.  We could theoretically get the 'cannot write to blacklog.log'
> test to pass on windows but there's no #if condition to let us exclude vfat
> only.
> 
> Verified that test-blackbox passes on windows now.

Excellent, queued for stable.

Patch

diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t
--- a/tests/test-blackbox.t
+++ b/tests/test-blackbox.t
@@ -64,6 +64,8 @@ 
 
   $ hg rollback
   repository tip rolled back to revision 1 (undo pull)
+
+#if unix-permissions
   $ chmod 000 .hg/blackbox.log
   $ hg --debug incoming
   warning: cannot write to blackbox.log: Permission denied
@@ -85,6 +87,7 @@ 
   c
   
   
+#endif
   $ hg pull
   pulling from $TESTTMP/blackboxtest (glob)
   searching for changes
@@ -95,12 +98,13 @@ 
   (run 'hg update' to get a working copy)
 
 a failure reading from the log is fine
-
+#if unix-permissions
   $ hg blackbox -l 3
   abort: Permission denied: $TESTTMP/blackboxtest2/.hg/blackbox.log
   [255]
 
   $ chmod 600 .hg/blackbox.log
+#endif
 
 backup bundles get logged