Skip to content
Snippets Groups Projects
Commit f4477e41 authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

Merge branch 'ci-increase-reg-test' into 'master'

feat(ci): testing 5000 registrations

See merge request oai/cn5g/oai-cn5g-fed!101
parents 2272a74b 25e7f76f
No related branches found
No related tags found
1 merge request!101feat(ci): testing 5000 registrations
...@@ -208,8 +208,9 @@ pipeline { ...@@ -208,8 +208,9 @@ pipeline {
sh './ci-scripts/silentCN5G-NF.py --docker-compose-file docker-compose/docker-compose-basic-nrf.yaml --amf-silent' sh './ci-scripts/silentCN5G-NF.py --docker-compose-file docker-compose/docker-compose-basic-nrf.yaml --amf-silent'
updateDockerCompose('docker-compose/docker-compose-basic-nrf.yaml', gnbsimTag) updateDockerCompose('docker-compose/docker-compose-basic-nrf.yaml', gnbsimTag)
dir ('docker-compose') { dir ('docker-compose') {
echo 'Adding 4000 Users to database' echo 'Adding 8000 Users to database'
sh '../ci-scripts/addUsersToDatabase.py --database-file database/oai_db2.sql --nb-users 4000' sh '../ci-scripts/addUsersToDatabase.py --database-file database/oai_db2.sql --nb-users 8000'
sh '../ci-scripts/increaseDnnRange.py --docker-compose-file docker-compose-basic-nrf.yaml --nb-users 8000'
sh 'docker-compose -f docker-compose-basic-nrf.yaml up -d mysql' sh 'docker-compose -f docker-compose-basic-nrf.yaml up -d mysql'
sleep 2 sleep 2
// No tshark: too big // No tshark: too big
...@@ -247,11 +248,11 @@ pipeline { ...@@ -247,11 +248,11 @@ pipeline {
steps { steps {
script { script {
dir ('ci-scripts/docker-compose/load-test-gnbsim') { dir ('ci-scripts/docker-compose/load-test-gnbsim') {
sh 'sed -i -e "s@TEST_REGISTER@True@" -e "s@NB_REGISTRATIONS@1000@" omec-gnbsim-config-*.yaml' sh 'sed -i -e "s@TEST_REGISTER@True@" -e "s@NB_REGISTRATIONS@1250@" omec-gnbsim-config-*.yaml'
sh 'sed -i -e "s@TEST_PDU_SESSION@False@" -e "s@NB_PDU_SESSIONS@10@" omec-gnbsim-config-*.yaml' sh 'sed -i -e "s@TEST_PDU_SESSION@False@" -e "s@NB_PDU_SESSIONS@10@" omec-gnbsim-config-*.yaml'
sh 'docker-compose -f docker-compose-omec-gnbsim.yaml up -d' sh 'docker-compose -f docker-compose-omec-gnbsim.yaml up -d'
// Test should be finished in 300 seconds // Test should be finished in 300 seconds
sh '../../checkOmecGnbsimStatus.py --timeout 300' sh '../../checkOmecGnbsimStatus.py --timeout 500'
} }
retrieveGnbsimLogs('archives/registration-test', 'ci-scripts/docker-compose/load-test-gnbsim') retrieveGnbsimLogs('archives/registration-test', 'ci-scripts/docker-compose/load-test-gnbsim')
dir ('ci-scripts/docker-compose/load-test-gnbsim') { dir ('ci-scripts/docker-compose/load-test-gnbsim') {
...@@ -299,13 +300,14 @@ pipeline { ...@@ -299,13 +300,14 @@ pipeline {
script { script {
updateDockerCompose('docker-compose/docker-compose-basic-nrf.yaml', gnbsimTag) updateDockerCompose('docker-compose/docker-compose-basic-nrf.yaml', gnbsimTag)
dir ('docker-compose') { dir ('docker-compose') {
echo 'Adding 4000 Users to database' echo 'Adding 8000 Users to database'
sh '../ci-scripts/addUsersToDatabase.py --database-file database/oai_db2.sql --nb-users 4000' sh '../ci-scripts/addUsersToDatabase.py --database-file database/oai_db2.sql --nb-users 8000'
sh '../ci-scripts/increaseDnnRange.py --docker-compose-file docker-compose-basic-nrf.yaml --nb-users 8000'
sh 'docker-compose -f docker-compose-basic-nrf.yaml up -d mysql' sh 'docker-compose -f docker-compose-basic-nrf.yaml up -d mysql'
sleep 2 sleep 2
sh 'sudo rm -f /tmp/oai-cn5g-load-test.*' sh 'sudo rm -f /tmp/oai-cn5g-load-test.*'
if (doTsharkCapturePDUSession) { if (doTsharkCapturePDUSession) {
sh 'nohup sudo tshark -i demo-oai -f "sctp or port 80 or port 8080 or port 8805 or icmp or port 3306" -w /tmp/oai-cn5g-load-test.pcap > /tmp/oai-cn5g-load-test.log 2>&1 &' sh 'nohup sudo tshark -i demo-oai -f "sctp or port 80 or port 8080 or port 8805 or icmp or port 3306 or port 2152" -w /tmp/oai-cn5g-load-test.pcap > /tmp/oai-cn5g-load-test.log 2>&1 &'
sh '../ci-scripts/checkTsharkCapture.py --log_file /tmp/oai-cn5g-load-test.log --timeout 30' sh '../ci-scripts/checkTsharkCapture.py --log_file /tmp/oai-cn5g-load-test.log --timeout 30'
sh 'sudo chmod 666 /tmp/oai-cn5g-load-test.*' sh 'sudo chmod 666 /tmp/oai-cn5g-load-test.*'
} }
...@@ -340,8 +342,9 @@ pipeline { ...@@ -340,8 +342,9 @@ pipeline {
sh 'sed -i -e "s@TEST_REGISTER@False@" -e "s@NB_REGISTRATIONS@10@" omec-gnbsim-config-*.yaml' sh 'sed -i -e "s@TEST_REGISTER@False@" -e "s@NB_REGISTRATIONS@10@" omec-gnbsim-config-*.yaml'
sh 'sed -i -e "s@TEST_PDU_SESSION@True@" -e "s@NB_PDU_SESSIONS@150@" omec-gnbsim-config-*.yaml' sh 'sed -i -e "s@TEST_PDU_SESSION@True@" -e "s@NB_PDU_SESSIONS@150@" omec-gnbsim-config-*.yaml'
sh 'docker-compose -f docker-compose-omec-gnbsim.yaml up -d' sh 'docker-compose -f docker-compose-omec-gnbsim.yaml up -d'
// Test should fail in less than 60 seconds // One UE takes 3.7 seconds to finish (3 seconds for the traffic test)
sh '../../checkOmecGnbsimStatus.py --timeout 120 || true' // 150 UE x 3.7 = 555 seconds
sh '../../checkOmecGnbsimStatus.py --timeout 600 || true'
} }
retrieveGnbsimLogs('archives/pdu-sess-est-test', 'ci-scripts/docker-compose/load-test-gnbsim') retrieveGnbsimLogs('archives/pdu-sess-est-test', 'ci-scripts/docker-compose/load-test-gnbsim')
dir ('ci-scripts/docker-compose/load-test-gnbsim') { dir ('ci-scripts/docker-compose/load-test-gnbsim') {
...@@ -389,8 +392,9 @@ pipeline { ...@@ -389,8 +392,9 @@ pipeline {
script { script {
updateDockerCompose('docker-compose/docker-compose-basic-nrf-http2.yaml', gnbsimTag) updateDockerCompose('docker-compose/docker-compose-basic-nrf-http2.yaml', gnbsimTag)
dir ('docker-compose') { dir ('docker-compose') {
echo 'Adding 4000 Users to database' echo 'Adding 8000 Users to database'
sh '../ci-scripts/addUsersToDatabase.py --database-file database/oai_db2.sql --nb-users 4000' sh '../ci-scripts/addUsersToDatabase.py --database-file database/oai_db2.sql --nb-users 8000'
sh '../ci-scripts/increaseDnnRange.py --docker-compose-file docker-compose-basic-nrf.yaml --nb-users 8000'
sh 'docker-compose -f docker-compose-basic-nrf-http2.yaml up -d mysql' sh 'docker-compose -f docker-compose-basic-nrf-http2.yaml up -d mysql'
sleep 2 sleep 2
sh 'sudo rm -f /tmp/oai-cn5g-load-test.*' sh 'sudo rm -f /tmp/oai-cn5g-load-test.*'
......
...@@ -52,7 +52,7 @@ configuration: ...@@ -52,7 +52,7 @@ configuration:
profileName: profile1-1 # uniqely identifies a profile within application profileName: profile1-1 # uniqely identifies a profile within application
enable: TEST_REGISTER # Set true to execute the profile, false otherwise. enable: TEST_REGISTER # Set true to execute the profile, false otherwise.
gnbName: gnb1 # gNB to be used for this profile gnbName: gnb1 # gNB to be used for this profile
startImsi: 208950000001125 startImsi: 208950000002125
ueCount: NB_REGISTRATIONS ueCount: NB_REGISTRATIONS
defaultAs: "192.168.70.135" #default icmp pkt destination defaultAs: "192.168.70.135" #default icmp pkt destination
opc: "63bfa50ee6523365ff14c1f45f88737d" opc: "63bfa50ee6523365ff14c1f45f88737d"
...@@ -69,7 +69,7 @@ configuration: ...@@ -69,7 +69,7 @@ configuration:
profileName: profile2-1 # uniqely identifies a profile within application profileName: profile2-1 # uniqely identifies a profile within application
enable: TEST_PDU_SESSION # Set true to execute the profile, false otherwise. enable: TEST_PDU_SESSION # Set true to execute the profile, false otherwise.
gnbName: gnb1 # gNB to be used for this profile gnbName: gnb1 # gNB to be used for this profile
startImsi: 208950000001125 # First IMSI. Subsequent values will be used if ueCount is more than 1 startImsi: 208950000002125 # First IMSI. Subsequent values will be used if ueCount is more than 1
ueCount: NB_PDU_SESSIONS # Number of UEs for for which the profile will be executed ueCount: NB_PDU_SESSIONS # Number of UEs for for which the profile will be executed
defaultAs: "192.168.70.135" #default icmp pkt destination defaultAs: "192.168.70.135" #default icmp pkt destination
opc: "63bfa50ee6523365ff14c1f45f88737d" opc: "63bfa50ee6523365ff14c1f45f88737d"
......
...@@ -52,7 +52,7 @@ configuration: ...@@ -52,7 +52,7 @@ configuration:
profileName: profile1-2 # uniqely identifies a profile within application profileName: profile1-2 # uniqely identifies a profile within application
enable: TEST_REGISTER # Set true to execute the profile, false otherwise. enable: TEST_REGISTER # Set true to execute the profile, false otherwise.
gnbName: gnb2 # gNB to be used for this profile gnbName: gnb2 # gNB to be used for this profile
startImsi: 208950000002125 startImsi: 208950000004125
ueCount: NB_REGISTRATIONS ueCount: NB_REGISTRATIONS
defaultAs: "192.168.70.135" #default icmp pkt destination defaultAs: "192.168.70.135" #default icmp pkt destination
opc: "63bfa50ee6523365ff14c1f45f88737d" opc: "63bfa50ee6523365ff14c1f45f88737d"
...@@ -69,7 +69,7 @@ configuration: ...@@ -69,7 +69,7 @@ configuration:
profileName: profile2-2 # uniqely identifies a profile within application profileName: profile2-2 # uniqely identifies a profile within application
enable: TEST_PDU_SESSION # Set true to execute the profile, false otherwise. enable: TEST_PDU_SESSION # Set true to execute the profile, false otherwise.
gnbName: gnb2 # gNB to be used for this profile gnbName: gnb2 # gNB to be used for this profile
startImsi: 208950000002125 # First IMSI. Subsequent values will be used if ueCount is more than 1 startImsi: 208950000004125 # First IMSI. Subsequent values will be used if ueCount is more than 1
ueCount: NB_PDU_SESSIONS # Number of UEs for for which the profile will be executed ueCount: NB_PDU_SESSIONS # Number of UEs for for which the profile will be executed
defaultAs: "192.168.70.135" #default icmp pkt destination defaultAs: "192.168.70.135" #default icmp pkt destination
opc: "63bfa50ee6523365ff14c1f45f88737d" opc: "63bfa50ee6523365ff14c1f45f88737d"
......
...@@ -52,7 +52,7 @@ configuration: ...@@ -52,7 +52,7 @@ configuration:
profileName: profile1-3 # uniqely identifies a profile within application profileName: profile1-3 # uniqely identifies a profile within application
enable: TEST_REGISTER # Set true to execute the profile, false otherwise. enable: TEST_REGISTER # Set true to execute the profile, false otherwise.
gnbName: gnb3 # gNB to be used for this profile gnbName: gnb3 # gNB to be used for this profile
startImsi: 208950000003125 startImsi: 208950000006125
ueCount: NB_REGISTRATIONS ueCount: NB_REGISTRATIONS
defaultAs: "192.168.70.135" #default icmp pkt destination defaultAs: "192.168.70.135" #default icmp pkt destination
opc: "63bfa50ee6523365ff14c1f45f88737d" opc: "63bfa50ee6523365ff14c1f45f88737d"
...@@ -69,7 +69,7 @@ configuration: ...@@ -69,7 +69,7 @@ configuration:
profileName: profile2-3 # uniqely identifies a profile within application profileName: profile2-3 # uniqely identifies a profile within application
enable: TEST_PDU_SESSION # Set true to execute the profile, false otherwise. enable: TEST_PDU_SESSION # Set true to execute the profile, false otherwise.
gnbName: gnb3 # gNB to be used for this profile gnbName: gnb3 # gNB to be used for this profile
startImsi: 208950000003125 # First IMSI. Subsequent values will be used if ueCount is more than 1 startImsi: 208950000006125 # First IMSI. Subsequent values will be used if ueCount is more than 1
ueCount: NB_PDU_SESSIONS # Number of UEs for for which the profile will be executed ueCount: NB_PDU_SESSIONS # Number of UEs for for which the profile will be executed
defaultAs: "192.168.70.135" #default icmp pkt destination defaultAs: "192.168.70.135" #default icmp pkt destination
opc: "63bfa50ee6523365ff14c1f45f88737d" opc: "63bfa50ee6523365ff14c1f45f88737d"
......
#!/usr/bin/env python3
"""
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
---------------------------------------------------------------------
"""
import argparse
import logging
import os
import re
import sys
logging.basicConfig(
level=logging.DEBUG,
stream=sys.stdout,
format="[%(asctime)s] %(levelname)8s: %(message)s"
)
def _parse_args() -> argparse.Namespace:
"""Parse the command line args
Returns:
argparse.Namespace: the created parser
"""
example_text = '''example:
./ci-scripts/increaseDnnRange.py --help
./ci-scripts/increaseDnnRange.py docker-compose-file DC_FILENAME --nb-users NB_USERS_TO_ADD'''
parser = argparse.ArgumentParser(description='OAI 5G CORE NETWORK Utility tool',
epilog=example_text,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument(
'--docker-compose-file', '-dcf',
action='store',
help='Docker-compose File to modify',
)
parser.add_argument(
'--nb-users', '-n',
action='store',
type=int,
default=30,
help='Number of Users to add',
)
return parser.parse_args()
if __name__ == '__main__':
# Parse the arguments
args = _parse_args()
cwd = os.getcwd()
if not os.path.isfile(os.path.join(cwd, args.docker_compose_file)):
logging.error(f'{args.docker_compose_file} does not exist')
sys.exit(-1)
endingIP = '12.1.1.50'
cicdrSuffix = '24'
if args.nb_users < 1023:
endingIP = '12.1.3.254'
cicdrSuffix = '22'
elif args.nb_users < 2047:
endingIP = '12.1.7.254'
cicdrSuffix = '21'
elif args.nb_users < 4095:
endingIP = '12.1.15.254'
cicdrSuffix = '20'
elif args.nb_users < 8191:
endingIP = '12.1.31.254'
cicdrSuffix = '19'
elif args.nb_users < 16383:
endingIP = '12.1.63.254'
cicdrSuffix = '18'
lines = ''
with open(os.path.join(cwd, args.docker_compose_file), 'r') as rfile:
for line in rfile:
if (re.search('DNN_RANGE0=12', line) is not None) or (re.search('DNN_RANGE1=12', line) is not None):
lines += re.sub('12', '13', line)
elif (re.search('DNN_RANGE2=12', line) is not None):
lines += re.sub('12.1.1.50', f'{endingIP}', line)
elif (re.search('NETWORK_UE_IP=12.1.1.0/24', line) is not None):
lines += re.sub('12.1.1.0/24', f'12.1.1.0/{cicdrSuffix}', line)
elif (re.search('ip route add 12.1.1.0/24', line) is not None):
lines += re.sub('12.1.1.0/24', f'12.1.1.0/{cicdrSuffix}', line)
else:
lines += line
with open(os.path.join(cwd, args.docker_compose_file), 'w') as wfile:
wfile.write(lines)
sys.exit(0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment