[Updated] D11739: tests: add guard check for suid support
pacien (Pacien)
phabricator at mercurial-scm.org
Tue Nov 9 14:30:57 UTC 2021
Closed by commit rHG2435627b40e6: tests: add guard check for suid support (authored by pacien).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
CHANGED PRIOR TO COMMIT
https://phab.mercurial-scm.org/D11739?vs=31031&id=31036#toc
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11739?vs=31031&id=31036
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11739/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11739
AFFECTED FILES
tests/hghave.py
tests/test-remotefilelog-permissions.t
CHANGE DETAILS
diff --git a/tests/test-remotefilelog-permissions.t b/tests/test-remotefilelog-permissions.t
--- a/tests/test-remotefilelog-permissions.t
+++ b/tests/test-remotefilelog-permissions.t
@@ -33,6 +33,8 @@
$ chmod -R u+w master/.hg/remotefilelogcache
+#if suidbit
+
# Test setting up shared cache with the right permissions
# (this is hard to test in a cross platform way, so we just make sure nothing
# crashes)
@@ -44,3 +46,5 @@
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
$ ls -ld $CACHEDIR/11
drwxrws* $TESTTMP/hgcache/11 (glob)
+
+#endif
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -264,6 +264,13 @@
return not (new_file_has_exec or exec_flags_cannot_flip)
+ at check("suidbit", "setuid and setgid bit")
+def has_suidbit():
+ if not hasattr(os, "statvfs") or not hasattr(os, "ST_NOSUID"):
+ return False
+ return bool(os.statvfs('.').f_flag & os.ST_NOSUID)
+
+
@check("icasefs", "case insensitive file system")
def has_icasefs():
# Stolen from mercurial.util
To: Alphare, #hg-reviewers
Cc: pacien, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211109/9898ff2e/attachment-0002.html>
More information about the Mercurial-patches
mailing list