Commit 37c7e29f authored by hardy's avatar hardy

CI scripted deployment of OAI CN5G

parent 0e4b5a9e
...@@ -220,7 +220,7 @@ class EPCManagement(): ...@@ -220,7 +220,7 @@ class EPCManagement():
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password) mySSH.open(self.IPAddress, self.UserName, self.Password)
if re.match('ltebox', self.Type, re.IGNORECASE): if re.match('ltebox', self.Type, re.IGNORECASE):
logging.debug('Using the sabox simulated HSS') logging.debug('Using the SABOX simulated HSS')
mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5)
mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5)
mySSH.command('cd /opt/hss_sim0609', '\$', 5) mySSH.command('cd /opt/hss_sim0609', '\$', 5)
...@@ -229,6 +229,13 @@ class EPCManagement(): ...@@ -229,6 +229,13 @@ class EPCManagement():
logging.debug('Using the sabox') logging.debug('Using the sabox')
mySSH.command('cd /opt/ltebox/tools', '\$', 5) mySSH.command('cd /opt/ltebox/tools', '\$', 5)
mySSH.command('echo ' + self.Password + ' | sudo -S ./start_sabox', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S ./start_sabox', '\$', 5)
elif re.match('OAI', self.Type, re.IGNORECASE):
logging.debug('Starting OAI CN5G')
mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5)
mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5)
mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5)
mySSH.command('echo ' + self.Password + ' | sudo -S ./core-network.sh start nrf spgwu', '\$', 5)
time.sleep(20) #leave some time for deployment and health check
else: else:
logging.error('This option should not occur!') logging.error('This option should not occur!')
mySSH.close() mySSH.close()
...@@ -433,6 +440,7 @@ class EPCManagement(): ...@@ -433,6 +440,7 @@ class EPCManagement():
mySSH = SSH.SSHConnection() mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password) mySSH.open(self.IPAddress, self.UserName, self.Password)
if re.match('ltebox', self.Type, re.IGNORECASE): if re.match('ltebox', self.Type, re.IGNORECASE):
logging.debug('Terminating SA BOX')
mySSH.command('cd /opt/ltebox/tools', '\$', 5) mySSH.command('cd /opt/ltebox/tools', '\$', 5)
mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_sabox', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_sabox', '\$', 5)
time.sleep(1) time.sleep(1)
...@@ -440,6 +448,10 @@ class EPCManagement(): ...@@ -440,6 +448,10 @@ class EPCManagement():
mySSH.command('cd scripts', '\$', 5) mySSH.command('cd scripts', '\$', 5)
time.sleep(1) time.sleep(1)
mySSH.command('echo ' + self.Password + ' | sudo -S screen -S simulated_5g_hss -X quit', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S screen -S simulated_5g_hss -X quit', '\$', 5)
elif re.match('OAI', self.Type, re.IGNORECASE):
logging.debug('Terminating OAI CN5G')
mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5)
mySSH.command('echo ' + self.Password + ' | sudo -S ./core-network.sh stop nrf spgwu', '\$', 5)
else: else:
logging.error('This should not happen!') logging.error('This should not happen!')
mySSH.close() mySSH.close()
......
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