##// END OF EJS Templates
Added test case for zip/gz/bz2 archive downloads.
Thomas Arendsen Hein -
r1166:bd66294b default
parent child Browse files
Show More
@@ -0,0 +1,37 b''
1 #!/bin/sh
2
3 mkdir test
4 cd test
5 hg init
6 echo foo>foo
7 hg addremove
8 hg commit -m 1
9 echo bar>bar
10 hg addremove
11 hg commit -m 2
12 mkdir baz
13 echo bletch>baz/bletch
14 hg addremove
15 hg commit -m 3
16 echo "name = test-archive" >> .hg/hgrc
17 echo "allowzip = true" >> .hg/hgrc
18 echo "allowgz = true" >> .hg/hgrc
19 echo "allowbz2 = true" >> .hg/hgrc
20 hg serve -p 20059 > /dev/null &
21 sleep 1 # wait for server to be started
22
23 TIP=`hg id -v | cut -f1 -d' '`
24 QTIP=`hg id -q`
25 cat > getarchive.py <<EOF
26 import sys, urllib2
27 node, archive = sys.argv[1:]
28 f = urllib2.urlopen('http://127.0.0.1:20059/?cmd=archive;node=%s;type=%s'
29 % (node, archive))
30 sys.stdout.write(f.read())
31 EOF
32 http_proxy= python getarchive.py "$TIP" gz | tar tzf - | sed "s/$QTIP/TIP/"
33 http_proxy= python getarchive.py "$TIP" bz2 | tar tjf - | sed "s/$QTIP/TIP/"
34 http_proxy= python getarchive.py "$TIP" zip > archive.zip
35 unzip -t archive.zip | sed "s/$QTIP/TIP/"
36
37 kill $!
@@ -0,0 +1,15 b''
1 adding foo
2 adding bar
3 adding baz/bletch
4 test-archive-TIP/bar
5 test-archive-TIP/baz/bletch
6 test-archive-TIP/foo
7 test-archive-TIP/bar
8 test-archive-TIP/baz/bletch
9 test-archive-TIP/foo
10 Archive: archive.zip
11 testing: test-archive-TIP/bar OK
12 testing: test-archive-TIP/baz/bletch OK
13 testing: test-archive-TIP/foo OK
14 No errors detected in compressed data of archive.zip.
15 killed!
General Comments 0
You need to be logged in to leave comments. Login now