author | Paul Crowley <paul@lshift.net> |
Tue, 15 Dec 2009 14:28:27 +0000 | |
changeset 269 | a09f1bc9a6cf |
parent 268 | 24145a4eb6fc |
child 270 | 28b355b7390e |
permissions | -rwxr-xr-x |
266
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
1 |
#!/bin/sh |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
2 |
|
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
3 |
set -e |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
4 |
|
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
5 |
cd |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
6 |
|
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
7 |
cat > .ssh/config <<__END__ |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
8 |
Host chroothg |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
9 |
Hostname localhost |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
10 |
User hg |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
11 |
Port 2222 |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
12 |
__END__ |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
13 |
|
268
24145a4eb6fc
Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents:
266
diff
changeset
|
14 |
echo "Pulling real project" |
266
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
15 |
hg clone ssh://chroothg/real/project |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
16 |
cd project |
269
a09f1bc9a6cf
Change back to non-Debian testing, fix test to work around NULL problem
Paul Crowley <paul@lshift.net>
parents:
268
diff
changeset
|
17 |
echo "and I'm adding something" >> allowedhere/content |
266
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
18 |
hg commit -u test2 -m "Added something to the file" |
269
a09f1bc9a6cf
Change back to non-Debian testing, fix test to work around NULL problem
Paul Crowley <paul@lshift.net>
parents:
268
diff
changeset
|
19 |
echo "This push should succeed" |
266
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
20 |
hg push |
269
a09f1bc9a6cf
Change back to non-Debian testing, fix test to work around NULL problem
Paul Crowley <paul@lshift.net>
parents:
268
diff
changeset
|
21 |
echo "And it did" |
a09f1bc9a6cf
Change back to non-Debian testing, fix test to work around NULL problem
Paul Crowley <paul@lshift.net>
parents:
268
diff
changeset
|
22 |
echo "This should fail" >> cantwrite |
268
24145a4eb6fc
Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents:
266
diff
changeset
|
23 |
hg commit -u test2 -m "WONTPUSH" |
24145a4eb6fc
Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents:
266
diff
changeset
|
24 |
# Fail only if this succeeds |
24145a4eb6fc
Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents:
266
diff
changeset
|
25 |
echo "About to do bad push" |
24145a4eb6fc
Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents:
266
diff
changeset
|
26 |
hg push && false |
24145a4eb6fc
Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents:
266
diff
changeset
|
27 |
echo "OK, checking that didn't push" |
24145a4eb6fc
Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents:
266
diff
changeset
|
28 |
hg outgoing --template '{desc}' |
24145a4eb6fc
Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents:
266
diff
changeset
|
29 |
echo "really checking now" |
24145a4eb6fc
Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents:
266
diff
changeset
|
30 |
hg outgoing --template '{desc}' | grep -q WONTPUSH |
24145a4eb6fc
Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents:
266
diff
changeset
|
31 |
echo "done" |