test: import no-op test into the runtime-tests

Add a new trivial runtime-test which simply runs a no-op pipeline. This
is a fast, trivial test that simply verifies osbuild is properly setup
and accessible.

Remove the explicit no-op test from the CI, now that the test-suite has
it as well.
This commit is contained in:
David Rheinsberg 2020-05-20 16:28:52 +02:00
parent 162797f206
commit a3d1e3ff50
2 changed files with 30 additions and 23 deletions

View file

@ -33,29 +33,6 @@ jobs:
with:
run: python3 -m unittest -v test.test_boot
noop_pipeline_tests:
name: "Noop-Pipeline Tests"
runs-on: ubuntu-latest
steps:
- name: "Clone Repository"
uses: actions/checkout@v2
- name: "Install Dependencies"
run: |
sudo apt-get update
sudo apt-get -y install \
systemd-container
- name: "Set up Python"
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python Packages
run: pip install jsonschema
- name: "Run Noop-Pipeline Tests"
run: |
for i in {0..2} ; do
sudo env "PATH=$PATH" python3 -m osbuild --libdir . samples/noop.json
done
assembler_tests:
name: "Assembler Tests"
runs-on: ubuntu-latest

30
test/run/test_noop.py Normal file
View file

@ -0,0 +1,30 @@
#
# Runtime Tests for No-op Pipelines
#
import unittest
from .. import test
class TestNoop(unittest.TestCase):
def setUp(self):
self.osbuild = test.OSBuild(self)
def test_noop(self):
#
# Run a noop Pipeline. Run twice to verify the cache does not affect
# the operation (we do not have checkpoints, nor any stages that could
# be checkpointed).
#
# Then run the entire thing again, to verify our own `osbuild` executor
# tears things down properly and allows to be executed multiple times.
#
with self.osbuild as osb:
osb.compile("{}")
osb.compile("{}")
with self.osbuild as osb:
osb.compile("{}")
osb.compile("{}")