Commit 0695bb62 authored by Deokseong "David" Kim's avatar Deokseong "David" Kim

Merge branch 'episys/json_configurations' into 'episys/master-sl'

Added network JSON configuration and its parsing function in python script

See merge request aburger/openairinterface5g!246
parents d9355406 ecd900be
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# #
# python3 run_sl_test.py -l nearby --user account --host 10.1.1.68 -r 2 --test usrp # python3 run_sl_test.py -l nearby --user account --host 10.1.1.68 -r 2 --test usrp
# #
# To run usrp test in the net 1 speficifed in sl_cmds.txt, the following will be used. # To run usrp test in the net 1 specified in sl_net_config.json, the following will be used.
# #
# python3 run_sl_test.py --test usrp --net 1 # python3 run_sl_test.py --test usrp --net 1
# #
...@@ -30,6 +30,7 @@ import logging ...@@ -30,6 +30,7 @@ import logging
import time import time
import re import re
import glob import glob
import json
import subprocess, shlex import subprocess, shlex
from subprocess import Popen from subprocess import Popen
from subprocess import check_output from subprocess import check_output
...@@ -76,8 +77,8 @@ parser.add_argument('--basic', '-b', action='store_true', help=""" ...@@ -76,8 +77,8 @@ parser.add_argument('--basic', '-b', action='store_true', help="""
Basic test with basic shell commands Basic test with basic shell commands
""") """)
parser.add_argument('--commands', default='sl_cmds.txt', help=""" parser.add_argument('--config', default='sl_net_config.json', help="""
The USRP Commands .txt file (default: %(default)s) The network configurations .json file (default: %(default)s)
""") """)
parser.add_argument('--compress', action='store_true', help=""" parser.add_argument('--compress', action='store_true', help="""
...@@ -166,14 +167,15 @@ def thread_delay(delay: int) -> None: ...@@ -166,14 +167,15 @@ def thread_delay(delay: int) -> None:
time.sleep(delay) time.sleep(delay)
count += 1 count += 1
class Command: class Config:
""" """
Parsing USRP commands file Parsing config file
""" """
def __init__(self, filename) -> None: def __init__(self, filename) -> None:
self.check_user() self.check_user()
self.filename = self.check_file(filename) self.filename = self.check_file(filename)
self.parse_commands() self.test = OPTS.test.lower()
self.parse_config_json()
def check_user(self) -> None: def check_user(self) -> None:
if 'usrp' != OPTS.test: if 'usrp' != OPTS.test:
...@@ -189,77 +191,30 @@ class Command: ...@@ -189,77 +191,30 @@ class Command:
LOGGER.error('The file %s does not exist!', filename) LOGGER.error('The file %s does not exist!', filename)
sys.exit(1) sys.exit(1)
def parse_commands(self) -> None: def parse_config_json(self) -> None:
""" """
Scan the provided commands file. Parse configurations from the json file
""" """
if OPTS.test.lower() == 'usrp':
launch_cmds_re = re.compile(r'^\s*(\S*)_usrp_\S+_(\S*)_cmd\s*=\s*((\S+\s*)*)')
elif OPTS.test.lower() == 'rfsim':
launch_cmds_re = re.compile(r'^\s*(\S*)_rfsim_(\S*)_cmd\s*=\s*((\S+\s*)*)')
elif OPTS.test.lower() == 'psbchsim':
launch_cmds_re = re.compile(r'^\s*(\S*)_psbchsim_(\S*)_cmd\s*=\s*((\S+\s*)*)')
elif OPTS.test.lower() == 'psschsim':
launch_cmds_re = re.compile(r'^\s*(\S*)_psschsim_(\S*)_cmd\s*=\s*((\S+\s*)*)')
else:
LOGGER.error("Provided test option not valid! %s", OPTS.test)
sys.exit(1)
nearby_host_re = re.compile(r'^\s*(\S*)_usrp_\S*_(\S*)_hostIP\s*=\s*((\S+\s*)*)')
self.launch_cmds = defaultdict(list) self.launch_cmds = defaultdict(list)
self.hosts = defaultdict(list) self.hosts = defaultdict(list)
with open(self.filename, 'rt') as in_fh:
nearby_cmd_continued = False with open(self.filename) as in_fh:
syncref_cmd_continued = False json_data = json.load(in_fh)
target_netid = f'net{OPTS.net}' if f"net_{OPTS.net}" in json_data[self.test].keys():
for line in in_fh: net_config = json_data[self.test][f"net_{OPTS.net}"]
if line == '\n': else:
continue LOGGER.error('net %d configuration does not exist.', OPTS.net)
match = launch_cmds_re.match(line) sys.exit(1)
if match: for net in net_config:
host_role = match.group(1) role = net['role']
netid = match.group(2) self.launch_cmds[role].append(net["cmd"])
matched_cmd = match.group(3) self.hosts[role].append(net["ip"])
match = match and (netid == target_netid)
if match:
if host_role.lower() == 'nearby':
nearby_cmd_continued = True
continue
if host_role.lower() == 'syncref':
syncref_cmd_continued = True
continue
elif nearby_cmd_continued:
matched_cmd += line
if not line.strip().endswith('\\'):
self.launch_cmds['nearby'].append(matched_cmd)
LOGGER.debug('Nearby cmd is %s', matched_cmd)
nearby_cmd_continued = False
continue
elif syncref_cmd_continued:
matched_cmd += line
if not line.strip().endswith('\\'):
self.launch_cmds['syncref'].append(matched_cmd)
LOGGER.debug('Syncref cmd is %s', matched_cmd)
syncref_cmd_continued = False
continue
else:
host_match = nearby_host_re.match(line)
if host_match:
host_role = host_match.group(1)
netid = host_match.group(2)
matched_host_ip = host_match.group(3)
if host_role.lower() == 'nearby' and netid == target_netid:
self.hosts['nearby'].append(matched_host_ip.strip())
LOGGER.debug('Nearby host is %s\n', matched_host_ip.strip())
continue
else:
LOGGER.debug('Unmatched line %r', line)
continue
if not self.launch_cmds: if not self.launch_cmds:
LOGGER.error('usrp commands are not found in file: %s', self.filename) LOGGER.error('%s commands are not found in file: %s', self.test, self.filename)
sys.exit(1) sys.exit(1)
if OPTS.test.lower() == 'usrp' and not self.hosts['nearby']: if OPTS.test.lower() == 'usrp' and not self.hosts['nearby']:
LOGGER.error(f'Nearby host IP is expected. Add nearby host IP to {OPTS.commands}') LOGGER.error(f'Nearby host IP is expected. Add nearby host IP to {OPTS.config}')
sys.exit(1) sys.exit(1)
class Node: class Node:
...@@ -299,15 +254,15 @@ class Node: ...@@ -299,15 +254,15 @@ class Node:
dest = '' if '--dest' in cmd or OPTS.dest == '' else f' --dest {OPTS.dest}' dest = '' if '--dest' in cmd or OPTS.dest == '' else f' --dest {OPTS.dest}'
tx_msg = f' --message "{OPTS.message}"' if len(OPTS.message) > 0 else '' tx_msg = f' --message "{OPTS.message}"' if len(OPTS.message) > 0 else ''
if role == 'syncref': if role == 'syncref':
cmd = cmd[:-1] + tx_msg + f' --mcs {OPTS.mcs}' + dest cmd = cmd + tx_msg + f' --mcs {OPTS.mcs}' + dest
if 'rfsim' == OPTS.test: if 'rfsim' == OPTS.test:
cmd += f' --snr {OPTS.snr}' cmd += f' --snr {OPTS.snr}'
if role == 'nearby': if role == 'nearby':
if 'usrp' == OPTS.test: if 'usrp' == OPTS.test:
cmd = cmd[:-2] + tx_msg + f' --mcs {OPTS.mcs}' + cmd[-2] # cmd[-2] is ' (end of cmd) cmd = cmd[:-1] + tx_msg + f' --mcs {OPTS.mcs}' + cmd[-1] # -1 is ' index (end of cmd)
cmd = cmd + f' -d {OPTS.duration} --nid1 {OPTS.nid1} --nid2 {OPTS.nid2}' cmd = cmd + f' -d {OPTS.duration} --nid1 {OPTS.nid1} --nid2 {OPTS.nid2}'
else: else:
cmd = cmd[:-1] + tx_msg + f' --mcs {OPTS.mcs}' cmd = cmd + tx_msg + f' --mcs {OPTS.mcs}'
if 'rfsim' == OPTS.test: if 'rfsim' == OPTS.test:
cmd += f' --snr {OPTS.snr}' cmd += f' --snr {OPTS.snr}'
return cmd return cmd
...@@ -486,15 +441,15 @@ def set_attenuation(attenuation: int, atten_host: str, user: str) -> None: ...@@ -486,15 +441,15 @@ def set_attenuation(attenuation: int, atten_host: str, user: str) -> None:
LOGGER.info(f"attenuation value {attenuation} among: {out}") LOGGER.info(f"attenuation value {attenuation} among: {out}")
time.sleep(1) time.sleep(1)
def generate_jobs(commands: Command) -> list: def generate_jobs(config: Config) -> list:
jobs, node_id, host = [], '', OPTS.host jobs, node_id, host = [], '', OPTS.host
if commands.launch_cmds is not None: if config.launch_cmds is not None:
for role, cmd_list in commands.launch_cmds.items(): for role, cmd_list in config.launch_cmds.items():
for cmd in cmd_list: for cmd in cmd_list:
if 'node-number' in cmd: if 'node-number' in cmd:
node_id = cmd.split('node-number', 1)[-1].split(maxsplit=1)[0] node_id = cmd.split('node-number', 1)[-1].split(maxsplit=1)[0]
if role == 'nearby' and OPTS.host == '': if role == 'nearby' and OPTS.host == '':
host = commands.hosts[role].pop(0) host = config.hosts[role].pop(0)
if OPTS.launch == 'all': if OPTS.launch == 'all':
jobs.append(Node(node_id, role, host, cmd)) jobs.append(Node(node_id, role, host, cmd))
elif role == OPTS.launch: elif role == OPTS.launch:
...@@ -508,10 +463,10 @@ def main() -> int: ...@@ -508,10 +463,10 @@ def main() -> int:
""" """
Main function to run sidelink test repeatedly for a given attenuation value. Main function to run sidelink test repeatedly for a given attenuation value.
""" """
commands = Command(OPTS.commands) config = Config(OPTS.config)
log_agent = LogChecker(OPTS, LOGGER) log_agent = LogChecker(OPTS, LOGGER)
LOGGER.debug(f'Number of iterations {OPTS.repeat}') LOGGER.debug(f'Number of iterations {OPTS.repeat}')
jobs = generate_jobs(commands) jobs = generate_jobs(config)
if 'usrp' == OPTS.test: if 'usrp' == OPTS.test:
set_attenuation(OPTS.att, OPTS.att_host, OPTS.att_user) set_attenuation(OPTS.att, OPTS.att_host, OPTS.att_user)
for i in range(OPTS.repeat): for i in range(OPTS.repeat):
......
# The lines containing 'usrp' and starts with 'syncref' or 'nearby' will be valid until it does not contain backspace.
################################################################
#### USRP B210 --- USRP B210 ####
################################################################
### TX SyncRef UE ###
syncref_usrp_b210_net0_cmd = \
sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--sl-mode 2 --sync-ref --rbsl 52 --numerology 1 --band 38 --SLC 2600000000 --ue-txgain 0 \
--usrp-args "type=b200,serial=3150384,clock_source=external" \
--log_config.global_log_options time,nocolor \
> ~/syncref.log 2>&1
### RX Nearby UE ###
nearby_usrp_b210_net0_hostIP = 10.1.1.61
nearby_usrp_b210_net0_cmd = cd $HOME/openairinterface5g/ci-scripts; \
python3 sl_rx_agent.py --cmd \
'sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--sl-mode 2 --rbsl 52 --numerology 1 --band 38 --SLC 2600000000 --ue-rxgain 90 \
--usrp-args "type=b200,serial=3150361,clock_source=external" \
--log_config.global_log_options time,nocolor \
> ~/nearby.log 2>&1'
################################################################
#### USRP N310 --- USRP N310 ####
################################################################
### TX SyncRef UE ###
syncref_usrp_n310_net1_cmd = \
sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--sl-mode 2 --sync-ref --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-txgain 0 \
--usrp-args "type=n3xx,addr=192.168.10.2,subdev=A:0,master_clock_rate=122.88e6" \
--log_config.global_log_options time,nocolor \
> ~/syncref.log 2>&1
### RX Nearby UE ###
nearby_usrp_n310_net1_hostIP = 10.1.1.80
nearby_usrp_n310_net1_cmd = cd $HOME/openairinterface5g/ci-scripts; \
python3 sl_rx_agent.py --cmd \
'sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--sl-mode 2 --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-rxgain 75 \
--usrp-args "type=n3xx,addr=192.168.10.2,subdev=A:0,master_clock_rate=122.88e6" \
--log_config.global_log_options time,nocolor \
> ~/nearby.log 2>&1'
################################################################
#### Multi-hop: USRP N310 --- USRP N310 --- USRP B210 ####
################################################################
### TX SyncRef UE ###
syncref_usrp_n310_net2_cmd = \
sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--sl-mode 2 --sync-ref --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-txgain 0 \
--usrp-args "type=n3xx,addr=192.168.10.2,subdev=A:0,master_clock_rate=122.88e6" \
--log_config.global_log_options time,nocolor --node-number 1 \
> ~/syncref1.log 2>&1
### Relay UE ###
nearby_usrp_n310_net2_hostIP = 10.1.1.80
nearby_usrp_n310_net2_cmd = cd $HOME/openairinterface5g/ci-scripts; \
python3 sl_rx_agent.py --cmd \
'sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--sl-mode 2 --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-txgain 0 --ue-rxgain 75 \
--usrp-args "type=n3xx,addr=192.168.10.2,subdev=A:0,master_clock_rate=122.88e6" \
--log_config.global_log_options time,nocolor --node-number 2 \
> ~/nearby2.log 2>&1'
### RX Nearby UE ###
nearby_usrp_b210_net2_hostIP = 10.1.1.63
nearby_usrp_b210_net2_cmd = cd $HOME/openairinterface5g/ci-scripts; \
python3 sl_rx_agent.py --cmd \
'sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--sl-mode 2 --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-rxgain 100 \
--usrp-args "type=b200,serial=3150384,clock_source=external" \
--log_config.global_log_options time,nocolor --node-number 3 \
> ~/nearby3.log 2>&1'
################################################################
#### RFSIMULATOR : SyncRef UE --- Nearby UE ####
################################################################
### TX SyncRef UE ###
syncref_rfsim_net1_cmd = \
sudo -E RFSIMULATOR=server \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--sync-ref --rfsim --sl-mode 2 --rbsl 106 --SLC 3300000000 --ue-txgain 0 \
--rfsimulator.serverport 4048 --log_config.global_log_options time,nocolor \
> ~/syncref.log 2>&1
### RX Nearby UE ###
nearby_rfsim_net1_cmd = \
sudo -E RFSIMULATOR=127.0.0.1 \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--rfsim --sl-mode 2 --rbsl 106 --SLC 3300000000 --ue-rxgain 90 \
--rfsimulator.serverport 4048 --log_config.global_log_options time,nocolor \
> ~/nearby.log 2>&1
################################################################
#### RFSIMULATOR : SyncRef UE --- Relay UE --- Nearby UE ####
################################################################
### TX SyncRef UE ###
syncref_rfsim_net2_cmd = \
sudo -E RFSIMULATOR=127.0.0.1 \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--sync-ref --rfsim --sl-mode 2 --rbsl 52 --SLC 2600000000 --ue-txgain 0 --node-number 1 \
--rfsimulator.serverport 4048 --log_config.global_log_options time,nocolor \
> ~/syncref1.log 2>&1
### Relay UE ###
nearby_rfsim_net2_cmd = \
sudo -E RFSIMULATOR=server \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--rfsim --sl-mode 2 --rbsl 52 --SLC 2600000000 --ue-txgain 0 --ue-rxgain 90 --node-number 2 \
--rfsimulator.serverport 4048 --log_config.global_log_options time,nocolor \
> ~/nearby2.log 2>&1
### RX Nearby UE ###
nearby_rfsim_net2_cmd = \
sudo -E RFSIMULATOR=127.0.0.1 \
$HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem \
--rfsim --sl-mode 2 --rbsl 52 --SLC 2600000000 --ue-rxgain 90 --node-number 3 \
--rfsimulator.serverport 4048 --log_config.global_log_options time,nocolor \
> ~/nearby3.log 2>&1
{
"usrp": {
"net_0": [
{
"id": "",
"role": "syncref",
"ip": "",
"cmd": "sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sl-mode 2 --sync-ref --rbsl 52 --numerology 1 --band 38 --SLC 2600000000 --ue-txgain 0 --usrp-args type=b200,serial=3150384,clock_source=external --log_config.global_log_options time,nocolor > ~/syncref.log 2>&1"
},
{
"role": "nearby",
"id": "",
"ip": "10.1.1.61",
"cmd": "cd $HOME/openairinterface5g/ci-scripts; python3 sl_rx_agent.py --cmd \"sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sl-mode 2 --rbsl 52 --numerology 1 --band 38 --SLC 2600000000 --ue-rxgain 90 --usrp-args type=b200,serial=3150361,clock_source=external --log_config.global_log_options time,nocolor > ~/nearby.log 2>&1\""
}
],
"net_1": [
{
"role": "syncref",
"id": "",
"ip": "",
"cmd": "sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sl-mode 2 --sync-ref --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-txgain 0 --usrp-args type=n3xx,addr=192.168.10.2,subdev=A:0,master_clock_rate=122.88e6 --log_config.global_log_options time,nocolor > ~/syncref.log 2>&1"
},
{
"role": "nearby",
"id": "",
"ip": "10.1.1.80",
"cmd": "cd $HOME/openairinterface5g/ci-scripts; python3 sl_rx_agent.py --cmd \"sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sl-mode 2 --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-rxgain 75 --usrp-args type=n3xx,addr=192.168.10.2,subdev=A:0,master_clock_rate=122.88e6 --log_config.global_log_options time,nocolor > ~/nearby.log 2>&1\""
}
],
"net_2": [
{
"role": "syncref",
"id": "1",
"ip": "",
"cmd": "sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sl-mode 2 --sync-ref --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-txgain 0 --usrp-args type=n3xx,addr=192.168.10.2,subdev=A:0,master_clock_rate=122.88e6 --log_config.global_log_options time,nocolor --node-number 1 > ~/syncref1.log 2>&1"
},
{
"role": "nearby",
"id": "2",
"ip": "10.1.1.80",
"cmd": "cd $HOME/openairinterface5g/ci-scripts; python3 sl_rx_agent.py --cmd \"sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sl-mode 2 --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-txgain 0 --ue-rxgain 75 --usrp-args type=n3xx,addr=192.168.10.2,subdev=A:0,master_clock_rate=122.88e6 --log_config.global_log_options time,nocolor --node-number 2 > ~/nearby2.log 2>&1\""
},
{
"role": "nearby",
"id": "3",
"ip": "10.1.1.63",
"cmd": "cd $HOME/openairinterface5g/ci-scripts; python3 sl_rx_agent.py --cmd \"sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sl-mode 2 --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-rxgain 100 --usrp-args type=b200,serial=3150384,clock_source=external --log_config.global_log_options time,nocolor --node-number 3 > ~/nearby3.log 2>&1\""
}
],
"net_3": [
{
"role": "syncref",
"id": "1",
"ip": "",
"cmd": "sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sl-mode 2 --sync-ref --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-txgain 0 --usrp-args type=n3xx,addr=192.168.10.2,subdev=A:0,master_clock_rate=122.88e6 --log_config.global_log_options time,nocolor > ~/syncref.log 2>&1"
},
{
"role": "nearby",
"id": "3",
"ip": "10.1.1.63",
"cmd": "cd $HOME/openairinterface5g/ci-scripts; python3 sl_rx_agent.py --cmd \"sudo -E LD_LIBRARY_PATH=$HOME/openairinterface5g/cmake_targets/ran_build/build:$LD_LIBRARY_PATH $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sl-mode 2 --rbsl 52 --numerology 1 --band 78 --SLC 3600000000 --ue-rxgain 100 --usrp-args type=b200,serial=3150384,clock_source=external --log_config.global_log_options time,nocolor > ~/nearby.log 2>&1\""
}
]
},
"rfsim": {
"net_1": [
{
"role": "syncref",
"id": "",
"ip": "",
"cmd": "sudo -E RFSIMULATOR=server $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sync-ref --rfsim --sl-mode 2 --rbsl 106 --SLC 3300000000 --ue-txgain 0 --rfsimulator.serverport 4048 --log_config.global_log_options time,nocolor > ~/syncref.log 2>&1"
},
{
"role": "nearby",
"id": "",
"ip": "",
"cmd": "sudo -E RFSIMULATOR=127.0.0.1 $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --rfsim --sl-mode 2 --rbsl 106 --SLC 3300000000 --ue-rxgain 90 --rfsimulator.serverport 4048 --log_config.global_log_options time,nocolor > ~/nearby.log 2>&1"
}
],
"net_2": [
{
"role": "syncref",
"id": "1",
"ip": "",
"cmd": "sudo -E RFSIMULATOR=127.0.0.1 $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --sync-ref --rfsim --sl-mode 2 --rbsl 52 --SLC 2600000000 --ue-txgain 0 --node-number 1 --rfsimulator.serverport 4048 --log_config.global_log_options time,nocolor > ~/syncref1.log 2>&1"
},
{
"role": "nearby",
"id": "2",
"ip": "",
"cmd": "sudo -E RFSIMULATOR=server $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --rfsim --sl-mode 2 --rbsl 52 --SLC 2600000000 --ue-txgain 0 --ue-rxgain 90 --node-number 2 --rfsimulator.serverport 4048 --log_config.global_log_options time,nocolor > ~/nearby2.log 2>&1"
},
{
"role": "nearby",
"id": "3",
"ip": "",
"cmd": "sudo -E RFSIMULATOR=127.0.0.1 $HOME/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem --rfsim --sl-mode 2 --rbsl 52 --SLC 2600000000 --ue-rxgain 90 --node-number 3 --rfsimulator.serverport 4048 --log_config.global_log_options time,nocolor > ~/nearby3.log 2>&1"
}
]
}
}
...@@ -160,7 +160,7 @@ class TestNearby(): ...@@ -160,7 +160,7 @@ class TestNearby():
def __init__(self, cmd: str): def __init__(self, cmd: str):
self.cmd = cmd self.cmd = cmd
self.delay = 0 # seconds self.delay = 0 # seconds
self.id = self._get_id(cmd) self.id = self._get_id()
self.role = "nearby" self.role = "nearby"
self.log_file_path = os.path.join(OPTS.log_dir, f'{self.role}{self.id}.log') self.log_file_path = os.path.join(OPTS.log_dir, f'{self.role}{self.id}.log')
......
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