Skip to content
Snippets Groups Projects
Commit bb704fee authored by Denis Pynkin's avatar Denis Pynkin Committed by Denis Pynkin
Browse files

Add mapping tests for tiny containers


Add following tests:
- folder mapping
- device mapping

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
parent f65d7528
No related branches found
No related tags found
No related merge requests found
......@@ -29,9 +29,21 @@ run:
steps:
- "# Enter test directory:"
- cd tiny-image-recipes
- "# Execute the following commands:"
- "# Setup the AppArmor profile for container:"
- sed s/__NAMESPACE_PLACEHOLDER__/lxc-apertis-tiny-system/g lxc/lxc-tiny-connectivity-profile-template | apparmor_parser -qr
- "# Check the basic fnctionality of container:"
- lavatests/check-tiny-containers -a "$ARCH" -r "$RELEASE" -d "$IMAGE_DATE" -t lxc/lxc-tiny-connectivity --aa-namespace "lxc-apertis-tiny-system"
- "# Check that files created in a configured shared folder on the host can be read in the container and vice-versa:"
- lavatests/test-folder-sharing -a "$ARCH" -r "$RELEASE" -d "$IMAGE_DATE" -t lxc/lxc-tiny-connectivity --aa-namespace "lxc-apertis-tiny-system"
- "# Ensure we have loop device:"
- modprobe loop
- "# Create the random file and map it to loop0 device on host:"
- dd if=/dev/urandom of=/var/test.img bs=1M count=1
- losetup /dev/loop0 /var/test.img
- "# Check that a simple loop device created on the host can be shared with the container and accessed from inside it:"
- lavatests/test-device-sharing -a "$ARCH" -r "$RELEASE" -d "$IMAGE_DATE" -t lxc/lxc-tiny-connectivity --aa-namespace "lxc-apertis-tiny-system"
- "# Release the loop0 device on host after the test:"
- losetup -d /dev/loop0
parse:
pattern: "(?P<test_case_id>.*-*):\\s+(?P<result>(pass|fail))"
......@@ -29,10 +29,25 @@ run:
steps:
- "# Enter test directory:"
- cd tiny-image-recipes
- "# Execute the following commands:"
- "# Ensure we allow user mapping:"
- sysctl -w kernel.unprivileged_userns_clone=1
- "# Setup the AppArmor profile for container:"
- sed s/__NAMESPACE_PLACEHOLDER__/lxc-apertis-tiny-userns/g lxc/lxc-tiny-connectivity-profile-template | apparmor_parser -qr
- "# Check the basic fnctionality of container:"
- sudo -u user -H lavatests/check-tiny-containers -a "$ARCH" -r "$RELEASE" -d "$IMAGE_DATE" -t lxc/lxc-tiny-connectivity --aa-namespace "lxc-apertis-tiny-userns"
- "# Check that files created in a configured shared folder on the host can be read in the container and vice-versa:"
- sudo -u user -H lavatests/test-folder-sharing -a "$ARCH" -r "$RELEASE" -d "$IMAGE_DATE" -t lxc/lxc-tiny-connectivity --aa-namespace "lxc-apertis-tiny-userns"
- "# Ensure we have loop device:"
- modprobe loop
- "# Create the random file and map it to loop0 device on host:"
- dd if=/dev/urandom of=/var/test.img bs=1M count=1
- losetup /dev/loop0 /var/test.img
- "# Allow user to access the device on host:"
- chmod 666 /dev/loop0
- "# Check that a simple loop device created on the host can be shared with the container and accessed from inside it:"
- sudo -u user -H lavatests/test-device-sharing -a "$ARCH" -r "$RELEASE" -d "$IMAGE_DATE" -t lxc/lxc-tiny-connectivity --aa-namespace "lxc-apertis-tiny-userns"
- "# Release the loop0 device on host after the test:"
- losetup -d /dev/loop0
parse:
pattern: "(?P<test_case_id>.*-*):\\s+(?P<result>(pass|fail))"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment