CI: deploy sabox 5GC through cls_core.py, use in Ping/Iperf

- issue sabox commands from ci_infra.yaml
- use for sabox-nepes (un)deployment, ping, iperf in all XML files
This commit is contained in:
Robert Schmidt
2025-03-31 16:38:13 +02:00
parent 246ad2dda3
commit 5f3f837021
8 changed files with 22 additions and 20 deletions
+7
View File
@@ -105,6 +105,13 @@ ltebox-nano:
sabox-nepes:
Host: nepes
NetworkScript: ip a show dev tun1
Deploy:
- "sudo su -c 'screen -dm -S simulated_5g_hss /opt/hss_sim0609/start_5g_hss'"
- "sleep 1"
- "sudo /opt/ltebox/tools/start_sabox < /dev/null &> /dev/null"
- "sleep 1"
LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{amfLog.0,ngapcLog.0,ngapcommonLog.0,ngapsLog.0,xGwLog.0,upfLog.0} %%log_dir%%"
Undeploy: "sudo /opt/ltebox/tools/stop_sabox; sudo killall screen"
ltebox-nepes:
Host: nepes
+2 -18
View File
@@ -252,16 +252,7 @@ class EPCManagement():
mySSH = cls_cmd.getConnection(self.IPAddress)
html_cell = ''
if re.match('ltebox', self.Type, re.IGNORECASE):
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('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5)
mySSH.command('cd /opt/hss_sim0609', '\$', 5)
mySSH.command('echo ' + self.Password + ' | sudo -S rm -f hss.log', '\$', 5)
mySSH.command('echo ' + self.Password + ' | sudo -S echo "Starting sudo session" && sudo su -c "screen -dm -S simulated_5g_hss ./start_5g_hss"', '\$', 5)
logging.debug('Using the sabox')
mySSH.command('cd /opt/ltebox/tools', '\$', 5)
mySSH.command('echo ' + self.Password + ' | sudo -S ./start_sabox', '\$', 5)
html_cell += 'N/A\n'
raise NotImplemented("use cls_corenetwork.py")
elif re.match('OAICN5G', 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)
@@ -464,14 +455,7 @@ class EPCManagement():
mySSH = cls_cmd.getConnection(self.IPAddress)
message = ''
if re.match('ltebox', self.Type, re.IGNORECASE):
logging.debug('Terminating SA BOX')
mySSH.command('cd /opt/ltebox/tools', '\$', 5)
mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_sabox', '\$', 5)
time.sleep(1)
mySSH.command('cd ' + self.SourceCodePath, '\$', 5)
mySSH.command('cd scripts', '\$', 5)
time.sleep(1)
mySSH.command('echo ' + self.Password + ' | sudo -S screen -S simulated_5g_hss -X quit', '\$', 5)
raise NotImplemented("use cls_corenetwork.py")
elif re.match('OAICN5G', self.Type, re.IGNORECASE):
logging.debug('OAI CN5G Collecting Log files to workspace')
mySSH.command('echo ' + self.Password + ' | sudo rm -rf ' + self.SourceCodePath + '/logs', '\$', 5)
@@ -130,6 +130,7 @@
<class>Ping</class>
<desc>Ping: 20pings in 20sec</desc>
<id>idefix</id>
<svr_id>sabox-nepes</svr_id>
<ping_args>-c 20 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>15</ping_rttavg_threshold>
@@ -139,6 +140,7 @@
<class>Ping</class>
<desc>Ping: 100pings in 20sec</desc>
<id>idefix</id>
<svr_id>sabox-nepes</svr_id>
<ping_args>-c 100 -i 0.2 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>15</ping_rttavg_threshold>
@@ -131,6 +131,7 @@
<class>Ping</class>
<desc>Ping: 50pings in 10sec</desc>
<id>idefix</id>
<svr_id>sabox-nepes</svr_id>
<ping_args>-c 20 -i 0.2 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>25</ping_rttavg_threshold>
@@ -143,6 +143,7 @@
<class>Ping</class>
<desc>Ping: 20pings in 20sec</desc>
<id>idefix</id>
<svr_id>sabox-nepes</svr_id>
<ping_args>-c 20 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>25</ping_rttavg_threshold>
@@ -152,6 +153,7 @@
<class>Ping</class>
<desc>Ping: 100pings in 20sec</desc>
<id>idefix</id>
<svr_id>sabox-nepes</svr_id>
<ping_args>-c 100 -i 0.2 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>110</ping_rttavg_threshold>
@@ -161,6 +163,7 @@
<class>Ping</class>
<desc>Ping: 20pings in 20sec</desc>
<id>idefix</id>
<svr_id>sabox-nepes</svr_id>
<ping_args>-c 20 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>110</ping_rttavg_threshold>
@@ -170,6 +173,7 @@
<class>Ping</class>
<desc>Ping: 100pings in 20sec</desc>
<id>idefix</id>
<svr_id>sabox-nepes</svr_id>
<ping_args>-c 100 -i 0.2 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>110</ping_rttavg_threshold>
@@ -124,6 +124,7 @@
<class>Ping</class>
<desc>Ping: 20pings in 20sec</desc>
<id>idefix</id>
<svr_id>sabox-nepes</svr_id>
<ping_args>-c 20 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>15</ping_rttavg_threshold>
@@ -133,6 +134,7 @@
<class>Ping</class>
<desc>Ping: 100pings in 20sec</desc>
<id>idefix</id>
<svr_id>sabox-nepes</svr_id>
<ping_args>-c 100 -i 0.2 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>15</ping_rttavg_threshold>
+2 -1
View File
@@ -30,8 +30,9 @@
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="060000">
<class>Terminate_5GCN</class>
<class>UndeployCoreNetwork</class>
<desc>Terminate 5GC</desc>
<cn_id>sabox-nepes</cn_id>
</testCase>
</testCaseList>
+2 -1
View File
@@ -31,8 +31,9 @@
</TestCaseExclusionList>
<testCase id="000100">
<class>Initialize_5GCN</class>
<class>DeployCoreNetwork</class>
<desc>Initialize 5GC</desc>
<cn_id>sabox-nepes</cn_id>
</testCase>
</testCaseList>