]>
Commit | Line | Data |
---|---|---|
0a8722fd | 1 | #!/bin/sh |
250b1eec SG |
2 | # liblxcapi |
3 | # | |
4 | # Copyright © 2012 Serge Hallyn <serge.hallyn@ubuntu.com>. | |
5 | # Copyright © 2012 Canonical Ltd. | |
6 | # | |
7 | # This library is free software; you can redistribute it and/or | |
8 | # modify it under the terms of the GNU Lesser General Public | |
9 | # License as published by the Free Software Foundation; either | |
10 | # version 2.1 of the License, or (at your option) any later version. | |
11 | ||
12 | # This library is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | # Lesser General Public License for more details. | |
16 | ||
17 | # You should have received a copy of the GNU Lesser General Public | |
18 | # License along with this library; if not, write to the Free Software | |
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
72d0e1cb SG |
20 | |
21 | cleanup() { | |
22 | rm -f /etc/lxc/test-busybox.conf | |
23 | rm -f liblxc.so.0 | |
24 | } | |
25 | ||
26 | if [ `id -u` -ne 0 ]; then | |
14d9c0f0 SG |
27 | echo "Run as root" |
28 | exit 1 | |
72d0e1cb SG |
29 | fi |
30 | ||
31 | cat > /etc/lxc/test-busybox.conf << EOF | |
32 | lxc.network.type=veth | |
33 | lxc.network.link=lxcbr0 | |
34 | lxc.network.flags=up | |
35 | EOF | |
36 | ||
37 | [ -f liblxc.so.0 ] || ln -s src/lxc/liblxc.so ./liblxc.so.0 | |
38 | export LD_LIBRARY_PATH=. | |
16216c83 | 39 | TESTS="lxc-test-containertests lxc-test-locktests lxc-test-startone" |
72d0e1cb | 40 | for curtest in $TESTS; do |
14d9c0f0 SG |
41 | echo "running $curtest" |
42 | ./src/tests/$curtest | |
43 | if [ $? -ne 0 ]; then | |
44 | echo "Test $curtest failed. Stopping" | |
45 | cleanup | |
46 | exit 1 | |
47 | fi | |
72d0e1cb SG |
48 | done |
49 | echo "All tests passed" | |
50 | cleanup |