From e1d06cfef8d49ab3ad75abb90d415e1febd193ae Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Sun, 1 Dec 2024 22:50:38 +0100 Subject: [PATCH] CI: add CI unit test for simple fail deployment with 2 services --- ci-scripts/tests/deployment.py | 9 ++++++++ .../tests/simple-fail-2svc/docker-compose.yml | 23 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 ci-scripts/tests/simple-fail-2svc/docker-compose.yml diff --git a/ci-scripts/tests/deployment.py b/ci-scripts/tests/deployment.py index 47e459d6a4..45bffe9a0a 100644 --- a/ci-scripts/tests/deployment.py +++ b/ci-scripts/tests/deployment.py @@ -65,6 +65,15 @@ class TestDeploymentMethods(unittest.TestCase): self.assertFalse(deploy) self.cont.yamlPath = old + def test_deployfails_2svc(self): + # fails reliably + old = self.cont.yamlPath + self.cont.yamlPath[0] = 'tests/simple-fail-2svc/' + deploy = self.cont.DeployObject(self.html) + self.cont.UndeployObject(self.html, self.ran) + self.assertFalse(deploy) + self.cont.yamlPath = old + def test_deploy_ran(self): self.cont.yamlPath[0] = 'yaml_files/5g_rfsimulator_tdd_dora' self.cont.services[0] = "oai-gnb" diff --git a/ci-scripts/tests/simple-fail-2svc/docker-compose.yml b/ci-scripts/tests/simple-fail-2svc/docker-compose.yml new file mode 100644 index 0000000000..8b30c4aa08 --- /dev/null +++ b/ci-scripts/tests/simple-fail-2svc/docker-compose.yml @@ -0,0 +1,23 @@ +services: + test1: + image: ubuntu:jammy + container_name: test_container1 + cap_drop: + - ALL + entrypoint: /bin/bash -c "false" + healthcheck: + test: /bin/bash -c "true" + interval: 1s + timeout: 1s + retries: 1 + test2: + image: ubuntu:jammy + container_name: test_container2 + cap_drop: + - ALL + entrypoint: /bin/bash -c "sleep infinity" + healthcheck: + test: /bin/bash -c "true" + interval: 1s + timeout: 1s + retries: 1