run-test
author Paul Crowley <paul@lshift.net>
Tue, 15 Dec 2009 13:52:23 +0000
changeset 268 24145a4eb6fc
parent 267 4f24892b33fe
child 269 a09f1bc9a6cf
permissions -rwxr-xr-x
Test file access conditions - they don't work
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
# Must be root to run this
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
set -e
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     6
267
4f24892b33fe Evil hack: make it so it instead uses the Debian package.
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
     7
DEBVERSION=sid
4f24892b33fe Evil hack: make it so it instead uses the Debian package.
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
     8
4f24892b33fe Evil hack: make it so it instead uses the Debian package.
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
     9
PRISTINE=/var/local/cache/pristine/$DEBVERSION
264
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    10
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    11
TOPDIR=`pwd`
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    12
BACKING=$TOPDIR/build/env/backing
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    13
MOUNT=$TOPDIR/build/env/mount
267
4f24892b33fe Evil hack: make it so it instead uses the Debian package.
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    14
mkdir -p $TOPDIR/build/env
4f24892b33fe Evil hack: make it so it instead uses the Debian package.
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    15
mkdir $BACKING $MOUNT
264
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    16
265
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    17
touch $BACKING/please-trash-this-system
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    18
mkdir -p $BACKING/etc
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    19
echo "pristine" > $BACKING/etc/debian_chroot
265
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    20
cp -v policy-rc.d $BACKING/etc/policy-rc.d
264
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    21
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    22
mkdir -p $BACKING/var/cache/apt/archives
267
4f24892b33fe Evil hack: make it so it instead uses the Debian package.
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    23
cp -v build/aptcache/$DEBVERSION/* $BACKING/var/cache/apt/archives || true
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    24
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    25
cp -av action $BACKING
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    26
#hg -R ../mercurial-server archive -r default $BACKING/action/mercurial-server
267
4f24892b33fe Evil hack: make it so it instead uses the Debian package.
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    27
#( cd ../mercurial-server && \
4f24892b33fe Evil hack: make it so it instead uses the Debian package.
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    28
#    hg st -mac0n | cpio -p -0 -d $BACKING/action/mercurial-server )
4f24892b33fe Evil hack: make it so it instead uses the Debian package.
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    29
4f24892b33fe Evil hack: make it so it instead uses the Debian package.
Paul Crowley <paul@lshift.net>
parents: 266
diff changeset
    30
cp ../mercurial-server/build/debian/mercurial-server_1.0-1_all.deb $BACKING/action
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    31
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    32
unionfs-fuse -o cow -o allow_other,suid,dev $BACKING=RW:$PRISTINE=RO $MOUNT
265
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    33
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    34
#mount --bind /dev "$MOUNT/dev"
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    35
#mount --bind /dev/pts "$MOUNT/dev/pts"
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    36
mount -t proc proc $MOUNT/proc
264
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    37
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    38
chroot $MOUNT ./action/go
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    39
265
6629144cf111 More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents: 264
diff changeset
    40
umount $MOUNT/proc
264
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    41
umount $MOUNT
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    42
266
7cc208cbf2be Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents: 265
diff changeset
    43
#cat $BACKING/action/results
264
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    44
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    45
rm -rf build/env
cd7f901d3902 Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    46