CI test deployment.py: auto-pull missing images if necessary
This commit is contained in:
@@ -11,11 +11,15 @@ start with
|
|||||||
python tests/iperf-analysis.py -v
|
python tests/iperf-analysis.py -v
|
||||||
python tests/ping-iperf.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-nr-ue:develop-12345678`
|
||||||
- `oai-ci/oai-gnb: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
|
# test-runner test
|
||||||
|
|
||||||
This is not a true test, because the results need to be manually inspected. To
|
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_oaicitest
|
||||||
import cls_containerize
|
import cls_containerize
|
||||||
import ran
|
import ran
|
||||||
|
import cls_cmd
|
||||||
|
|
||||||
class TestDeploymentMethods(unittest.TestCase):
|
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):
|
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 = cls_oai_html.HTMLManagement()
|
||||||
self.html.testCaseId = "000000"
|
self.html.testCaseId = "000000"
|
||||||
self.ci = cls_oaicitest.OaiCiTest()
|
self.ci = cls_oaicitest.OaiCiTest()
|
||||||
|
|||||||
Reference in New Issue
Block a user