diff tests/test-hgwebdir.t @ 17017:953faba28e91

tests: prepare get-with-headers.py for MSYS get-with-headers.py took the http GET parameter as a command line parameter that had to start with '/'. MSYS on windows will mangle such paths. Instead of applying a workaround everywhere (such as an extra '/') we let get-with-headers.py add the mandatory '/'. That is consistent with the url path handling in the Mercurial url class. A few tests sent 'GET ?cmd=...' which is invalid. They will now send 'GET /?cmd=...'. This will not enable any tests for being run on windows - only remove one reason they were disabled.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 21 Jun 2012 03:05:02 +0200
parents 73d20de5f30b
children d5a3bda6e170
line wrap: on
line diff
--- a/tests/test-hgwebdir.t	Wed Jun 20 23:41:21 2012 +0200
+++ b/tests/test-hgwebdir.t	Thu Jun 21 03:05:02 2012 +0200
@@ -77,7 +77,7 @@
 
 should give a 404 - file does not exist
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/bork?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'a/file/tip/bork?style=raw'
   404 Not Found
   
   
@@ -86,25 +86,25 @@
 
 should succeed
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '?style=raw'
   200 Script output follows
   
   
   /a/
   /b/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/a?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'a/file/tip/a?style=raw'
   200 Script output follows
   
   a
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'b/file/tip/b?style=raw'
   200 Script output follows
   
   b
 
 should give a 404 - repo is not published
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'c/file/tip/c?style=raw'
   404 Not Found
   
   
@@ -113,14 +113,14 @@
 
 atom-log without basedir
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/atom-log' | grep '<link'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'a/atom-log' | grep '<link'
    <link rel="self" href="http://*:$HGPORT/a/atom-log"/> (glob)
    <link rel="alternate" href="http://*:$HGPORT/a/"/> (glob)
     <link href="http://*:$HGPORT/a/rev/8580ff50825a"/> (glob)
 
 rss-log without basedir
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/rss-log' | grep '<guid'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'a/rss-log' | grep '<guid'
       <guid isPermaLink="true">http://*:$HGPORT/a/rev/8580ff50825a</guid> (glob)
   $ cat > paths.conf <<EOF
   > [paths]
@@ -138,7 +138,7 @@
 
 should succeed, slashy names
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '?style=raw'
   200 Script output follows
   
   
@@ -177,7 +177,7 @@
   /astar/
   /astar/.hg/patches/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '?style=paper'
   200 Script output follows
   
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
@@ -490,19 +490,19 @@
   </body>
   </html>
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 't?style=raw'
   200 Script output follows
   
   
   /t/a/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 't/?style=raw'
   200 Script output follows
   
   
   /t/a/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=paper'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 't/?style=paper'
   200 Script output follows
   
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
@@ -551,7 +551,7 @@
   </body>
   </html>
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a?style=atom'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 't/a?style=atom'
   200 Script output follows
   
   <?xml version="1.0" encoding="ascii"?>
@@ -581,7 +581,7 @@
    </entry>
   
   </feed>
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/?style=atom'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 't/a/?style=atom'
   200 Script output follows
   
   <?xml version="1.0" encoding="ascii"?>
@@ -611,14 +611,14 @@
    </entry>
   
   </feed>
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/file/tip/a?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 't/a/file/tip/a?style=raw'
   200 Script output follows
   
   a
 
 Test [paths] '*' extension
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'coll/?style=raw'
   200 Script output follows
   
   
@@ -629,14 +629,14 @@
   /coll/notrepo/e/
   /coll/notrepo/f/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'coll/a/file/tip/a?style=raw'
   200 Script output follows
   
   a
 
 Test [paths] '**' extension
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/?style=raw'
   200 Script output follows
   
   
@@ -650,7 +650,7 @@
   /rcoll/notrepo/f/
   /rcoll/notrepo/f/f2/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw'
   200 Script output follows
   
   d
@@ -665,7 +665,7 @@
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-3.log
   $ cat hg.pid >> $DAEMON_PIDS
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'coll/?style=raw'
   200 Script output follows
   
   
@@ -675,11 +675,11 @@
   /coll/c/
   /coll/notrepo/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'coll/a/file/tip/a?style=raw'
   200 Script output follows
   
   a
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/?style=raw'
   200 Script output follows
   
   
@@ -690,14 +690,14 @@
   /rcoll/c/
   /rcoll/notrepo/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw'
   200 Script output follows
   
   d
 
 Test intermediate directories
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/notrepo/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/notrepo/?style=raw'
   200 Script output follows
   
   
@@ -709,14 +709,14 @@
 
 Test repositories inside intermediate directories
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/notrepo/e/file/tip/e?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/notrepo/e/file/tip/e?style=raw'
   200 Script output follows
   
   e
 
 Test subrepositories inside intermediate directories
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/notrepo/f/f2/file/tip/f2?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/notrepo/f/f2/file/tip/f2?style=raw'
   200 Script output follows
   
   f2
@@ -730,7 +730,7 @@
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-4.log
   $ cat hg.pid >> $DAEMON_PIDS
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'coll/?style=raw'
   200 Script output follows
   
   
@@ -738,11 +738,11 @@
   /coll/b/
   /coll/c/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'coll/a/file/tip/a?style=raw'
   200 Script output follows
   
   a
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/?style=raw'
   200 Script output follows
   
   
@@ -750,14 +750,14 @@
   /rcoll/b/
   /rcoll/c/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw'
   200 Script output follows
   
   d
 
 Test intermediate directories
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/notrepo/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/notrepo/?style=raw'
   200 Script output follows
   
   
@@ -767,14 +767,14 @@
 
 Test repositories inside intermediate directories
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/notrepo/e/file/tip/e?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/notrepo/e/file/tip/e?style=raw'
   200 Script output follows
   
   e
 
 Test subrepositories inside intermediate directories
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/notrepo/f/f2/file/tip/f2?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'rcoll/notrepo/f/f2/file/tip/f2?style=raw'
   200 Script output follows
   
   f2
@@ -794,7 +794,7 @@
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-5.log
   $ cat hg.pid >> $DAEMON_PIDS
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '?style=raw'
   200 Script output follows
   
   
@@ -802,7 +802,7 @@
   /t/b/
   /c/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 't/?style=raw'
   200 Script output follows
   
   
@@ -820,14 +820,14 @@
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-6.log
   $ cat hg.pid >> $DAEMON_PIDS
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '?style=raw'
   200 Script output follows
   
   
   /t/
   /c/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 't/?style=raw'
   200 Script output follows
   
   
@@ -844,13 +844,13 @@
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-7.log
   $ cat hg.pid >> $DAEMON_PIDS
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '?style=raw'
   200 Script output follows
   
   
   /c/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 't/?style=raw'
   200 Script output follows
   
   
@@ -869,7 +869,7 @@
 
 test inexistent and inaccessible repo should be ignored silently
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 ''
   200 Script output follows
   
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
@@ -921,7 +921,7 @@
 
 collections: should succeed
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '?style=raw'
   200 Script output follows
   
   
@@ -932,29 +932,29 @@
   /notrepo/e/
   /notrepo/f/
   
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 'a/file/tip/a?style=raw'
   200 Script output follows
   
   a
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 'b/file/tip/b?style=raw'
   200 Script output follows
   
   b
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 'c/file/tip/c?style=raw'
   200 Script output follows
   
   c
 
 atom-log with basedir /
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' | grep '<link'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 'a/atom-log' | grep '<link'
    <link rel="self" href="http://hg.example.com:8080/a/atom-log"/>
    <link rel="alternate" href="http://hg.example.com:8080/a/"/>
     <link href="http://hg.example.com:8080/a/rev/8580ff50825a"/>
 
 rss-log with basedir /
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' | grep '<guid'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 'a/rss-log' | grep '<guid'
       <guid isPermaLink="true">http://hg.example.com:8080/a/rev/8580ff50825a</guid>
   $ "$TESTDIR/killdaemons.py"
   $ hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \
@@ -964,14 +964,14 @@
 
 atom-log with basedir /foo/
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' | grep '<link'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 'a/atom-log' | grep '<link'
    <link rel="self" href="http://hg.example.com:8080/foo/a/atom-log"/>
    <link rel="alternate" href="http://hg.example.com:8080/foo/a/"/>
     <link href="http://hg.example.com:8080/foo/a/rev/8580ff50825a"/>
 
 rss-log with basedir /foo/
 
-  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' | grep '<guid'
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 'a/rss-log' | grep '<guid'
       <guid isPermaLink="true">http://hg.example.com:8080/foo/a/rev/8580ff50825a</guid>
 
 paths errors 1