Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch job autotest dapp e3 params #8

Draft
wants to merge 7 commits into
base: batch-job-autotest-dapp
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions auto-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,13 @@ def run_gnb_test(args):
parser.add_argument('--timing_advance',
type=int,
help='Timing advance. Only used at UE-side. Overrides timing advance of base configuration')
parser.add_argument('--cores',
default='',
type=str,
help='Cores to force OAI gNB on, e.g., 0-45')
parser.add_argument('--tqsample', default=True, action='store_true', help='use 3/4 of sampling rate in USRP')
parser.add_argument('--flash', '-f', default=False, action='store_true')
parser.add_argument('--oai_extra_args', type=str, default='', help='Extra args to pass to OAI')
args = parser.parse_args()
args.f1_remote_node = '0.0.0.0'
args.if_freq = 0
Expand Down
8 changes: 5 additions & 3 deletions radio_api/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,25 @@ while IFS='=' read -r key value || [[ -n "$line" ]]; do
"timing_advance") timing_advance="$value" ;;
"start_dapp") start_dapp="$value" ;;
"dapp_args") dapp_args="$value" ;;
"oai_extra_args") oai_extra_args="$value" ;;
# Add more cases for other keys as needed
esac
fi
done < "$config_file"

script_cmd=""
if [ "$mode_type" == "gnb" ]; then
script_cmd="auto-test.py -T gnb"
script_cmd="auto-test.py -T gnb --cores 0-45"
if [ -z ${oai_extra_args+x} ]; then :; else script_cmd+=" --oai_extra_args="${oai_extra_args}; fi
elif [ "$mode_type" == "ue" ]; then
script_cmd="auto-test.py -T ue -t ${iperf_duration} --iperf_protocol ${iperf_protocol} -D ${dl_iperf_rate} -U ${ul_iperf_rate}"
if [ -z ${timing_advance+x} ]; then :; else script_cmd=${script_cmd}" --timing_advance ${timing_advance}"; fi
echo ${script_cmd}
# script_cmd="auto-test.py -T ue -t ${iperf_duration}"
elif [ "$mode_type" == "core" ]; then
script_cmd="auto-test.py -T core-nw"
else
echo "Invalid config file option ${mode_type}." >> /logs/run.log
exit 1
fi

echo ${script_cmd}

2 changes: 1 addition & 1 deletion radio_api/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ else
echo "[`date`] Command line ${script_cmd}" >> /logs/run.log

cd ${APP_DIR}
python3 ${APP_DIR}/${script_cmd}
eval "python3 ${APP_DIR}/${script_cmd}" 2> /logs/python_error.log
fi

exit 0
1 change: 1 addition & 0 deletions radio_api/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if [ "$mode_type" == "ue" ]; then
elif [ "$mode_type" == "gnb" ]; then
systemctl stop oai_ran.service
cp /root/last_log /logs/nr-gnb.log
cp /root/openairinterface5g/cmake_targets/ran_build/build/*.log /logs/ 2> /dev/null
elif [ "$mode_type" == "core" ]; then
systemctl stop oai_5gc.service
cp /root/iperf-core-server-ue-* /logs/
Expand Down
12 changes: 12 additions & 0 deletions ran.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ def __init__(self, args):
if args.timing_advance is not None:
self.conf["timing_advance"] = args.timing_advance

# get extra args
self.oai_extra_args = []
if self.args.oai_extra_args:
self.oai_extra_args = self.args.oai_extra_args.split(' ')

self.set_ips()
try:
os.remove('/root/last_log')
Expand Down Expand Up @@ -194,6 +199,8 @@ def run_gnb(self, type):
if self.args.gdb > 0:
# gdb override numa
pre_path += ['gdb', '--args']
if self.args.cores:
pre_path += ['taskset', '-ca', self.args.cores]
executable = [f'{OAI_PATH}cmake_targets/ran_build/build/nr-softmodem']
oai_args = ['-O', f'{self.config_file}', '--usrp-tx-thread-config', '1']
if self.prb >= 106 and self.numerology == 1:
Expand Down Expand Up @@ -229,8 +236,13 @@ def run_gnb(self, type):
oai_args += ['--T_stdout', '2',
'--gNBs.[0].do_SRS', '0']

# Add any additional extra args passed
if self.oai_extra_args:
oai_args += self.oai_extra_args

# Set F1 parameters
oai_args += f1_cmd_args

self.cmd_stored = pre_path + executable + oai_args
if self.execute:
command_to_run = f"""{' '.join(self.cmd_stored)} 2>&1 | tee ~/mylogs/gNB-$(date +"%m%d%H%M").log | tee ~/last_log"""
Expand Down