Change rules to test the hard case
authorPaul Crowley <paul@lshift.net>
Tue, 15 Dec 2009 15:35:50 +0000
changeset 270 28b355b7390e
parent 269 a09f1bc9a6cf
child 271 c1ceab337505
Change rules to test the hard case
action/test1
action/test2
--- a/action/test1	Tue Dec 15 14:28:27 2009 +0000
+++ b/action/test1	Tue Dec 15 15:35:50 2009 +0000
@@ -17,8 +17,8 @@
 cd hgadmin
 
 cat > access.conf <<__END__
-write user=restricted/** file=allowedhere/**
-read user=restricted/**
+read user=restricted/** file=denied/**
+write user=restricted/**
 __END__
 mkdir -p keys/restricted
 cp /home/test2/.ssh/id_rsa.pub keys/restricted/test2
@@ -31,10 +31,10 @@
 mkdir realrepo
 cd realrepo
 hg init .
-mkdir allowedhere
-echo "This is a file" > allowedhere/content
-echo "This is a file not everyone can write to" > cantwrite
-hg add allowedhere/content cantwrite
+mkdir denied
+echo "This is a file" > content
+echo "This is a file not everyone can write to" > denied/cantwrite
+hg add content denied/cantwrite
 hg commit -u test1 -m "Add files to the repo"
 echo "Pushing changes"
 hg clone . ssh://chroothg/real/project
--- a/action/test2	Tue Dec 15 14:28:27 2009 +0000
+++ b/action/test2	Tue Dec 15 15:35:50 2009 +0000
@@ -14,18 +14,16 @@
 echo "Pulling real project"
 hg clone ssh://chroothg/real/project
 cd project
-echo "and I'm adding something" >> allowedhere/content
+echo "and I'm adding something" >> content
 hg commit -u test2 -m "Added something to the file"
 echo "This push should succeed"
 hg push
 echo "And it did"
-echo "This should fail" >> cantwrite
+echo "This should fail" >> denied/cantwrite
 hg commit -u test2 -m "WONTPUSH"
 # Fail only if this succeeds
 echo "About to do bad push"
 hg push && false
-echo "OK, checking that didn't push"
-hg outgoing --template '{desc}'
 echo "really checking now"
 hg outgoing --template '{desc}' | grep -q WONTPUSH
 echo "done"