diff --git a/ci-scripts/tests/README.md b/ci-scripts/tests/README.md index f4e31074ca..dc8f9ea80a 100644 --- a/ci-scripts/tests/README.md +++ b/ci-scripts/tests/README.md @@ -11,11 +11,15 @@ start with python tests/iperf-analysis.py -v python tests/ping-iperf.py -v -It will indicate if all tests passed. It assumes that these images are present: +It will indicate if all tests passed. `tests/deployment.py` requires these +images to be present: - `oai-ci/oai-nr-ue:develop-12345678` - `oai-ci/oai-gnb:develop-12345678` +It will try to download `oaisoftwarealliance/oai-{gnb,nr-ue}:develop` +automatically and retag the images. + # test-runner test This is not a true test, because the results need to be manually inspected. To diff --git a/ci-scripts/tests/deployment.py b/ci-scripts/tests/deployment.py index a6cf8e06b0..47e459d6a4 100644 --- a/ci-scripts/tests/deployment.py +++ b/ci-scripts/tests/deployment.py @@ -15,9 +15,24 @@ import cls_oai_html import cls_oaicitest import cls_containerize import ran +import cls_cmd class TestDeploymentMethods(unittest.TestCase): + def _pull_image(self, cmd, image): + ret = cmd.run(f"docker inspect oai-ci/{image}:develop-12345678") + if ret.returncode == 0: # exists + return + ret = cmd.run(f"docker pull oaisoftwarealliance/{image}:develop") + self.assertEqual(ret.returncode, 0) + ret = cmd.run(f"docker tag oaisoftwarealliance/{image}:develop oai-ci/{image}:develop-12345678") + self.assertEqual(ret.returncode, 0) + ret = cmd.run(f"docker rmi oaisoftwarealliance/{image}:develop") + self.assertEqual(ret.returncode, 0) + def setUp(self): + with cls_cmd.getConnection("localhost") as cmd: + self._pull_image(cmd, "oai-gnb") + self._pull_image(cmd, "oai-nr-ue") self.html = cls_oai_html.HTMLManagement() self.html.testCaseId = "000000" self.ci = cls_oaicitest.OaiCiTest()