dev/chroot-test/action/test1
author Paul Crowley <paul@lshift.net>
Thu, 08 Sep 2011 09:14:23 +0100
changeset 333 2e97efae4373
parent 309 091630a3938e
permissions -rwxr-xr-x
debian/rules should be executable
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 "Cloning hgadmin..."
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/hgadmin
268
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    16
echo "Updating hgadmin..."
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    17
cd hgadmin
268
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    18
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    19
cat > access.conf <<__END__
270
28b355b7390e Change rules to test the hard case
Paul Crowley <paul@lshift.net>
parents: 269
diff changeset
    20
read user=restricted/** file=denied/**
28b355b7390e Change rules to test the hard case
Paul Crowley <paul@lshift.net>
parents: 269
diff changeset
    21
write user=restricted/**
268
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    22
__END__
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    23
mkdir -p keys/restricted
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    24
cp /home/test2/.ssh/id_rsa.pub keys/restricted/test2
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    25
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    26
hg add keys/restricted/test2 access.conf
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    27
hg commit -u test1 -m "Added user test2"
268
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    28
echo "Push"
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    29
hg push
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    30
cd ..
275
2e781d52f76e Subrepo support
Paul Crowley <paul@lshift.net>
parents: 272
diff changeset
    31
hg init realrepo
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    32
cd realrepo
270
28b355b7390e Change rules to test the hard case
Paul Crowley <paul@lshift.net>
parents: 269
diff changeset
    33
mkdir denied
28b355b7390e Change rules to test the hard case
Paul Crowley <paul@lshift.net>
parents: 269
diff changeset
    34
echo "This is a file" > content
28b355b7390e Change rules to test the hard case
Paul Crowley <paul@lshift.net>
parents: 269
diff changeset
    35
echo "This is a file not everyone can write to" > denied/cantwrite
275
2e781d52f76e Subrepo support
Paul Crowley <paul@lshift.net>
parents: 272
diff changeset
    36
hg init nested
2e781d52f76e Subrepo support
Paul Crowley <paul@lshift.net>
parents: 272
diff changeset
    37
echo "This is a file in a nested repo" > nested/content
2e781d52f76e Subrepo support
Paul Crowley <paul@lshift.net>
parents: 272
diff changeset
    38
hg add -R nested nested/content
2e781d52f76e Subrepo support
Paul Crowley <paul@lshift.net>
parents: 272
diff changeset
    39
hg commit -u test1 -R nested -m "Add files to the subrepo"
2e781d52f76e Subrepo support
Paul Crowley <paul@lshift.net>
parents: 272
diff changeset
    40
echo "nested = nested" > .hgsub
2e781d52f76e Subrepo support
Paul Crowley <paul@lshift.net>
parents: 272
diff changeset
    41
hg add content denied/cantwrite .hgsub
269
a09f1bc9a6cf Change back to non-Debian testing, fix test to work around NULL problem
Paul Crowley <paul@lshift.net>
parents: 268
diff changeset
    42
hg commit -u test1 -m "Add files to the repo"
268
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    43
echo "Pushing changes"
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    44
hg clone . ssh://chroothg/real/project
275
2e781d52f76e Subrepo support
Paul Crowley <paul@lshift.net>
parents: 272
diff changeset
    45
hg clone nested ssh://chroothg/real/project/nested
302
020082c44cdf A failing test for mq
Paul Crowley <paul@lshift.net>
parents: 275
diff changeset
    46
cd ..
020082c44cdf A failing test for mq
Paul Crowley <paul@lshift.net>
parents: 275
diff changeset
    47
echo "Creating an mq repository"
020082c44cdf A failing test for mq
Paul Crowley <paul@lshift.net>
parents: 275
diff changeset
    48
hg init qrepo
309
091630a3938e Use old-style qinit for mercurial 1.0 compatibility
Paul Crowley <paul@lshift.net>
parents: 302
diff changeset
    49
(cd qrepo ; hg --config extensions.mq= qinit -c)
302
020082c44cdf A failing test for mq
Paul Crowley <paul@lshift.net>
parents: 275
diff changeset
    50
hg --config extensions.mq= qclone qrepo ssh://chroothg/qrepo
268
24145a4eb6fc Test file access conditions - they don't work
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    51
echo "Done for user test1"