Show More
@@ -1,120 +1,120 b'' | |||||
1 | #require serve |
|
1 | #require serve | |
2 |
|
2 | |||
3 | $ hgserve() |
|
3 | $ hgserve() | |
4 | > { |
|
4 | > { | |
5 | > hg serve -a localhost -d --pid-file=hg.pid -E errors.log -v $@ \ |
|
5 | > hg serve -a localhost -d --pid-file=hg.pid -E errors.log -v $@ \ | |
6 | > | sed -e "s/:$HGPORT1\\([^0-9]\\)/:HGPORT1\1/g" \ |
|
6 | > | sed -e "s/:$HGPORT1\\([^0-9]\\)/:HGPORT1\1/g" \ | |
7 | > -e "s/:$HGPORT2\\([^0-9]\\)/:HGPORT2\1/g" \ |
|
7 | > -e "s/:$HGPORT2\\([^0-9]\\)/:HGPORT2\1/g" \ | |
8 | > -e 's/http:\/\/[^/]*\//http:\/\/localhost\//' |
|
8 | > -e 's/http:\/\/[^/]*\//http:\/\/localhost\//' | |
9 | > if [ -f hg.pid ]; then |
|
9 | > if [ -f hg.pid ]; then | |
10 | > killdaemons.py hg.pid |
|
10 | > killdaemons.py hg.pid | |
11 | > fi |
|
11 | > fi | |
12 | > echo % errors |
|
12 | > echo % errors | |
13 | > cat errors.log |
|
13 | > cat errors.log | |
14 | > } |
|
14 | > } | |
15 |
|
15 | |||
16 | $ hg init test |
|
16 | $ hg init test | |
17 | $ cd test |
|
17 | $ cd test | |
18 | $ echo '[web]' > .hg/hgrc |
|
18 | $ echo '[web]' > .hg/hgrc | |
19 | $ echo 'accesslog = access.log' >> .hg/hgrc |
|
19 | $ echo 'accesslog = access.log' >> .hg/hgrc | |
20 | $ echo "port = $HGPORT1" >> .hg/hgrc |
|
20 | $ echo "port = $HGPORT1" >> .hg/hgrc | |
21 |
|
21 | |||
22 | Without -v |
|
22 | Without -v | |
23 |
|
23 | |||
24 | $ hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
24 | $ hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
25 | $ cat hg.pid >> "$DAEMON_PIDS" |
|
25 | $ cat hg.pid >> "$DAEMON_PIDS" | |
26 | $ if [ -f access.log ]; then |
|
26 | $ if [ -f access.log ]; then | |
27 | > echo 'access log created - .hg/hgrc respected' |
|
27 | > echo 'access log created - .hg/hgrc respected' | |
28 | > fi |
|
28 | > fi | |
29 | access log created - .hg/hgrc respected |
|
29 | access log created - .hg/hgrc respected | |
30 |
|
30 | |||
31 | errors |
|
31 | errors | |
32 |
|
32 | |||
33 | $ cat errors.log |
|
33 | $ cat errors.log | |
34 |
|
34 | |||
35 | With -v |
|
35 | With -v | |
36 |
|
36 | |||
37 | $ hgserve |
|
37 | $ hgserve | |
38 | listening at http://localhost/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) |
|
38 | listening at http://localhost/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) | |
39 | % errors |
|
39 | % errors | |
40 |
|
40 | |||
41 | With -v and -p HGPORT2 |
|
41 | With -v and -p HGPORT2 | |
42 |
|
42 | |||
43 | $ hgserve -p "$HGPORT2" |
|
43 | $ hgserve -p "$HGPORT2" | |
44 | listening at http://localhost/ (bound to *$LOCALIP*:HGPORT2) (glob) (?) |
|
44 | listening at http://localhost/ (bound to *$LOCALIP*:HGPORT2) (glob) (?) | |
45 | % errors |
|
45 | % errors | |
46 |
|
46 | |||
47 | With -v and -p daytime |
|
47 | With -v and -p daytime | |
48 |
|
48 | |||
49 | # On some system this will fails because port < 1024 are not bindable by normal |
|
49 | # On some system this will fails because port < 1024 are not bindable by normal | |
50 | # users. |
|
50 | # users. | |
51 | # |
|
51 | # | |
52 | # On some others the kernel is configured to allow any user to bind them and |
|
52 | # On some others the kernel is configured to allow any user to bind them and | |
53 | # this will work fine |
|
53 | # this will work fine | |
54 |
|
54 | |||
55 | #if no-windows |
|
55 | #if no-windows | |
56 | $ KILLQUIETLY=Y |
|
56 | $ KILLQUIETLY=Y | |
57 | $ hgserve -p daytime |
|
57 | $ hgserve -p daytime | |
58 |
abort: cannot start server at 'localhost:13': |
|
58 | abort: cannot start server at 'localhost:13': $EACCES$ (?) | |
59 | abort: child process failed to start (?) |
|
59 | abort: child process failed to start (?) | |
60 | abort: no port number associated with service 'daytime' (?) |
|
60 | abort: no port number associated with service 'daytime' (?) | |
61 | listening at http://localhost/ (bound to $LOCALIP:13) (?) |
|
61 | listening at http://localhost/ (bound to $LOCALIP:13) (?) | |
62 | % errors |
|
62 | % errors | |
63 | $ KILLQUIETLY=N |
|
63 | $ KILLQUIETLY=N | |
64 | #endif |
|
64 | #endif | |
65 |
|
65 | |||
66 | With --prefix foo |
|
66 | With --prefix foo | |
67 |
|
67 | |||
68 | $ hgserve --prefix foo |
|
68 | $ hgserve --prefix foo | |
69 | listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) |
|
69 | listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) | |
70 | % errors |
|
70 | % errors | |
71 |
|
71 | |||
72 | With --prefix /foo |
|
72 | With --prefix /foo | |
73 |
|
73 | |||
74 | $ hgserve --prefix /foo |
|
74 | $ hgserve --prefix /foo | |
75 | listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) |
|
75 | listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) | |
76 | % errors |
|
76 | % errors | |
77 |
|
77 | |||
78 | With --prefix foo/ |
|
78 | With --prefix foo/ | |
79 |
|
79 | |||
80 | $ hgserve --prefix foo/ |
|
80 | $ hgserve --prefix foo/ | |
81 | listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) |
|
81 | listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) | |
82 | % errors |
|
82 | % errors | |
83 |
|
83 | |||
84 | With --prefix /foo/ |
|
84 | With --prefix /foo/ | |
85 |
|
85 | |||
86 | $ hgserve --prefix /foo/ |
|
86 | $ hgserve --prefix /foo/ | |
87 | listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) |
|
87 | listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) | |
88 | % errors |
|
88 | % errors | |
89 |
|
89 | |||
90 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
90 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS | |
91 |
|
91 | |||
92 | With out of bounds accesses |
|
92 | With out of bounds accesses | |
93 |
|
93 | |||
94 | $ rm access.log |
|
94 | $ rm access.log | |
95 | $ hg serve -a localhost -p $HGPORT -d --prefix some/dir \ |
|
95 | $ hg serve -a localhost -p $HGPORT -d --prefix some/dir \ | |
96 | > --pid-file=hg.pid -E errors.log |
|
96 | > --pid-file=hg.pid -E errors.log | |
97 | $ cat hg.pid >> "$DAEMON_PIDS" |
|
97 | $ cat hg.pid >> "$DAEMON_PIDS" | |
98 |
|
98 | |||
99 | $ hg id http://localhost:$HGPORT/some/dir7 |
|
99 | $ hg id http://localhost:$HGPORT/some/dir7 | |
100 | abort: HTTP Error 404: Not Found |
|
100 | abort: HTTP Error 404: Not Found | |
101 | [100] |
|
101 | [100] | |
102 | $ hg id http://localhost:$HGPORT/some |
|
102 | $ hg id http://localhost:$HGPORT/some | |
103 | abort: HTTP Error 404: Not Found |
|
103 | abort: HTTP Error 404: Not Found | |
104 | [100] |
|
104 | [100] | |
105 |
|
105 | |||
106 | $ cat access.log errors.log |
|
106 | $ cat access.log errors.log | |
107 | $LOCALIP - - [$LOGDATE$] "GET /some/dir7?cmd=capabilities HTTP/1.1" 404 - (glob) |
|
107 | $LOCALIP - - [$LOGDATE$] "GET /some/dir7?cmd=capabilities HTTP/1.1" 404 - (glob) | |
108 | $LOCALIP - - [$LOGDATE$] "GET /some?cmd=capabilities HTTP/1.1" 404 - (glob) |
|
108 | $LOCALIP - - [$LOGDATE$] "GET /some?cmd=capabilities HTTP/1.1" 404 - (glob) | |
109 |
|
109 | |||
110 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
110 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS | |
111 |
|
111 | |||
112 | issue6362: Previously, this crashed on Python 3 |
|
112 | issue6362: Previously, this crashed on Python 3 | |
113 |
|
113 | |||
114 | $ hg serve -a 0.0.0.0 -d --pid-file=hg.pid |
|
114 | $ hg serve -a 0.0.0.0 -d --pid-file=hg.pid | |
115 | listening at http://*:$HGPORT1/ (bound to *:$HGPORT1) (glob) (?) |
|
115 | listening at http://*:$HGPORT1/ (bound to *:$HGPORT1) (glob) (?) | |
116 |
|
116 | |||
117 | $ cat hg.pid > "$DAEMON_PIDS" |
|
117 | $ cat hg.pid > "$DAEMON_PIDS" | |
118 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
118 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS | |
119 |
|
119 | |||
120 | $ cd .. |
|
120 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now