diff --git a/test-cases/tiny-container-system-basic.yaml b/test-cases/tiny-container-system-basic.yaml new file mode 100644 index 0000000000000000000000000000000000000000..133808713fc57c7974cedb5fc7d8460907f52c83 --- /dev/null +++ b/test-cases/tiny-container-system-basic.yaml @@ -0,0 +1,33 @@ +metadata: + name: tiny-container-system-basic + format: "Apertis Test Definition 1.0" + image-types: + tiny-lxc: [ armhf-internal, arm64, amd64 ] + image-deployment: + - APT + type: functional + exec-type: automated + priority: medium + maintainer: "Apertis Project" + description: "Test of Tiny system-wide privileged container using shared + networking with the host" + + expected: + - "Test command should report \"pass\"." + +install: + git-repos: + - url: https://gitlab.apertis.org/infrastructure/tiny-image-recipes.git + branch: master + +run: + steps: + - "# Enter test directory:" + - cd tiny-image-recipes + - "# 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 functionality of container:" + - lavatests/check-tiny-containers -a "$ARCH" -r "$RELEASE" -d "$IMAGE_DATE" -t lxc/lxc-tiny-connectivity --aa-namespace "lxc-apertis-tiny-system" + +parse: + pattern: "(?P<test_case_id>.*-*):\\s+(?P<result>(pass|fail))" diff --git a/test-cases/check-tiny-system-container.yaml b/test-cases/tiny-container-system-device-sharing.yaml similarity index 68% rename from test-cases/check-tiny-system-container.yaml rename to test-cases/tiny-container-system-device-sharing.yaml index 756c445a1d0d6f36b05cbb1a7cf6e11356bdabaa..16b55dbe9d93735e3576ef22ce4da5accdcc7436 100644 --- a/test-cases/check-tiny-system-container.yaml +++ b/test-cases/tiny-container-system-device-sharing.yaml @@ -1,5 +1,5 @@ metadata: - name: check-tiny-system-container + name: tiny-container-system-device-sharing format: "Apertis Test Definition 1.0" image-types: tiny-lxc: [ armhf-internal, arm64, amd64 ] @@ -9,8 +9,8 @@ metadata: exec-type: automated priority: medium maintainer: "Apertis Project" - description: "Test of Tiny system-wide privileged container using shared - networking with the host" + description: "Test of device sharing between host and Tiny system-wide + privileged container" expected: - "Test command should report \"pass\"." @@ -26,10 +26,6 @@ run: - cd tiny-image-recipes - "# 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:" diff --git a/test-cases/tiny-container-system-folder-sharing.yaml b/test-cases/tiny-container-system-folder-sharing.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6e51986ae09b38e28adee8ce90ba270a0006e445 --- /dev/null +++ b/test-cases/tiny-container-system-folder-sharing.yaml @@ -0,0 +1,33 @@ +metadata: + name: tiny-container-system-folder-sharing + format: "Apertis Test Definition 1.0" + image-types: + tiny-lxc: [ armhf-internal, arm64, amd64 ] + image-deployment: + - APT + type: functional + exec-type: automated + priority: medium + maintainer: "Apertis Project" + description: "Test of folder sharing between host and Tiny system-wide + privileged container started as user" + + expected: + - "Test command should report \"pass\"." + +install: + git-repos: + - url: https://gitlab.apertis.org/infrastructure/tiny-image-recipes.git + branch: master + +run: + steps: + - "# Enter test directory:" + - cd tiny-image-recipes + - "# 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 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" + +parse: + pattern: "(?P<test_case_id>.*-*):\\s+(?P<result>(pass|fail))" diff --git a/test-cases/tiny-container-user-basic.yaml b/test-cases/tiny-container-user-basic.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c55588148eee2126ac3a69103591ee07ff946775 --- /dev/null +++ b/test-cases/tiny-container-user-basic.yaml @@ -0,0 +1,35 @@ +metadata: + name: tiny-container-user-basic + format: "Apertis Test Definition 1.0" + image-types: + tiny-lxc: [ armhf-internal, arm64, amd64 ] + image-deployment: + - APT + type: functional + exec-type: automated + priority: medium + maintainer: "Apertis Project" + description: "Test of Tiny unprivileged container without any networking + started as user" + + expected: + - "Test command should report \"pass\"." + +install: + git-repos: + - url: https://gitlab.apertis.org/infrastructure/tiny-image-recipes.git + branch: master + +run: + steps: + - "# Enter test directory:" + - cd tiny-image-recipes + - "# 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 functionality 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" + +parse: + pattern: "(?P<test_case_id>.*-*):\\s+(?P<result>(pass|fail))" diff --git a/test-cases/check-tiny-user-container.yaml b/test-cases/tiny-container-user-device-sharing.yaml similarity index 70% rename from test-cases/check-tiny-user-container.yaml rename to test-cases/tiny-container-user-device-sharing.yaml index 009f43b5810221ccab37573124882050463bc80c..27dcd54b9ae03b0370730f4db550b25d0fc6b41b 100644 --- a/test-cases/check-tiny-user-container.yaml +++ b/test-cases/tiny-container-user-device-sharing.yaml @@ -1,5 +1,5 @@ metadata: - name: check-tiny-user-container + name: tiny-container-user-device-sharing format: "Apertis Test Definition 1.0" image-types: tiny-lxc: [ armhf-internal, arm64, amd64 ] @@ -9,8 +9,8 @@ metadata: exec-type: automated priority: medium maintainer: "Apertis Project" - description: "Test of Tiny unprivileged container without any networking - started as user" + description: "Test of device sharing between host and Tiny unprivileged + container started as user" expected: - "Test command should report \"pass\"." @@ -28,10 +28,6 @@ run: - 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:" diff --git a/test-cases/tiny-container-user-folder-sharing.yaml b/test-cases/tiny-container-user-folder-sharing.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f67ff7cd2e198ec63a0f3ff0fa17c1a97564eae2 --- /dev/null +++ b/test-cases/tiny-container-user-folder-sharing.yaml @@ -0,0 +1,35 @@ +metadata: + name: tiny-container-user-folder-sharing + format: "Apertis Test Definition 1.0" + image-types: + tiny-lxc: [ armhf-internal, arm64, amd64 ] + image-deployment: + - APT + type: functional + exec-type: automated + priority: medium + maintainer: "Apertis Project" + description: "Test of folder sharing between host and Tiny unprivileged + container started as user" + + expected: + - "Test command should report \"pass\"." + +install: + git-repos: + - url: https://gitlab.apertis.org/infrastructure/tiny-image-recipes.git + branch: master + +run: + steps: + - "# Enter test directory:" + - cd tiny-image-recipes + - "# 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 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" + +parse: + pattern: "(?P<test_case_id>.*-*):\\s+(?P<result>(pass|fail))"