dev/chroot-test/action/go
author Paul Crowley <paul@lshift.net>
Thu, 08 Sep 2011 09:14:23 +0100
changeset 333 2e97efae4373
parent 327 6f2a3f251d3b
permissions -rwxr-xr-x
debian/rules should be executable
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
264
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     1
#!/bin/sh
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     2
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     3
set -e
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     4
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     5
cd action
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     6
265
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
     7
ls -l
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
     8
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
     9
. ./testing_system
327
6f2a3f251d3b Copy in and use environment vars to control test
Paul Crowley <paul@lshift.net>
parents: 311
diff changeset
    10
. ./env
265
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    11
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    12
#exec > results 2>&1
264
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    13
269
a09f1bc9a6cf Change back to non-Debian testing, fix test to work around NULL problem
Paul Crowley <paul@lshift.net>
parents: 267
diff changeset
    14
aptitude --allow-untrusted --quiet --without-recommends --assume-yes  install \
282
1239880543cf Some improvements to the chroot test, try to make it work with Debian
Paul Crowley <paul@lshift.net>
parents: 272
diff changeset
    15
    openssh-server
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    16
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    17
perl -i -pe 's/^Port 22$/Port 2222/' /etc/ssh/sshd_config
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    18
/etc/init.d/ssh start
299
f41666a08b87 Scan for all kinds of keys so we don't record one and get hung up on another
Paul Crowley <paul@lshift.net>
parents: 283
diff changeset
    19
ssh-keyscan -t rsa,dsa,ecdsa -p 2222 localhost > /etc/ssh/ssh_known_hosts
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    20
283
01eca64f77ab Break out all the stuff that needs to be different for Debian into separate files
Paul Crowley <paul@lshift.net>
parents: 282
diff changeset
    21
. ./install-installables
264
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    22
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    23
for user in test1 test2 ; do
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    24
    adduser --gecos $user --disabled-password $user
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    25
    su -l -c 'mkdir .ssh' $user
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    26
    su -l -c 'ssh-keygen -N "" -f .ssh/id_rsa -t rsa' $user
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    27
done
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    28
cp /home/test1/.ssh/id_rsa.pub /etc/mercurial-server/keys/root/test1
283
01eca64f77ab Break out all the stuff that needs to be different for Debian into separate files
Paul Crowley <paul@lshift.net>
parents: 282
diff changeset
    29
01eca64f77ab Break out all the stuff that needs to be different for Debian into separate files
Paul Crowley <paul@lshift.net>
parents: 282
diff changeset
    30
su -l -c /action/refresh-auth hg
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    31
su -l -c /action/test1 test1
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    32
su -l -c /action/test2 test2
264
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    33
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    34
/etc/init.d/ssh stop
265
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    35
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    36
#touch results