]> git.proxmox.com Git - mirror_lxc.git/blame - src/tests/lxc-test-createconfig
tests: use busybox in lxc-test-unpriv
[mirror_lxc.git] / src / tests / lxc-test-createconfig
CommitLineData
e6744e9b
SH
1#!/bin/bash
2
3# lxc: linux Container library
4
5# Authors:
6# Serge Hallyn <serge.hallyn@ubuntu.com>
7#
8# This is a test script for the lxc-user-nic program
9
10# This library is free software; you can redistribute it and/or
11# modify it under the terms of the GNU Lesser General Public
12# License as published by the Free Software Foundation; either
13# version 2.1 of the License, or (at your option) any later version.
14
15# This library is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18# Lesser General Public License for more details.
19
20# You should have received a copy of the GNU Lesser General Public
21# License along with this library; if not, write to the Free Software
22# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
24set -e
25
26s=`mktemp -d /tmp/lxctest-XXXXXX`
27f="$s/in.conf"
28
29cleanup() {
30 lxc-destroy -n lxctestc || true
31 rm -rf $s
32}
33
34trap cleanup EXIT
35
36cat > $f << EOF
7fa3f2e9 37lxc.net.0.type = veth
38lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx
e6744e9b
SH
39EOF
40lxc-create -t busybox -f $f -n lxctestc
41grep -q "xx:xx" /var/lib/lxc/lxctestc/config && { echo "hwaddr not expanded"; exit 1; }
42echo "Success"