]> git.proxmox.com Git - mirror_lxc.git/blob - runapitests.sh
api: convert lxc_wait, lxc_freeze, and lxc_unfreeze
[mirror_lxc.git] / runapitests.sh
1 #!/bin/sh
2
3 cleanup() {
4 rm -f /etc/lxc/test-busybox.conf
5 rm -f liblxc.so.0
6 }
7
8 if [ `id -u` -ne 0 ]; then
9 echo "Run as root"
10 exit 1
11 fi
12
13 cat > /etc/lxc/test-busybox.conf << EOF
14 lxc.network.type=veth
15 lxc.network.link=lxcbr0
16 lxc.network.flags=up
17 EOF
18
19 [ -f liblxc.so.0 ] || ln -s src/lxc/liblxc.so ./liblxc.so.0
20 export LD_LIBRARY_PATH=.
21 TESTS="lxc-test-containertests lxc-test-locktests lxc-test-startone"
22 for curtest in $TESTS; do
23 echo "running $curtest"
24 ./src/tests/$curtest
25 if [ $? -ne 0 ]; then
26 echo "Test $curtest failed. Stopping"
27 cleanup
28 exit 1
29 fi
30 done
31 echo "All tests passed"
32 cleanup