Skip to content
Snippets Groups Projects
Commit 88b9ef65 authored by Luis Araujo's avatar Luis Araujo
Browse files

Add remaining test cases for tiny containers


- Add the remaining test cases for tiny containers.
- Add a new image type: tiny-lxc
- Add new execution type: all

Signed-off-by: default avatarLuis Araujo <luis.araujo@collabora.co.uk>
parent 6c388475
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ metadata: ...@@ -4,7 +4,7 @@ metadata:
format: "Apertis Test Definition 1.0" format: "Apertis Test Definition 1.0"
# [ target, minimal, ostree, development, SDK, any ]. # [ any, development, minimal, SDK, target, tiny-lxc ].
image-type: image-type:
# [ amd64, arm64, armhf, any ] # [ amd64, arm64, armhf, any ]
...@@ -13,7 +13,7 @@ metadata: ...@@ -13,7 +13,7 @@ metadata:
# [ functional, sanity, system ] # [ functional, sanity, system ]
type: type:
# [ manual , automated ] # [ all, automated, manual ]
exec-type: exec-type:
# [ low, medium, high, critical ] # [ low, medium, high, critical ]
......
...@@ -7,33 +7,37 @@ ...@@ -7,33 +7,37 @@
import sys import sys
import yaml import yaml
image_types = [ "any", "development", "minimal", "SDK", "target", "tiny-lxc" ]
image_arch = ['any', 'amd64', 'arm64', 'armhf']
tests_types = ['compatibility', 'functional', 'performance', 'sanity', 'system']
priorities = ['critical', 'high', 'low', 'medium']
execution_type = ['all', 'automated', 'manual']
# This structure defines the test case YAML file format. # This structure defines the test case YAML file format.
test_case_format = { test_case_format = {
'metadata' : (True, { 'metadata': (True, {
'name' : (True, ""), 'name': (True, ""),
'format' : (False, ""), 'format': (False, ""),
'image-type' : (True, [ 'target', 'minimal', 'ostree', 'image-type': (True, image_types),
'development', 'SDK', 'any' ]), 'image-arch': (True, image_arch),
'image-arch' : (True, ['amd64', 'arm64', 'armhf', 'any']), 'type': (True, tests_types),
'type' : (True, ['compatibility', 'functional', 'performance', 'exec-type': (True, execution_type),
'sanity', 'system']), 'priority': (True, priorities),
'exec-type' : (True, ['manual' , 'automated']), 'maintainer': (False, ""),
'priority' : (True, ['low', 'medium', 'high', 'critical']), 'description': (True, ""),
'maintainer' : (False, ""), 'resources': (False, []),
'description' : (True, ""), 'pre-conditions': (False, []),
'resources' : (False, []), 'expected': (True, []),
'pre-conditions' : (False, []), 'notes': (False, []),
'expected' : (True, []), 'post-conditions': (False, [])
'notes' : (False, []),
'post-conditions' : (False, [])
}), }),
'install' : (False, { 'install': (False, {
'deps' : (True, []) 'deps': (True, [])
}), }),
'run' : (True, { 'run': (True, {
'steps' : (True, []) 'steps': (True, [])
}), }),
'parse' : (False, {}) 'parse': (False, {})
} }
def _parse_format(test_case, test_case_format): def _parse_format(test_case, test_case_format):
......
metadata:
name: check-tiny-system-containers
format: "Apertis Test Definition 1.0"
image-type: tiny-lxc
image-arch: any
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:
deps:
- libpam-cgfs
- lxc
- lxc-templates
- uidmap
run:
steps:
- "# Execute the following commands:"
- sed s/__NAMESPACE_PLACEHOLDER__/lxc-apertis-tiny-system/g lxc/lxc-tiny-connectivity-profile-template | apparmor_parser -qr
- 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))"
metadata:
name: check-tiny-user-containers
format: "Apertis Test Definition 1.0"
image-type: tiny-lxc
image-arch: any
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:
deps:
- libpam-cgfs
- lxc
- lxc-templates
- uidmap
run:
steps:
- "# Execute the following commands:"
- sysctl -w kernel.unprivileged_userns_clone=1
- sed s/__NAMESPACE_PLACEHOLDER__/lxc-apertis-tiny-userns/g lxc/lxc-tiny-connectivity-profile-template | apparmor_parser -qr
- 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))"
...@@ -4,7 +4,7 @@ metadata: ...@@ -4,7 +4,7 @@ metadata:
image-type: any image-type: any
image-arch: any image-arch: any
type: sanity type: sanity
exec-type: automated exec-type: all
priority: critical priority: critical
maintainer: "Apertis Project" maintainer: "Apertis Project"
description: "This test checks that the system bus is up, that a user session is description: "This test checks that the system bus is up, that a user session is
......
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