- all RAN code, CI code, configuration files, dockerfiles, in CSSL v1.0
- all deployment code (openshift, charts, ancillary files like shell
scripts), in MIT
- documentation in CC-BY-4.0
- exceptions might apply and are listed in NOTICE
- there is a new LICENSES folder with all licenses
- CONTRIBUTIONS.md has been updated accordingly
For automated changes based on OAI PL v1.1:
perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.{c,h,cpp}
perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.ts
perl -i~ -0pe 's/<!--.*Licensed to the OpenAirInterface.*openairinterface.org\n.*-->/<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->/s' **/*.xml
The rest (cmake, files with missing license, cmake) manually.
55 lines
1.8 KiB
Python
55 lines
1.8 KiB
Python
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
|
|
|
import sys
|
|
import logging
|
|
logging.basicConfig(
|
|
level=logging.DEBUG,
|
|
stream=sys.stdout,
|
|
format="[%(asctime)s] %(levelname)8s: %(message)s"
|
|
)
|
|
import os
|
|
os.system(f'rm -rf cmake_targets')
|
|
os.system(f'mkdir -p cmake_targets/log')
|
|
import unittest
|
|
|
|
sys.path.append('./') # to find OAI imports below
|
|
import cls_oai_html
|
|
import cls_cmd
|
|
import cls_containerize
|
|
|
|
class TestDeploymentMethods(unittest.TestCase):
|
|
def setUp(self):
|
|
self.html = cls_oai_html.HTMLManagement()
|
|
self.html.testCaseId = "000000"
|
|
self.cont = cls_containerize.Containerize()
|
|
self.cont.eNBSourceCodePath = os.getcwd()
|
|
|
|
def test_pull_clean_local_reg(self):
|
|
# the pull function has the authentication at the internal cluster hardcoded
|
|
# this is a refactoring opportunity: we should do it in a separate step
|
|
# and allow to have pull work with any registry
|
|
registry = cls_containerize.DEFAULT_REGISTRY
|
|
with cls_cmd.getConnection("localhost") as cmd:
|
|
ret = cmd.run(f"ping -c1 -w1 {registry}")
|
|
if ret.returncode != 0: # could not ping once -> skip test
|
|
self.skipTest(f"test_pull_clean_local_reg: could not reach {registry} (run inside sboai)")
|
|
node = 'localhost'
|
|
images = ["oai-gnb"]
|
|
tag = "develop"
|
|
pull = self.cont.Pull_Image_from_Registry(self.html, node, images, tag=tag)
|
|
clean = self.cont.Clean_Test_Server_Images(self.html, node, images, tag=tag)
|
|
self.assertTrue(pull)
|
|
self.assertTrue(clean)
|
|
|
|
def test_pull_clean_docker_hub(self):
|
|
node = 'localhost'
|
|
r = "docker.io"
|
|
images = ["hello-world"]
|
|
tag = "latest"
|
|
pull = self.cont.Pull_Image_from_Registry(self.html, node, images, tag=tag, registry=r, username=None, password=None)
|
|
clean = self.cont.Clean_Test_Server_Images(self.html, node, images, tag=tag)
|
|
self.assertTrue(pull)
|
|
self.assertTrue(clean)
|
|
|
|
if __name__ == '__main__':unittest.main()
|