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()
This diff is collapsed.
......@@ -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