Patchwork D11228: tests: make test-serve works on system that allow user to bind low port

login
register
mail settings
Submitter phabricator
Date July 29, 2021, 9:11 a.m.
Message ID <differential-rev-PHID-DREV-y25djb73fytrilcmsetg-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49542/
State Superseded
Headers show

Comments

phabricator - July 29, 2021, 9:11 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It is possible to encounter linux system configured in a way that allow port
  < 1024 to be bound by any users. So we update a test to focus more on the actual
  test: "resolving `daytime` to an actual port number.
  
  The new auto-scaling CI runner provided by clever cloud is doing so. This is the
  initial motivation for this change, but it seems useful anyway.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D11228

AFFECTED FILES
  tests/test-serve.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-serve.t b/tests/test-serve.t
--- a/tests/test-serve.t
+++ b/tests/test-serve.t
@@ -44,13 +44,20 @@ 
   listening at http://localhost/ (bound to *$LOCALIP*:HGPORT2) (glob) (?)
   % errors
 
-With -v and -p daytime (should fail because low port)
+With -v and -p daytime
 
-#if no-root no-windows
+# On some system this will fails because port < 1024 are not bindable by normal
+# users.
+#
+# On some others the kernel is configured to allow any user to bind them and
+# this will work fine
+
+#if no-windows
   $ KILLQUIETLY=Y
   $ hgserve -p daytime
-  abort: cannot start server at 'localhost:13': Permission denied
-  abort: child process failed to start
+  abort: cannot start server at 'localhost:13': Permission denied (?)
+  abort: child process failed to start (?)
+  listening at http://localhost/ (bound to $LOCALIP:13) (?)
   % errors
   $ KILLQUIETLY=N
 #endif