Commit 5ae7e456 authored by hardy's avatar hardy

Merge remote-tracking branch 'origin/nr-ue-fix-ip-route' into integration_2021_wk35

parents 12b1cb8f 3bd6309e
......@@ -596,20 +596,6 @@ class Containerize():
else:
time.sleep(10)
# HACK TO REMOVE LATER WHEN FIX
res = re.search('oai-nr-ue', self.services[0])
if res is not None:
cmd = 'docker exec rfsim5g-oai-nr-ue /bin/bash -c "ip route del default"'
logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
cmd = 'docker exec rfsim5g-oai-nr-ue /bin/bash -c "ip route del 12.1.1.0/24"'
logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
cmd = 'docker exec rfsim5g-oai-nr-ue /bin/bash -c "ip route add default via 12.1.1.2 dev oaitun_ue1"'
logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
# END OF HACK TO REMOVE LATER WHEN FIX
if count == 100 and healthy == self.nb_healthy[0]:
HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK)
logging.info('\u001B[1m Deploying OAI Object(s) PASS\u001B[0m')
......@@ -628,7 +614,7 @@ class Containerize():
logging.debug(cmd)
subprocess.run(cmd, shell=True)
# if the containers are running, recover the logs!
# if the containers are running, recover the logs!
cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml ps --all'
logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
......@@ -831,7 +817,9 @@ class Containerize():
logging.debug('\u001B[1;34m Jitter : ' + jitter + '\u001B[0m')
self.IperfExit(HTML, iperfStatus, msg)
else:
iperfStatus = False
logging.error('problem?')
self.IperfExit(HTML, iperfStatus, 'problem?')
if iperfStatus:
logging.info('\u001B[1m Iperf Test PASS\u001B[0m')
......
<!--
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>rfsim-4glte</htmlTabRef>
<htmlTabName>Testing 4G LTE RF sim in containers</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
100011
000011
000001
000012
000002
000013
000001
000014
000002
020011
020012
030011
030012
100011
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000011">
<class>DeployGenObject</class>
<desc>Deploy Cassandra Database</desc>
<yaml_path>yaml_files/4g_rfsimulator</yaml_path>
<services>cassandra db_init</services>
<nb_healthy>1</nb_healthy>
</testCase>
<testCase id="000001">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>30</idle_sleep_time_in_sec>
</testCase>
<testCase id="000002">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>10</idle_sleep_time_in_sec>
</testCase>
<testCase id="000012">
<class>DeployGenObject</class>
<desc>Deploy OAI 4G CoreNetwork</desc>
<yaml_path>yaml_files/4g_rfsimulator</yaml_path>
<services>oai_hss oai_mme oai_spgwc oai_spgwu trf_gen</services>
<nb_healthy>6</nb_healthy>
</testCase>
<testCase id="000013">
<class>DeployGenObject</class>
<desc>Deploy OAI 4G eNB RF sim</desc>
<yaml_path>yaml_files/4g_rfsimulator</yaml_path>
<services>enb</services>
<nb_healthy>7</nb_healthy>
</testCase>
<testCase id="000014">
<class>DeployGenObject</class>
<desc>Deploy OAI 4G NR-UE RF sim</desc>
<yaml_path>yaml_files/4g_rfsimulator</yaml_path>
<services>oai_ue0</services>
<nb_healthy>8</nb_healthy>
</testCase>
<testCase id="020011">
<class>PingFromContainer</class>
<desc>Ping Traffic-Gen from LTE-UE</desc>
<container_name>rfsim4g-oai-lte-ue0</container_name>
<options>-I oaitun_ue1 -c 20 192.168.61.11</options>
<loss_threshold>5</loss_threshold>
</testCase>
<testCase id="020012">
<class>PingFromContainer</class>
<desc>Ping LTE-UE from Traffic-Gen</desc>
<container_name>rfsim4g-trf-gen</container_name>
<options>-c 20 12.0.0.2</options>
<loss_threshold>5</loss_threshold>
</testCase>
<testCase id="030011">
<class>IperfFromContainer</class>
<desc>Iperf UDP Downlink</desc>
<server_container_name>rfsim4g-oai-lte-ue0</server_container_name>
<client_container_name>rfsim4g-trf-gen</client_container_name>
<server_options>-B 12.0.0.2 -u -i 1 -s</server_options>
<client_options>-c 12.0.0.2 -u -i 1 -t 30 -b 2M</client_options>
</testCase>
<testCase id="030012">
<class>IperfFromContainer</class>
<desc>Iperf UDP Uplink</desc>
<server_container_name>rfsim4g-trf-gen</server_container_name>
<client_container_name>rfsim4g-oai-lte-ue0</client_container_name>
<server_options>-u -i 1 -s</server_options>
<client_options>-B 12.0.0.2 -c 192.168.61.11 -u -i 1 -t 30 -b 1M</client_options>
</testCase>
<testCase id="100011">
<class>UndeployGenObject</class>
<desc>Undeploy all OAI 4G stack</desc>
<yaml_path>yaml_files/4g_rfsimulator</yaml_path>
</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>rfsim-4glte-down</htmlTabRef>
<htmlTabName>CleanUp 4G RF</htmlTabName>
<htmlTabIcon>trash</htmlTabIcon>
<TestCaseRequestedList>
100011
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="100011">
<class>UndeployGenObject</class>
<desc>Undeploy all OAI 4G stack</desc>
<yaml_path>yaml_files/4g_rfsimulator</yaml_path>
</testCase>
</testCaseList>
......@@ -25,6 +25,7 @@
<htmlTabName>Testing 5G NR RF sim in containers</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
100001
000001
000002
000003
......
......@@ -218,34 +218,6 @@ oaitun_ue1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
```
**CAUTION: THESE NEXT FEW COMMANDS ARE A HACK. RAN developers SHALL FIX THIS!**
```bash
$ docker exec -it rfsim5g-oai-nr-ue /bin/bash
# Check the current routes
root@bb4d400a832d:/opt/oai-nr-ue# ip route
default via 192.168.71.129 dev eth0
12.1.1.0/24 dev oaitun_ue1 proto kernel scope link src 12.1.1.2
192.168.71.128/26 dev eth0 proto kernel scope link src 192.168.71.137
# Remove the default and PDN routes
root@bb4d400a832d:/opt/oai-nr-ue# ip route del default
root@bb4d400a832d:/opt/oai-nr-ue# ip route del 12.1.1.0/24
# Force the default route through oaitun_ue1 tunnel
root@bb4d400a832d:/opt/oai-nr-ue# ip route add default via 12.1.1.2 dev oaitun_ue1
# Check the new routes
root@bb4d400a832d:/opt/oai-nr-ue# ip route
default via 12.1.1.2 dev oaitun_ue1
192.168.71.128/26 dev eth0 proto kernel scope link src 192.168.71.137
```
# 3. Check traffic #
## 3.1. Check your Internet connectivity ##
......
......@@ -37,9 +37,7 @@ RUN /bin/sh oaienv && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP --verbose-ci
RUN yum install -y python3-pip && \
pip3 install --ignore-installed pyyaml && \
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_parameters.yaml && \
RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_parameters.yaml && \
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_sim_parameters.yaml
#start from scratch for target executable
......
......@@ -37,9 +37,7 @@ RUN /bin/sh oaienv && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP --verbose-ci
RUN apt-get install -y python3-pip && \
pip3 install --ignore-installed pyyaml && \
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_parameters.yaml && \
RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_parameters.yaml && \
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_sim_parameters.yaml
#start from scratch for target executable
......
......@@ -6,6 +6,7 @@ PREFIX=/opt/oai-enb
RRC_INACTIVITY_THRESHOLD=${RRC_INACTIVITY_THRESHOLD:-0}
ENABLE_MEASUREMENT_REPORTS=${ENABLE_MEASUREMENT_REPORTS:-no}
ENABLE_X2=${ENABLE_X2:-no}
THREAD_PARALLEL_CONFIG=${THREAD_PARALLEL_CONFIG:-PARALLEL_SINGLE_THREAD}
# Based another env var, pick one template to use
if [[ -v USE_FDD_CU ]]; then ln -s $PREFIX/etc/cu.fdd.conf $PREFIX/etc/enb.conf; fi
......
......@@ -98,6 +98,8 @@
env: "@NID_CELL@"
- key: N_RB_DL
env: "@NB_PRB@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- filePrefix: rru.fdd
outputfilename: "rru.fdd.conf"
......@@ -110,6 +112,8 @@
env: "@RRU_LOCAL_IP_ADDRESS@"
- key: bands
env: "@UTRA_BAND_ID@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- filePrefix: rru.tdd
outputfilename: "rru.tdd.conf"
......@@ -122,6 +126,8 @@
env: "@RRU_LOCAL_IP_ADDRESS@"
- key: bands
env: "@UTRA_BAND_ID@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- filePrefix: enb.band7.tm1.fr1.25PRB.usrpb210.conf
outputfilename: "enb.fdd.conf"
......@@ -171,6 +177,8 @@
env: "@FLEXRAN_INTERFACE_NAME@"
- key: FLEXRAN_IPV4_ADDRESS
env: "@FLEXRAN_IPV4_ADDRESS@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- filePrefix: enb.band40.tm1.25PRB.FairScheduler.usrpb210
outputfilename: "enb.tdd.conf"
......@@ -208,6 +216,8 @@
env: "@F1_CU_IP_ADDRESS@"
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@F1_CU_IP_ADDRESS@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- filePrefix: "rcc.band7.tm1.nfapi"
outputfilename: "rcc.nfapi.fdd.conf"
......@@ -251,6 +261,8 @@
env: "@F1_CU_IP_ADDRESS@"
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@F1_CU_IP_ADDRESS@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- filePrefix: "rcc.band7.tm1.if4p5.lo.25PRB"
outputfilename: "rcc.if4p5.fdd.conf"
......@@ -294,6 +306,8 @@
env: "@IF4P5_RRU_IP_ADDRESS@"
- key: local_address
env: "@IF4P5_RCC_IP_ADDRESS@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- filePrefix: "rcc.band40.tm1.25PRB"
outputfilename: "rcc.if4p5.tdd.conf"
......@@ -337,4 +351,6 @@
env: "@IF4P5_RRU_IP_ADDRESS@"
- key: local_address
env: "@IF4P5_RCC_IP_ADDRESS@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
......@@ -4,6 +4,7 @@ set -euo pipefail
PREFIX=/opt/oai-gnb
ENABLE_X2=${ENABLE_X2:-yes}
THREAD_PARALLEL_CONFIG=${THREAD_PARALLEL_CONFIG:-PARALLEL_SINGLE_THREAD}
# Based another env var, pick one template to use
if [[ -v USE_NSA_TDD_MONO ]]; then ln -s $PREFIX/etc/gnb.nsa.tdd.conf $PREFIX/etc/gnb.conf; fi
......
......@@ -61,6 +61,8 @@
env: "@FLEXRAN_INTERFACE_NAME@"
- key: FLEXRAN_IPV4_ADDRESS
env: "@FLEXRAN_IPV4_ADDRESS@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- filePrefix: gnb.band78.sa.fr1.106PRB.usrpn310.conf
outputfilename: "gnb.sa.tdd.conf"
......@@ -89,4 +91,6 @@
env: "@GNB_NGU_IF_NAME@"
- key: GNB_IPV4_ADDRESS_FOR_NGU
env: "@GNB_NGU_IP_ADDRESS@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
......@@ -344,6 +344,19 @@ int nas_config(int interface_id, int thirdOctet, int fourthOctet, char *ifname)
LOG_E(OIP,"Interface %s couldn't be configured (ip address %s, mask %s broadcast address %s)\n",
interfaceName, ipAddress, netMask, broadcastAddress);
int res;
char command_line[500];
res = sprintf(command_line,
"ip rule add from %s/32 table %d && "
"ip rule add to %s/32 table %d && "
"ip route add default dev %s%d table %d",
ipAddress, interface_id - 1 + 10000,
ipAddress, interface_id - 1 + 10000,
UE_NAS_USE_TUN ? "oaitun_ue" : "oip",
interface_id, interface_id - 1 + 10000);
background_system(command_line);
return returnValue;
}
......
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