| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# SPDX-License-Identifier: LGPL-2.1+ |
| 4 |
|
| 5 |
# lxc: linux Container library |
| 6 |
# |
| 7 |
# This is a test script for the lxc-user-nic program |
| 8 |
|
| 9 |
set -e |
| 10 |
|
| 11 |
s=$(mktemp -d /tmp/lxctest-XXXXXX) |
| 12 |
f="$s/in.conf" |
| 13 |
|
| 14 |
cleanup() { |
| 15 |
lxc-destroy -n lxctestc || true |
| 16 |
rm -rf $s |
| 17 |
} |
| 18 |
|
| 19 |
trap cleanup EXIT |
| 20 |
|
| 21 |
cat > $f << EOF |
| 22 |
lxc.net.0.type = veth |
| 23 |
lxc.net.0.hwaddr = 10:66:6a:xx:xx:xx |
| 24 |
EOF |
| 25 |
lxc-create -t busybox -f $f -n lxctestc |
| 26 |
grep -q "xx:xx" /var/lib/lxc/lxctestc/config && { echo "hwaddr not expanded"; exit 1; } |
| 27 |
echo "Success" |