~ubuntu-branches/ubuntu/quantal/lxc/quantal-201208301614

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

cleanup() {
    rm -f /etc/lxc/test-busybox.conf
    rm -f liblxc.so.0
}

if [ `id -u` -ne 0 ]; then
	echo "Run as root"
	exit 1
fi

cat > /etc/lxc/test-busybox.conf << EOF
lxc.network.type=veth
lxc.network.link=lxcbr0
lxc.network.flags=up
EOF

[ -f liblxc.so.0 ] || ln -s src/lxc/liblxc.so ./liblxc.so.0
export LD_LIBRARY_PATH=.
TESTS="containertests locktests startone"
for curtest in $TESTS; do
	echo "running $curtest"
	./src/tests/$curtest
	if [ $? -ne 0 ]; then
		echo "Test $curtest failed.  Stopping"
		cleanup
		exit 1
	fi
done
echo "All tests passed"
cleanup