Commit 76c0335a authored by hardy's avatar hardy

initial work for amarisoft ue

parent 6fbfa3b0
#!/bin/bash
ue_id="$1" # UE id
duration="$2" # Sim duration
shift
shift
function end
{
exit 0
}
trap end INT TERM
echo "ip netns exec $ue_id $@ > /tmp/test_${ue_id}.log"
ip netns exec $ue_id $@ > /tmp/test_$ue_id.log
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 40
#define UE_COUNT 3 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue0.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
band: 78,
dl_nr_arfcn:621312,
ssb_nr_arfcn:621312,
//band: 41,
//dl_nr_arfcn:517020,
//ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"ue_id" : 0,
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
}, /*end UE object 0*/
{
/* UE capabilities */
/* USIM data */
"ue_id" : 1,
"imsi": "208970100001128",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
}, /*end UE object 1*/
{
/* UE capabilities */
/* USIM data */
"ue_id" : 2,
"imsi": "208970100001129",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
} /*end UE object 2*/
],/*end UE list*/
}/*end json*/
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 40
#define UE_COUNT 2 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue0.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
band: 78,
dl_nr_arfcn:621312,
ssb_nr_arfcn:621312,
//band: 41,
//dl_nr_arfcn:517020,
//ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"ue_id" : 1,
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
}, /*end UE object 0*/
{
/* UE capabilities */
/* USIM data */
"ue_id" : 2,
"imsi": "208970100001128",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 15,
end_time: 25,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
} /*end UE object 1*/
],/*end UE list*/
}/*end json*/
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 40
#define UE_COUNT 2 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue0.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
band: 78,
dl_nr_arfcn:621312,
ssb_nr_arfcn:621312,
//band: 41,
//dl_nr_arfcn:517020,
//ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"ue_id" : 1,
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 15,
end_time: 25,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
}, /*end UE object 0*/
{
/* UE capabilities */
/* USIM data */
"ue_id" : 2,
"imsi": "208970100001128",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 15,
end_time: 25,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 30,
}
] /*end sim events */
} /*end UE object 1*/
],/*end UE list*/
}/*end json*/
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 40
#define UE_COUNT 2 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue0.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: true,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
band: 78,
dl_nr_arfcn:621312,
ssb_nr_arfcn:621312,
//band: 41,
//dl_nr_arfcn:517020,
//ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"ue_id" : 1,
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 20,
end_time: 30,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 60,
}
] /*end sim events */
}, /*end UE object 0*/
{
/* UE capabilities */
/* USIM data */
"ue_id" : 2,
"imsi": "208970100001128",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [
{
event: "power_on",
start_time: 5,
},
{
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 40,
end_time: 50,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 60,
}
] /*end sim events */
} /*end UE object 1*/
],/*end UE list*/
}/*end json*/
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 40
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue1.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and
allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: false,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
band: 78,
dl_nr_arfcn:621312,
ssb_nr_arfcn:621312,
//band: 41,
//dl_nr_arfcn:517020,
//ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 66051,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 66051,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [{
event: "power_on",
start_time: 5,
}, {
"tag": "ping",
"prog":"oai_ext_app.sh",
start_time: 15,
end_time: 25,
"args":["ping 192.168.70.136"],
"event":"ext_app"
},
{
event: "power_off",
start_time: 30,
}]
}
],
}
/* UE simulator configuration */
/* UE simulator configuration file version 2021-06-17
* LTE / 5G Non StandAlone
* Copyright (C) 2019-2021 Amarisoft
*/
{
#define N_ANTENNA_DL 1
#define TDD 1
#define CELL_BANDWIDTH 20
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",
log_filename: "/tmp/ue0.log",
/* Enable remote API and Web interface */
com_addr: "0.0.0.0:9002",
include "rf_driver/1chan.cfg",
/* If true, allow the simulation of several UEs at the same time and
allow dynamic UE creation from remote API */
cell_groups: [{
group_type: "nr",
multi_ue: false,
cells: [{
rf_port: 0,
bandwidth: CELL_BANDWIDTH,
#if TDD == 1
// band: 78,
// dl_nr_arfcn:621312,
// ssb_nr_arfcn:621312,*/
band: 41,
dl_nr_arfcn:517020,
ssb_nr_arfcn:516990,
#else
band: 7,
dl_nr_arfcn: 536020,
ssb_nr_arfcn: 535930,
ssb_subcarrier_spacing: 15,
#endif
subcarrier_spacing: 30,
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: 1,
rx_to_tx_latency:2,
}],
}],
/* Enable it to allow sim_events to be handled remotely */
//rue_bind_addr: "127.0.10.11",
ue_list: [
{
/* UE capabilities */
/* USIM data */
"imsi": "208970100001127",
"K": "fec86ba6eb707ed08905757b1bb44b8f",
"sim_algo":"milenage",
"op": "1006020f0a478bf6b699f15c062e42b3",
as_release: 15,
ue_category: "nr",
apn:"oai",
attach_pdn_type:"ipv4",
default_nssai: [
{
sst: 1,
sd: 1,
},
],
default_pdu_session_snssai: {
sst: 1,
sd: 1,
},
/* Enable it to allow sim_events to be handled remotely */
//rue_addr: "127.1.0.0",
/* Enable it to create a TUN interface for each UE PDN */
tun_setup_script: "ue-ifup",
sim_events: [{
event: "power_on",
start_time: 5,
}, {
event: "ext_app",
start_time: 15,
end_time: 25,
prog: "ext_app.sh",
args: ["iperf", " -c 172.21.10.5", " -u"," -b 1M"," -i 1"," -t 10"]
}, {
event: "power_off",
start_time: 30,
}]
}
],
}
......@@ -39,6 +39,46 @@ nrmodule2_quectel:
StartCommands :
- sudo -S ip link set dev wwan1 mtu 1500
MTU : 1500
#single UE single ping
amarisoft_ue_1:
ID: amarisoft_ue_1
State : enabled
Kind : amarisoft
#not required for AS config but needed for py script
WakeupScript : none
DetachScript : none
#end
Cmd : /root/NV17-12-21/ue/lteue
Config : /root/NV17-12-21/ue/config/oaicicd-ue-Ping-SATest.cfg
Duration : 60
Ping : /tmp/test_ue1.log
HostIPAddress : 192.168.18.89
HostUsername : root
HostPassword : toor
HostSourceCodePath : /tmp
#an other scenario example
amarisoft_ue_2:
ID: amarisoft_ue_2
State : enabled
Kind : amarisoft
#not required for AS config but needed for py script
WakeupScript : none
DetachScript : none
#end
Cmd : /root/NV17-12-21/ue/lteue
Config : /root/NV17-12-21/ue/config/xxxxxxx.cfg #to be updated for an other scenario
Duration : 60
Ping : /tmp/test_ue1.log #to be updated fo an other scenario
HostIPAddress : 192.168.18.89
HostUsername : root
HostPassword : toor
HostSourceCodePath : /tmp
#do not remove
dummy:
ID: ''
State : ''
......
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
# Required Python Version
# Python 3.x
#
#---------------------------------------------------------------------
#to use isfile
import os
import sys
import logging
#to create a SSH object locally in the methods
import sshconnection
#time.sleep
import time
import re
import subprocess
from datetime import datetime
class AS_UE:
def __init__(self,Module):
#create attributes as in the UE dictionary
for k, v in Module.items():
setattr(self, k, v)
#-----------------$
#PUBLIC Methods$
#-----------------$
def WaitEndScenario(self):
logging.debug('waiting for scenario duration')
time.sleep(int(self.Duration))
def KillASUE(self):
mySSH = sshconnection.SSHConnection()
mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword)
mySSH.command('killall --signal SIGKILL lteue-avx2', '#', 5)
mySSH.close()
def RunScenario(self):
mySSH = sshconnection.SSHConnection()
mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword)
cmd='echo $USER; nohup '+self.Cmd + ' ' + self.Config + ' &'
mySSH.command(cmd,'#',5)
mySSH.close()
......@@ -55,6 +55,7 @@ import constants as CONST
import sshconnection
import cls_module_ue
import cls_amarisoft_ue
import cls_ci_ueinfra #class defining the multi Ue infrastrucure
logging.getLogger("matplotlib").setLevel(logging.WARNING)
......@@ -418,8 +419,12 @@ class OaiCiTest():
for job in multi_jobs:
job.join()
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
else: #if an ID is specified, it is a module from the yaml infrastructure file
#RH
else: #if an ID is specified, it is a UE from the yaml infrastructure file
ue_kind = InfraUE.ci_ue_infra[self.ue_id]['Kind']
logging.debug("Detected UE Kind : " + ue_kind)
#case it is a quectel module (only 1 at a time supported at the moment)
if ue_kind == 'quectel':
Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
Module_UE.ue_trace=ue_trace
is_module=Module_UE.CheckCMProcess(EPC.Type)
......@@ -461,6 +466,15 @@ class OaiCiTest():
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE,CONTAINERS)
return
#case it is a amarisoft ue (only 1 at a time supported at the moment)
elif ue_kind == 'amarisoft':
AS_UE = cls_amarisoft_ue.AS_UE(InfraUE.ci_ue_infra[self.ue_id])
AS_UE.RunScenario()
AS_UE.WaitEndScenario()
AS_UE.KillASUE()
else:
logging.debug("Incorrect UE Kind was detected")
def InitializeOAIUE(self,HTML,RAN,EPC,COTS_UE,InfraUE,CONTAINERS):
......@@ -1569,15 +1583,23 @@ class OaiCiTest():
SSH = sshconnection.SSHConnection()
# Launch ping on the EPC side (true for ltebox and old open-air-cn)
# But for OAI-Rel14-CUPS, we launch from python executor
ping_status = 0
launchFromEpc = True
launchFromModule = False
launchFromASUE = False
if re.match('OAI-Rel14-CUPS', EPC.Type, re.IGNORECASE):
launchFromEpc = False
#if module, ping from module to EPC
if self.ue_id!='':
if (re.match('amarisoft', self.ue_id, re.IGNORECASE)):
logging.debug("Ping analysis from amarisoft scenario")
launchFromEpc = False
launchfromModule = True
launchFromASUE = True
else:
launchFromEpc = False
launchFromModule = True
#no ping args for ASUE
if self.ping_args!='':
ping_time = re.findall("-c (\d+)",str(self.ping_args))
if launchFromEpc:
......@@ -1596,14 +1618,14 @@ class OaiCiTest():
#copy the ping log file to have it locally for analysis (ping stats)
SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/scripts/ping_' + self.testCase_id + '_' + device_id + '.log', '.')
else:
if launchfromModule == False:
if (launchFromModule == False) and (launchFromASUE == False):
#ping log file is on the python executor
cmd = 'ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 > ping_' + self.testCase_id + '_' + device_id + '.log'
message = cmd + '\n'
logging.debug(cmd)
ret = subprocess.run(cmd, shell=True)
ping_status = ret.returncode
#copy the ping log file to an other folder for log collection (source and destination are EPC)
#copy the ping log file to an other folder for log collection (source and desti elif (launchfromModule == True) and (launchfromASUE == False): #launch from Modulenation are EPC)
SSH.copyout(EPC.IPAddress, EPC.UserName, EPC.Password, 'ping_' + self.testCase_id + '_' + device_id + '.log', EPC.SourceCodePath + '/scripts')
#copy the ping log file to have it locally for analysis (ping stats)
logging.debug(EPC.SourceCodePath + 'ping_' + self.testCase_id + '_' + device_id + '.log')
......@@ -1613,7 +1635,8 @@ class OaiCiTest():
#cat is executed on EPC
SSH.command('cat ' + EPC.SourceCodePath + '/scripts/ping_' + self.testCase_id + '_' + device_id + '.log', '\$', 5)
ping_log_file='/scripts/ping_' + self.testCase_id + '_' + device_id + '.log'
else: #launch from Module
elif (launchFromModule == True) and (launchFromASUE == False): #launch from Module
SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
#target address is different depending on EPC type
if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE):
......@@ -1625,13 +1648,25 @@ class OaiCiTest():
#ping from module NIC rather than IP address to make sure round trip is over the air
cmd = 'ping -I ' + Module_UE.UENetwork + ' ' + self.ping_args + ' ' + Target + ' 2>&1 > ping_' + self.testCase_id + '_' + self.ue_id + '.log'
SSH.command(cmd,'\$',int(ping_time[0])*1.5)
#copy the ping log file to have it locally for analysis (ping stats)
SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, 'ping_' + self.testCase_id + '_' + self.ue_id + '.log', '.')
#cat is executed locally
SSH.command('cat ping_' + self.testCase_id + '_' + self.ue_id + '.log', '\$', 5)
ping_log_file='ping_' + self.testCase_id + '_' + self.ue_id + '.log'
ping_status=0
elif (launchFromASUE == True):
#ping was already executed when running scenario
#we only need to retrieve ping log file, whose location is in the ci_ueinfra.yaml
logging.debug("Get Ping log from AS server : " + Module_UE.Ping)
SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, Module_UE.Ping, '.')
path,ping_log_file = os.path.split(Module_UE.Ping)
SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
SSH.command('cat ' + Module_UE.Ping, '\#', 5)
else:
ping_status=-1
# TIMEOUT CASE
if ping_status < 0:
......@@ -1679,9 +1714,11 @@ class OaiCiTest():
#adding extra ping stats from local file
#ping_log_file variable is defined above in this function, depending on device/ue
ping_stat_msg=''
if launchFromASUE == False : #skip in case of AS UE (for the moment)
logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file)
ping_stat=GetPingTimeAnalysis(RAN,ping_log_file,self.ping_rttavg_threshold)
ping_stat_msg=''
if (ping_stat!=-1) and (len(ping_stat)!=0):
ping_stat_msg+='Ping stats before removing largest value : \n'
ping_stat_msg+='RTT(Min) : ' + str("{:.2f}".format(ping_stat['min_0'])) + 'ms \n'
......@@ -1700,7 +1737,7 @@ class OaiCiTest():
#checking packet loss compliance
packetLossOK = True
if packetloss is not None:
if (packetloss is not None) :
if float(packetloss) > float(self.ping_packetloss_threshold):
qMsg += '\nPacket Loss too high'
logging.debug('\u001B[1;37;41m Packet Loss too high; Target: '+ self.ping_packetloss_threshold + '%\u001B[0m')
......@@ -1728,6 +1765,7 @@ class OaiCiTest():
lock.release()
SSH.close()
except:
logging.debug('exit from Ping_Common except')
os.kill(os.getppid(),signal.SIGUSR1)
def PingNoS1_wrong_exit(self, qMsg,HTML):
......@@ -1855,11 +1893,21 @@ class OaiCiTest():
HTML.CreateHtmlTestRow(self.ping_args, 'KO', CONST.UE_IP_ADDRESS_ISSUE)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE,CONTAINERS)
return
else:
else: #if an ID is specified, it is a UE from the yaml infrastructure file
ue_kind = InfraUE.ci_ue_infra[self.ue_id]['Kind']
logging.debug("Detected UE Kind : " + ue_kind)
if ue_kind == 'quectel':
self.UEIPAddresses=[]
Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
Module_UE.GetModuleIPAddress()
self.UEIPAddresses.append(Module_UE.UEIPAddress)
elif ue_kind == 'amarisoft':
self.UEIPAddresses=['AS UE IP']
Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
else:
logging.debug("Incorrect UE Kind was detected")
logging.debug(self.UEIPAddresses)
multi_jobs = []
i = 0
......@@ -1870,6 +1918,7 @@ class OaiCiTest():
device_id = self.UEDevices[i]
else:
device_id = Module_UE.ID + "-" + Module_UE.Kind
logging.debug(device_id)
p = Process(target = self.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,EPC,Module_UE,RAN,))
p.daemon = True
p.start()
......@@ -3447,6 +3496,9 @@ class OaiCiTest():
job.join()
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
else: #if an ID is specified, it is a module from the yaml infrastructure file
ue_kind = InfraUE.ci_ue_infra[self.ue_id]['Kind']
logging.debug("Detected UE Kind : " + ue_kind)
if ue_kind == 'quectel':
Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
Module_UE.ue_trace=ue_trace
Module_UE.Command("detach")
......@@ -3457,6 +3509,10 @@ class OaiCiTest():
HTML.CreateHtmlTestRow('QLog at : '+archive_destination, 'OK', CONST.ALL_PROCESSES_OK)
else:
HTML.CreateHtmlTestRow('QLog trace is disabled', 'OK', CONST.ALL_PROCESSES_OK)
elif ue_kind == 'amarisoft':
HTML.CreateHtmlTestRow('AS UE is already terminated', 'OK', CONST.ALL_PROCESSES_OK)
else:
logging.debug("Incorrect UE Kind was detected")
def TerminateOAIUE(self,HTML,RAN,COTS_UE,EPC,InfraUE,CONTAINERS):
SSH = sshconnection.SSHConnection()
......
......@@ -66,6 +66,8 @@ class EPCManagement():
self.mmeConfFile = 'mme.conf'
self.yamlPath = ''
self.isMagmaUsed = False
self.cfgDeploy = '--type start-mini --fqdn yes --scenario 1 --capture /tmp/oai-cn5g-v1.3.pcap' #from xml, 'mini' is default normal for docker-network.py
self.cfgUnDeploy = '--type stop-mini --fqdn yes --scenario 1' #from xml, 'mini' is default normal for docker-network.py
#-----------------------------------------------------------
......@@ -251,8 +253,8 @@ class EPCManagement():
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('./core-network.sh start nrf spgwu', '\$', 60)
mySSH.command('cd /opt/oai-cn5g-fed-v1.3/docker-compose', '\$', 5)
mySSH.command('python3 ./core-network.py '+self.cfgDeploy, '\$', 60)
time.sleep(2)
mySSH.command('docker-compose -p 5gcn ps -a', '\$', 60)
if mySSH.getBefore().count('Up (healthy)') != 6:
......@@ -530,8 +532,8 @@ class EPCManagement():
mySSH.command('docker logs ' + c + ' > ' + self.SourceCodePath + '/logs/' + c + '.log', '\$', 5)
logging.debug('Terminating OAI CN5G')
mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5)
mySSH.command('./core-network.sh stop nrf spgwu', '\$', 60)
mySSH.command('cd /opt/oai-cn5g-fed-v1.3/docker-compose', '\$', 5)
mySSH.command('python3 ./core-network.py '+self.cfgUnDeploy, '\$', 60)
mySSH.command('docker volume prune --force || true', '\$', 60)
time.sleep(2)
mySSH.command('tshark -r /tmp/oai-cn5g.pcap | egrep --colour=never "Tracking area update" ','\$', 30)
......
......@@ -376,6 +376,16 @@ def GetParametersFromXML(action):
if (string_field is not None):
EPC.yamlPath = string_field
elif action == 'Initialize_5GCN':
string_field = test.findtext('args')
if (string_field is not None):
EPC.cfgDeploy = string_field
elif action == 'Terminate_5GCN':
string_field = test.findtext('args')
if (string_field is not None):
EPC.cfgUnDeploy = string_field
elif action == 'Deploy_Object' or action == 'Undeploy_Object':
eNB_instance=test.findtext('eNB_instance')
if (eNB_instance is None):
......
......@@ -56,6 +56,7 @@ class SSHConnection():
self.picocom_closure = True
def open(self, ipaddress, username, password):
prompt = "#" if username == "root" else "\$"
count = 0
connect_status = False
while count < 4:
......@@ -68,7 +69,7 @@ class SSHConnection():
self.sshresponse = self.ssh.expect(['password:', username + '@'])
if self.sshresponse == 0:
self.ssh.sendline(password)
self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
self.sshresponse = self.ssh.expect([prompt, 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
if self.sshresponse == 0:
count = 10
connect_status = True
......@@ -76,7 +77,7 @@ class SSHConnection():
logging.debug('self.sshresponse = ' + str(self.sshresponse))
elif self.sshresponse == 1:
self.ssh.sendline(password)
self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
self.sshresponse = self.ssh.expect([prompt, 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
if self.sshresponse == 0:
count = 10
connect_status = True
......@@ -84,7 +85,7 @@ class SSHConnection():
logging.debug('self.sshresponse = ' + str(self.sshresponse))
elif self.sshresponse == 2:
# Checking if we are really on the remote client defined by its IP address
self.command('stdbuf -o0 ifconfig | egrep --color=never "inet addr:|inet "', '\$', 5)
self.command('stdbuf -o0 ifconfig | egrep --color=never "inet addr:|inet "', prompt, 5)
result = re.search(str(ipaddress), str(self.ssh.before))
if result is None:
self.close()
......@@ -100,7 +101,7 @@ class SSHConnection():
time.sleep(1)
count += 1
if connect_status:
self.command('unset HISTFILE', '\$', 5, silent=True)
self.command('unset HISTFILE', prompt, 5, silent=True)
else:
sys.exit('SSH Connection Failed')
self.ipaddress = ipaddress
......
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>TEST-SA-FR1-Tab1</htmlTabRef>
<htmlTabName>SA Ping DL UL with 1 AS UE</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>
040000
000001
010000
000002
050000
080000
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="010000">
<class>Initialize_UE</class>
<desc>Initialize Amarisoft UE 1x</desc>
<id>amarisoft_ue_1</id>
</testCase>
<testCase id="040000">
<class>Initialize_eNB</class>
<desc>Initialize gNB</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf --sa -q --usrp-tx-thread-config 1 --T_stdout 2 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
<air_interface>nr</air_interface>
<eNB_Trace>yes</eNB_Trace>
<eNB_Stats>yes</eNB_Stats>
<rt_stats_cfg>datalog_rt_stats.2x2.yaml</rt_stats_cfg>
<USRP_IPAddress>192.168.18.252</USRP_IPAddress>
</testCase>
<testCase id="050000">
<class>Ping</class>
<desc>Ping from AS UEc</desc>
<id>amarisoft_ue_1</id>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
</testCase>
<testCase id="000001">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>60</idle_sleep_time_in_sec>
</testCase>
<testCase id="000002">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>20</idle_sleep_time_in_sec>
</testCase>
<testCase id="080000">
<class>Terminate_eNB</class>
<desc>Terminate gNB</desc>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
<air_interface>nr</air_interface>
</testCase>
</testCaseList>
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>cn5g-closure</htmlTabRef>
<htmlTabName>CN5G-Closure</htmlTabName>
<htmlTabIcon>log-out</htmlTabIcon>
<TestCaseRequestedList>
060000
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="060000">
<class>Terminate_5GCN</class>
<desc>Terminate 5G Core</desc>
<args>--type stop-mini-as-ue --fqdn yes --scenario 1</args>
</testCase>
</testCaseList>
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>cn5g-start-tab</htmlTabRef>
<htmlTabName>CN5G-Start</htmlTabName>
<htmlTabIcon>log-in</htmlTabIcon>
<TestCaseRequestedList>
000100
</TestCaseRequestedList>
<TestCaseExclusionList>
</TestCaseExclusionList>
<testCase id="000100">
<class>Initialize_5GCN</class>
<desc>Initialize 5G Core</desc>
<args>--type start-mini-as-ue --fqdn yes --scenario 1 --capture /tmp/oai-cn5g-v1.3.pcap</args>
</testCase>
</testCaseList>
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