Commit 5078fccc authored by Robert Schmidt's avatar Robert Schmidt

CI test deployment.py: auto-pull missing images if necessary

parent a3a59e4a
......@@ -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
......
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment