Commit 51bf5c0f authored by Robert Schmidt's avatar Robert Schmidt

Introduce CI deployment tests based on OAI images

parent 5201a5c3
......@@ -10,7 +10,10 @@ start with
python tests/ping-iperf.py -v
python tests/iperf-analysis.py -v
It will indicate if all tests passed.
It will indicate if all tests passed. It assumes that these images are present:
- `oai-ci/oai-nr-ue:develop-12345678`
- `oai-ci/oai-gnb:develop-12345678`
# test-runner test
......
......@@ -23,10 +23,10 @@ class TestDeploymentMethods(unittest.TestCase):
self.ci = cls_oaicitest.OaiCiTest()
self.cont = cls_containerize.Containerize()
self.ran = ran.RANManagement()
self.cont.yamlPath[0] = 'tests/simple-dep/'
self.cont.yamlPath[0] = ''
self.cont.ranAllowMerge = True
self.cont.ranBranch = 'develop'
self.cont.ranCommitID = '1234567890'
self.cont.ranBranch = ''
self.cont.ranCommitID = ''
self.cont.eNB_serverId[0] = '0'
self.cont.eNBIPAddress = 'localhost'
self.cont.eNBUserName = None
......@@ -34,17 +34,51 @@ class TestDeploymentMethods(unittest.TestCase):
self.cont.eNBSourceCodePath = os.getcwd()
def test_deploy(self):
success = self.cont.DeployObject(self.html)
self.assertTrue(success)
self.cont.UndeployObject(self.html, self.ran)
self.cont.yamlPath[0] = 'tests/simple-dep/'
self.cont.deploymentTag = "noble"
deploy = self.cont.DeployObject(self.html)
undeploy = self.cont.UndeployObject(self.html, self.ran)
self.assertTrue(deploy)
self.assertTrue(undeploy)
def test_deployfails(self):
# fails reliably
old = self.cont.yamlPath
self.cont.yamlPath[0] = 'tests/simple-fail/'
success = self.cont.DeployObject(self.html)
self.assertFalse(success)
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"
self.cont.deploymentTag = 'develop-12345678'
deploy = self.cont.DeployObject(self.html)
undeploy = self.cont.UndeployObject(self.html, self.ran)
self.assertTrue(deploy)
self.assertTrue(undeploy)
def test_deploy_multiran(self):
self.cont.yamlPath[0] = 'yaml_files/5g_rfsimulator_tdd_dora'
self.cont.services[0] = "oai-gnb oai-nr-ue"
self.cont.deploymentTag = 'develop-12345678'
deploy = self.cont.DeployObject(self.html)
undeploy = self.cont.UndeployObject(self.html, self.ran)
self.assertTrue(deploy)
self.assertTrue(undeploy)
def test_deploy_staged(self):
self.cont.yamlPath[0] = 'yaml_files/5g_rfsimulator_tdd_dora'
self.cont.services[0] = "oai-gnb"
self.cont.deploymentTag = 'develop-12345678'
deploy1 = self.cont.DeployObject(self.html)
self.cont.services[0] = "oai-nr-ue"
deploy2 = self.cont.DeployObject(self.html)
undeploy = self.cont.UndeployObject(self.html, self.ran)
self.assertTrue(deploy1)
self.assertTrue(deploy2)
self.assertTrue(undeploy)
if __name__ == '__main__':
unittest.main()
services:
test:
image: ubuntu:jammy
image: ubuntu:${TAG:-jammy}
container_name: test_container
cap_drop:
- ALL
......
services:
oai-gnb:
image: oaisoftwarealliance/oai-gnb:develop
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}
container_name: rfsim5g-oai-gnb
cap_drop:
- ALL
......@@ -25,7 +25,7 @@ services:
retries: 5
oai-nr-ue:
image: oaisoftwarealliance/oai-nr-ue:develop
image: ${REGISTRY:-oaisoftwarealliance}/${NRUE_IMG:-oai-nr-ue}:${TAG:-develop}
container_name: rfsim5g-oai-nr-ue
cap_drop:
- ALL
......
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