diff --git a/ci-scripts/cls_module_ue.py b/ci-scripts/cls_module_ue.py index e006eb6aae0b2e8593ee8ca2d27a42b2a2c1e40f..cabd0a045de63385c7a0cc159b2e536fe06f0855 100644 --- a/ci-scripts/cls_module_ue.py +++ b/ci-scripts/cls_module_ue.py @@ -76,7 +76,7 @@ class Module_UE: logging.debug('Starting ' + self.Process['Name']) mySSH = sshconnection.SSHConnection() mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword) - mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S ' + self.Process['Cmd'] + ' ' + self.Process['Apn'][CNType] + ' &','\$',5) + mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S ' + self.Process['Cmd'] + ' ' + self.Process['Apn'][CNType] + ' > /dev/null 2>&1 &','\$',5) mySSH.close() #checking the process time.sleep(5) @@ -165,7 +165,7 @@ class Module_UE: #delete old artifacts mySSH.command('echo ' + self.HostPassword + ' | sudo -S rm -rf ci_qlog','\$',5) #start Trace, artifact is created in home dir - mySSH.command('echo $USER; nohup sudo -E QLog/QLog -s ci_qlog -f NR5G.cfg &','\$', 5) + mySSH.command('echo $USER; nohup sudo -E QLog/QLog -s ci_qlog -f NR5G.cfg > /dev/null 2>&1 &','\$', 5) mySSH.close() def DisableTrace(self): @@ -192,7 +192,7 @@ class Module_UE: source='ci_qlog' destination= self.LogStore + '/ci_qlog_'+now_string+'.zip' #qlog artifact is zipped into the target folder - mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S zip -r '+destination+' '+source+' &','\$', 10) + mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S zip -r '+destination+' '+source+' > /dev/null 2>&1 &','\$', 10) mySSH.close() #post action : log cleaning to make sure enough space is reserved for the next run Log_Mgt=cls_log_mgt.Log_Mgt(self.HostUsername,self.HostIPAddress, self.HostPassword, self.LogStore) diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index fdf77ba0070a479a57e8ec8b404b3a9180a7e397..0ae636e4f8766e4264459ec20cb612635617ce25 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -108,6 +108,14 @@ class EPCManagement(): logging.debug('Using the ltebox 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) + result = re.search('hss_sim s6as diam_hss', mySSH.getBefore()) + if result is not None: + mySSH.command('echo ' + self.Password + ' | sudo -S killall hss_sim', '\$', 5) + mySSH.command('ps aux | grep --colour=never xGw | grep -v grep', '\$', 5, silent=True) + result = re.search('root.*xGw', mySSH.getBefore()) + if result is not None: + mySSH.command('cd /opt/ltebox/tools', '\$', 5) + mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_ltebox', '\$', 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_hss ./starthss"', '\$', 5) @@ -420,6 +428,11 @@ class EPCManagement(): mySSH.command('cd scripts', '\$', 5) time.sleep(1) mySSH.command('echo ' + self.Password + ' | sudo -S screen -S simulated_hss -X quit', '\$', 5) + time.sleep(5) + mySSH.command('ps aux | grep --colour=never hss_sim | grep -v grep', '\$', 5, silent=True) + result = re.search('hss_sim s6as diam_hss', mySSH.getBefore()) + if result is not None: + mySSH.command('echo ' + self.Password + ' | sudo -S killall hss_sim', '\$', 5) else: logging.error('This should not happen!') mySSH.close() @@ -446,6 +459,7 @@ class EPCManagement(): elif re.match('ltebox', self.Type, re.IGNORECASE): mySSH.command('cd /opt/ltebox/tools', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_mme', '\$', 5) + time.sleep(5) else: logging.error('This should not happen!') mySSH.close() diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 27fc2726871b5cd483af8e8df2d9e160478e114c..90fece4381310445a5e0ec314a96e0ade6dbc35e 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -374,7 +374,7 @@ class RANManagement(): logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m') pcapfile = pcapfile_prefix + self.testCase_id + '_log.pcap' mySSH.command('echo ' + lPassWord + ' | sudo -S rm -f /tmp/' + pcapfile , '\$', 5) - mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -w /tmp/' + pcapfile + ' 2>&1 &','\$', 5) + mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -w /tmp/' + pcapfile + ' > /dev/null 2>&1 &','\$', 5) mySSH.close()