mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-16 07:02:02 +00:00
tests: Tweak lxc-test-ubuntu to be faster
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
0e17b9c69b
commit
8ced4fd4f7
@ -23,7 +23,6 @@
|
|||||||
# License along with this library; if not, write to the Free Software
|
# License along with this library; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
FAIL() {
|
FAIL() {
|
||||||
@ -54,11 +53,13 @@ for template in ubuntu ubuntu-cloud; do
|
|||||||
else
|
else
|
||||||
name=lxc-test-$template
|
name=lxc-test-$template
|
||||||
fi
|
fi
|
||||||
|
|
||||||
lxc-create -t $template -n $name || FAIL "creating $template container"
|
lxc-create -t $template -n $name || FAIL "creating $template container"
|
||||||
lxc-start -n $name -d || FAIL "starting $template container"
|
lxc-start -n $name -d || FAIL "starting $template container"
|
||||||
lxc-wait -n $name -s RUNNING || FAIL "waiting for $template container to run"
|
lxc-wait -n $name -s RUNNING || FAIL "waiting for $template container to run"
|
||||||
|
|
||||||
for tries in `seq 1 20`; do
|
for tries in `seq 1 20`; do
|
||||||
lxcip=`sudo lxc-info -i -n $name | awk -F: '{ print $2 }' | awk '{ print $1}' | head -1`
|
lxcip=$(lxc-info -i -n $name -H | head -1)
|
||||||
[ -z "$lxcip" ] || break
|
[ -z "$lxcip" ] || break
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
@ -66,12 +67,12 @@ for template in ubuntu ubuntu-cloud; do
|
|||||||
|
|
||||||
ping -c 1 $lxcip || FAIL "to ping $template container"
|
ping -c 1 $lxcip || FAIL "to ping $template container"
|
||||||
# Check apparmor
|
# Check apparmor
|
||||||
lxcpid=`lxc-info -n $name -p | awk -F: '{ print $2 }' | awk '{ print $1}'`
|
lxcpid=`lxc-info -n $name -p -H`
|
||||||
aa=`cat /proc/$lxcpid/attr/current`
|
aa=`cat /proc/$lxcpid/attr/current`
|
||||||
if [ "$aa" != "lxc-container-default-with-nesting (enforce)" -a "$aa" != "lxc-container-default (enforce)" ]; then
|
if [ "$aa" != "lxc-container-default-with-nesting (enforce)" -a "$aa" != "lxc-container-default (enforce)" ]; then
|
||||||
FAIL " to correctly set apparmor profile (profile is \"$aa\")"
|
FAIL " to correctly set apparmor profile (profile is \"$aa\")"
|
||||||
fi
|
fi
|
||||||
lxc-stop -n $name
|
lxc-stop -n $name -k
|
||||||
lxc-destroy -n $name
|
lxc-destroy -n $name
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user