--- a/action/go Tue Dec 15 13:52:23 2009 +0000
+++ b/action/go Tue Dec 15 14:28:27 2009 +0000
@@ -13,20 +13,21 @@
#aptitude --allow-untrusted --quiet --without-recommends --assume-yes install mercurial
#hg --version
-#aptitude --allow-untrusted --quiet --without-recommends --assume-yes install \
-# make mercurial xsltproc docbook-xsl openssh-server
+aptitude --allow-untrusted --quiet --without-recommends --assume-yes install \
+ make mercurial xsltproc docbook-xsl openssh-server \
+ python python-support adduser
-aptitude --allow-untrusted --quiet --without-recommends --assume-yes install \
- debconf python python-support adduser mercurial openssh-server
+#aptitude --allow-untrusted --quiet --without-recommends --assume-yes install \
+# debconf python python-support adduser mercurial openssh-server
perl -i -pe 's/^Port 22$/Port 2222/' /etc/ssh/sshd_config
/etc/init.d/ssh start
ssh-keyscan -p 2222 localhost > /etc/ssh/ssh_known_hosts
-dpkg -i mercurial-server_1.0-1_all.deb
-#cd mercurial-server
-#make setup-adduser
+#dpkg -i mercurial-server_1.0-1_all.deb
+cd mercurial-server
+make setup-adduser
for user in test1 test2 ; do
adduser --gecos $user --disabled-password $user
@@ -34,7 +35,7 @@
su -l -c 'ssh-keygen -N "" -f .ssh/id_rsa -t rsa' $user
done
cp /home/test1/.ssh/id_rsa.pub /etc/mercurial-server/keys/root/test1
-su -l -c /usr/share/mercurial-server/refresh-auth hg
+su -l -c /usr/local/share/mercurial-server/refresh-auth hg
su -l -c /action/test1 test1
su -l -c /action/test2 test2
--- a/action/test1 Tue Dec 15 13:52:23 2009 +0000
+++ b/action/test1 Tue Dec 15 14:28:27 2009 +0000
@@ -17,8 +17,8 @@
cd hgadmin
cat > access.conf <<__END__
-read user=restricted/** file=special/**
-write user=restricted/**
+write user=restricted/** file=allowedhere/**
+read user=restricted/**
__END__
mkdir -p keys/restricted
cp /home/test2/.ssh/id_rsa.pub keys/restricted/test2
@@ -31,11 +31,11 @@
mkdir realrepo
cd realrepo
hg init .
-echo "This is a file" > content
-mkdir special
-echo "This is a file not everyone can write to" > special/cantwrite
-hg add content special/cantwrite
-hg commit -u test1 -m "Add a file to the repo"
+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
+hg commit -u test1 -m "Add files to the repo"
echo "Pushing changes"
hg clone . ssh://chroothg/real/project
echo "Done for user test1"
--- a/action/test2 Tue Dec 15 13:52:23 2009 +0000
+++ b/action/test2 Tue Dec 15 14:28:27 2009 +0000
@@ -14,10 +14,12 @@
echo "Pulling real project"
hg clone ssh://chroothg/real/project
cd project
-echo "and I'm adding something" >> content
+echo "and I'm adding something" >> allowedhere/content
hg commit -u test2 -m "Added something to the file"
+echo "This push should succeed"
hg push
-echo "This should fail" >> special/cantwrite
+echo "And it did"
+echo "This should fail" >> cantwrite
hg commit -u test2 -m "WONTPUSH"
# Fail only if this succeeds
echo "About to do bad push"
--- a/run-test Tue Dec 15 13:52:23 2009 +0000
+++ b/run-test Tue Dec 15 14:28:27 2009 +0000
@@ -24,10 +24,10 @@
cp -av action $BACKING
#hg -R ../mercurial-server archive -r default $BACKING/action/mercurial-server
-#( cd ../mercurial-server && \
-# hg st -mac0n | cpio -p -0 -d $BACKING/action/mercurial-server )
+( cd ../mercurial-server && \
+ hg st -mac0n | cpio -p -0 -d $BACKING/action/mercurial-server )
-cp ../mercurial-server/build/debian/mercurial-server_1.0-1_all.deb $BACKING/action
+#cp ../mercurial-server/build/debian/mercurial-server_1.0-1_all.deb $BACKING/action
unionfs-fuse -o cow -o allow_other,suid,dev $BACKING=RW:$PRISTINE=RO $MOUNT