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