changeset 29564:db565a506729

test-http: use sed instead of fixed-with cut for reading access.log Some systems (like FreeBSD jails) use something other than 127.0.0.1 for localhost, and it's not safe to assume it'll always be the same width. Using sed with a replacement like this sidesteps the problem.
author Augie Fackler <augie@google.com>
date Fri, 15 Jul 2016 12:39:36 -0400
parents 839380cc3368
children 143d21a7343e
files tests/test-http-bundle1.t tests/test-http.t
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-http-bundle1.t	Fri Jul 15 12:34:15 2016 -0400
+++ b/tests/test-http-bundle1.t	Fri Jul 15 12:39:36 2016 -0400
@@ -234,7 +234,7 @@
   remote: added 1 changesets with 1 changes to 1 files
   $ hg rollback -q
 
-  $ cut -c38- ../access.log
+  $ sed 's/.*] "/"/' < ../access.log
   "GET /?cmd=capabilities HTTP/1.1" 200 -
   "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip
   "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces
--- a/tests/test-http.t	Fri Jul 15 12:34:15 2016 -0400
+++ b/tests/test-http.t	Fri Jul 15 12:39:36 2016 -0400
@@ -225,7 +225,7 @@
   remote: added 1 changesets with 1 changes to 1 files
   $ hg rollback -q
 
-  $ cut -c38- ../access.log
+  $ sed 's/.*] "/"/' < ../access.log
   "GET /?cmd=capabilities HTTP/1.1" 200 -
   "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip
   "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces