Skip to content

Commit

Permalink
Merge pull request #1482 from stgraber/master
Browse files Browse the repository at this point in the history
tests: Support running on IPv6 networks
  • Loading branch information
Christian Brauner committed Mar 21, 2017
2 parents f5c3ae5 + 09ef083 commit 7906118
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/tests/lxc-test-apparmor-mount
Expand Up @@ -167,7 +167,7 @@ if [ "x$profile" != "x${default_profile}" ]; then
echo "FAIL: confined container was in profile $profile"
exit 1
fi
run_cmd lxc-stop -n $cname
run_cmd lxc-stop -n $cname -k

echo "test regular unconfined container"
echo "lxc.aa_profile = unconfined" >> $HDIR/.local/share/lxc/$cname/config
Expand All @@ -179,7 +179,7 @@ if [ "x$profile" != "xunconfined" ]; then
echo "FAIL: unconfined container was in profile $profile"
exit 1
fi
run_cmd lxc-stop -n $cname
run_cmd lxc-stop -n $cname -k

echo "masking $MOUNTSR"
mount --bind $dnam $MOUNTSR
Expand Down Expand Up @@ -209,7 +209,7 @@ if [ "x$profile" != "xunconfined" ]; then
echo "FAIL: confined container was in profile $profile"
exit 1
fi
run_cmd lxc-stop -n $cname
run_cmd lxc-stop -n $cname -k

echo "testing override"
sed -i '/aa_profile/d' $HDIR/.local/share/lxc/$cname/config
Expand All @@ -226,6 +226,6 @@ if [ "x$profile" != "x${default_profile}" ]; then
echo "FAIL: confined container was in profile $profile"
exit 1
fi
run_cmd lxc-stop -n $cname
run_cmd lxc-stop -n $cname -k

DONE=1
2 changes: 1 addition & 1 deletion src/tests/lxc-test-checkpoint-restore
Expand Up @@ -48,5 +48,5 @@ lxc-checkpoint -n $name -v -s -D /tmp/checkpoint || FAIL "failed checkpointing"
lxc-wait -n $name -s STOPPED
lxc-checkpoint -n $name -v -r -D /tmp/checkpoint || FAIL "failed restoring"

lxc-stop -n $name -t 1
lxc-stop -n $name -k
lxc-destroy -f -n $name
7 changes: 6 additions & 1 deletion src/tests/lxc-test-ubuntu
Expand Up @@ -61,7 +61,12 @@ for template in ubuntu ubuntu-cloud; do
done
[ -n "$lxcip" ] || FAIL "to start networking in $template container"

ping -c 1 $lxcip || FAIL "to ping $template container"
if echo "${lxcip}" | grep -q ":"; then
ping6 -c 1 $lxcip || FAIL "to ping $template container"
else
ping -c 1 $lxcip || FAIL "to ping $template container"
fi

# Check apparmor
lxcpid=`lxc-info -n $name -p -H`
aa=`cat /proc/$lxcpid/attr/current`
Expand Down
4 changes: 2 additions & 2 deletions src/tests/lxc-test-unpriv
Expand Up @@ -185,15 +185,15 @@ for count in `seq 1 2`; do
run_cmd lxc-info -n c1
run_cmd lxc-attach -n c1 -- /bin/true

run_cmd lxc-stop -n c1
run_cmd lxc-stop -n c1 -k
done

run_cmd lxc-copy -s -n c1 -N c2
run_cmd lxc-start -n c2 -d
p1=$(run_cmd lxc-info -n c2 -p -H)
[ "$p1" != "-1" ] || { echo "Failed to start container c2"; false; }

run_cmd lxc-stop -n c2
run_cmd lxc-stop -n c2 -k

if which cgm >/dev/null 2>&1; then
echo "Testing containers under different cgroups per subsystem"
Expand Down

0 comments on commit 7906118

Please sign in to comment.