action #88343
closedcoordination #87853: [epic][brainstorming]
Create container testing framework
0%
Description
Background:
Openqa has no nature interface or framework to test containers. In additional you cant easily run test fast locally.
Idea:
Create test runner which will accept some parameters as input and it will execute tests inside the containers
Requirements:
- Easy to use and run in a local workstation
- easy integrated with OpenQA
- test results as subunit
Files
Updated by ybonatakis about 4 years ago
So far the implementation is a PoC.
it just launches a tw image and run a few dump tests inside the container to check that the framework works and that the image is running.
TODO:
- results+reporting
- PoC on OpenQA
- Add bash tests
- Experiment with clusters/k8s
- Improve configuration/automation
- Documentation
Updated by ybonatakis about 4 years ago
http://aquarius.suse.cz/tests/4932#step/container_test_runner/62 as a PoC
Far from ready as it is missing configuration aspects and results gathering.
The test running are two dummy tests and one which actual run a container and execute a smoke test inside the container.
This is how it looks when the test starts the container. We need only define the image
12:30:49.656 __init__.py INFO docker environment info: 'Client:\n Version: 19.03.15\n API version: 1.40\n Go version: go1.13.15\n Git commit: 99e3ed89195c\n Built: Sat Feb 6 12:00:00 2021\n OS/Arch: linux/amd64\n Experimental: false\n\nServer:\n Engine:\n Version: 19.03.15\n API version: 1.40 (minimum version 1.12)\n Go version: go1.13.15\n Git commit: 99e3ed89195c\n Built: Sat Feb 6 12:00:00 2021\n OS/Arch: linux/amd64\n Experimental: false\n containerd:\n Version: v1.3.9\n GitCommit: ea765aba0d05254012b0b9e595e995c09186427f\n runc:\n Version: 1.0.0-rc10\n GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd\n docker-init:\n Version: 0.1.5_catatonit\n GitCommit: \n'
12:30:49.670 image.py DEBUG pull policy set to 'if_not_present' and image is not present, pulling the image
12:30:49.921 image.py DEBUG {'status': 'Pulling from opensuse/tumbleweed', 'id': 'latest'}
12:30:49.922 image.py INFO Pulling from opensuse/tumbleweed
12:30:50.036 image.py DEBUG {'status': 'Pulling fs layer', 'progressDetail': {}, 'id': '30e0d152249f'}
................................
2021-02-18 12:30:57 DEBUG {'status': 'Digest: sha256:b70bb542ed8b5ebbfd7bc0d7d37b45e696a81c810d10221fc99354336be5c32e'}
2021-02-18 12:30:57 INFO Digest: sha256:b70bb542ed8b5ebbfd7bc0d7d37b45e696a81c810d10221fc99354336be5c32e
2021-02-18 12:30:57 DEBUG {'status': 'Status: Downloaded newer image for registry.opensuse.org/opensuse/tumbleweed:latest'}
2021-02-18 12:30:57 INFO Status: Downloaded newer image for registry.opensuse.org/opensuse/tumbleweed:latest
2021-02-18 12:30:57 INFO run container via binary in background
2021-02-18 12:30:57 DEBUG docker command: ['docker', 'run', '--net=host', '--pid=host', '--ipc=host', '-it', '--privileged', '-w=/opt', '-d', '-v', '/home/iob/Documents/Code/madtes:/opt', '--cidfile=/tmp/conu-4op6ei7p/conu-bklqspoelkcugfuqvhnmzhufgenasokl', '-l', 'conu.test_artifact', 'sha256:a2f63c6db7e132d1d5d29b080d58b2b072e9c718f462f8197a2c8b68ec85435d']
2021-02-18 12:30:57 DEBUG command: "docker run --net=host --pid=host --ipc=host -it --privileged -w=/opt -d -v /home/iob/Documents/Code/madtes:/opt --cidfile=/tmp/conu-4op6ei7p/conu-bklqspoelkcugfuqvhnmzhufgenasokl -l conu.test_artifact sha256:a2f63c6db7e132d1d5d29b080d58b2b072e9c718f462f8197a2c8b68ec85435d"
2021-02-18 12:30:59 DEBUG a99f8ea84aecdfb4b9b71272b5be27d85bbcc1a99c0ed212f9eb15ed71dc1d68
2021-02-18 12:30:59 DEBUG starting probe
2021-02-18 12:30:59 DEBUG first process started: pid=2738
2021-02-18 12:30:59 DEBUG pausing for 0.1 before next try
2021-02-18 12:30:59 DEBUG waiting for process to end...
2021-02-18 12:30:59 DEBUG result = True
Updated by ybonatakis about 4 years ago
Updated by ybonatakis almost 4 years ago
job with external results as we are doing for publiccloud
http://aquarius.suse.cz/tests/5030#
Updated by jlausuch almost 4 years ago
- Priority changed from Normal to Low
- Parent task set to #87853
Updated by jlausuch over 3 years ago
- Status changed from In Progress to Feedback
Updated by ybonatakis over 3 years ago
- File test_runner_imager.png test_runner_imager.png added
https://gitlab.com/b10n1k/imager/-/blob/master/README.md
I am going to leave this in feedback and hopefully get some comments/interest. But i am not sure if it worth to continue if there is none.
- if you want to test it locally clone it and follow readme
- if you want to test it with openqa run
openqa-clone-job --skip-chained-deps --from openqa.suse.de 7039358 YAML_SCHEDULE=schedule/containers/test_runner.yaml TEST=test_runner _SKIP_POST_FAIL_HOOKS=1 _QUIET_SCRIPT_CALLS=
Make sure that docker service is running in both of the cases
Updated by ybonatakis over 3 years ago
i created a draft PR for demonstration. this is what i used for the openqa job https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/13365.
Updated by ybonatakis over 2 years ago
- Status changed from Feedback to Rejected
I am closing this as it didnt get any attention and there is not plan for it