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

Merge branch 'ci-cots-ue-qtl-fixes' into 'master'

chore(ci): some little improvements to the COTS-UE test-bed (still only QTL)

See merge request !117
parents 03b3dfc4 d85c1072
No related branches found
No related tags found
1 merge request!117chore(ci): some little improvements to the COTS-UE test-bed (still only QTL)
......@@ -225,7 +225,11 @@ pipeline {
sh "docker image inspect --format='Date = {{.Created}}' ${ranFullImage} >> archives/oai-gnb-image-info.log"
sh "docker image inspect --format='Size = {{.Size}} bytes' ${ranFullImage} >> archives/oai-gnb-image-info.log"
sh "echo 'OC Pushed Tag is N/A' >> archives/oai-gnb-image-info.log"
stash includes: 'archives/oai-gnb-image-info.log', name: 'gNB_image'
stash allowEmpty: true, includes: 'archives/oai-gnb-image-info.log', name: 'gNB_image'
// Adding capture on SCTP and L2 port 9999
sh "sudo rm -f /tmp/oai-gnb-l2-trace.pcap /tmp/oai-gnb-l2-trace.logs"
sh 'nohup sudo tshark -i any -f "sctp or udp port 9999" -w /tmp/oai-gnb-l2-trace.pcap > /tmp/oai-gnb-l2-trace.logs 2>&1 &'
sleep 2
// Deploying now
dir ('ci-scripts/docker-compose/gnb-ci-testbed') {
sh "sed -i -e 's@image: oaisoftwarealliance/oai-gnb:develop@image: ${ranFullImage}@' docker-compose.yml"
......@@ -246,11 +250,16 @@ pipeline {
}
unsuccessful {
script {
sh "sudo pkill tshark || true"
sleep 2
sh "sudo chmod 666 /tmp/oai-gnb-l2-trace.* || true"
dir ('ci-scripts/docker-compose/gnb-ci-testbed') {
sh "docker-compose stop -t 3 || true"
sleep 2
sh "docker logs sa-b210-gnb > oai-gnb.logs 2>&1 || true"
stash includes: 'oai-gnb.logs', name: 'gNB_logs'
sh "cp /tmp/oai-gnb-l2-trace.* . || true"
sh "sudo rm -f /tmp/oai-gnb-l2-trace.*"
stash allowEmpty: true, includes: 'oai-gnb.logs, oai-gnb-l2-trace.*', name: 'gNB_logs'
sh "docker-compose down -t 3 || true"
}
deployedGNB = false
......@@ -279,6 +288,10 @@ pipeline {
echo "Test-Start #0 seems to have failed!"
testStart0 = false
}
if (testStart0) {
sh 'sudo traceroute -4 -T -i wwan0 openairinterface.org | tee /tmp/test-traffic0.log'
sh 'curl --interface wwan0 https://openairinterface.org/wp-content/uploads/2015/06/cropped-oai_final_logo.png -o /tmp/test-oai_final_logo.png'
}
try {
sh 'sudo bash -c "set -o pipefail && ./stop.sh 2>&1 | tee /tmp/test-stop0.log"'
} catch (Exception e) {
......@@ -300,10 +313,9 @@ pipeline {
}
}
sh 'sudo chmod 666 /tmp/test-st*.log'
sh 'cp /tmp/test-st*.log archives'
sh 'sudo rm /tmp/test-st*.log'
stash includes: 'archives/*.log', name: 'ue_logs'
// We will extend with other kinds of UE (smartphones, ...)
sh 'cp -f /tmp/test-*.log /tmp/test-*.png archives || true'
sh 'sudo rm -f /tmp/test-*.log /tmp/test-*.png || true'
stash allowEmpty: true, includes: 'archives/*.*', name: 'ue_logs'
}
}
}
......@@ -314,13 +326,18 @@ pipeline {
script {
echo '\u2705 \u001B[32mUndeploy gNB\u001B[0m'
if (deployedGNB) {
sh "sudo pkill tshark || true"
sleep 2
sh "sudo chmod 666 /tmp/oai-gnb-l2-trace.* || true"
dir ('ci-scripts/docker-compose/gnb-ci-testbed') {
ranFullImage = params.FULL_RAN_TAG
sh "sed -i -e 's@image: oaisoftwarealliance/oai-gnb:develop@image: ${ranFullImage}@' docker-compose.yml"
sh "docker-compose stop -t 3 || true"
sleep 2
sh "docker logs sa-b210-gnb > oai-gnb.logs 2>&1 || true"
stash includes: 'oai-gnb.logs', name: 'gNB_logs'
sh "cp /tmp/oai-gnb-l2-trace.* . || true"
sh "sudo rm -f /tmp/oai-gnb-l2-trace.*"
stash allowEmpty: true, includes: 'oai-gnb.logs, oai-gnb-l2-trace.*', name: 'gNB_logs'
sh "docker-compose down -t 3 || true"
}
deployedGNB = false
......
......@@ -7,6 +7,7 @@ metadata:
data:
routes.sh: |
#!/bin/sh
sleep 3
tun0_ip=$(ip -f inet addr show tun0 | awk '/inet / {print $2}' | awk -F '/' '{print $1}')
iptables -t nat -A POSTROUTING -o {{ .Values.config.n3If }} -s {{ .Values.config.netUeIp2 }} -j SNAT --to {{ .Values.multus.n3Ip }}
ip route add {{ .Values.config.netUeIp2 }} via $tun0_ip dev tun0
......
......@@ -26,6 +26,7 @@ import logging
import os
import re
import sys
import common.python.cls_cmd as cls_cmd
from common.python.generate_html import (
generate_header,
......@@ -344,6 +345,53 @@ def detailsUeStopTest(runNb):
detailsHtml += generate_button_footer()
return (status, detailsHtml)
def detailsUeTrafficTest(runNb):
detailsHtml = generate_button_header(f'ue-traffic{runNb}-details', f'Details on the UE traffic test #{runNb}')
detailsHtml += generate_list_header()
cwd = os.getcwd()
if not os.path.isfile(os.path.join(cwd, f'archives/test-traffic{runNb}.log')) or not os.path.isfile(os.path.join(cwd, f'archives/test-oai_final_logo.png')):
detailsHtml += generate_list_row(f'could not open archives/test-traffic{runNb}.log', 'question-sign')
detailsHtml += generate_list_footer()
detailsHtml += generate_button_footer()
return (False, detailsHtml)
status = True
# Checking the trace route message
cnt = 0
with open(os.path.join(cwd, f'archives/test-traffic{runNb}.log'), 'r') as testRunLog:
for line in testRunLog:
if re.search('12.1.1.1', line) is not None:
cnt += 1
detailsHtml += generate_list_row(line, 'forward')
if re.search('oaiocp-gw.oai.cs.eurecom.fr', line) is not None:
cnt += 1
detailsHtml += generate_list_row(line, 'forward')
if re.search('openairinterface.org', line) is not None and cnt > 0:
cnt += 1
detailsHtml += generate_list_row(line, 'forward')
if re.search('traceroute to openairinterface.org', line) is not None:
cnt += 1
detailsHtml += generate_list_row(line, 'info-sign')
if cnt != 4:
detailsHtml += generate_list_row('TraceRoute did NOT complete', 'question-sign')
status = False
else:
detailsHtml += generate_list_row('TraceRoute was complete', 'info-sign')
# Checking the OAI logo image
myCmds = cls_cmd.LocalCmd()
res = myCmds.run(f'file {cwd}/archives/test-oai_final_logo.png', silent=True)
if res.returncode != 0:
status = False
htmlMessage = re.sub(f'{cwd}/archives/test-oai_final_logo.png', 'archives/test-oai_final_logo.png', res.stdout)
if re.search('PNG image data, 800 x 267, 8-bit/color RGBA, non-interlaced', res.stdout) is None:
detailsHtml += generate_list_row(htmlMessage, 'thumbs-down')
status = False
else:
detailsHtml += generate_list_row(htmlMessage, 'thumbs-up')
myCmds.close()
detailsHtml += generate_list_footer()
detailsHtml += generate_button_footer()
return (status, detailsHtml)
if __name__ == '__main__':
# Parse the arguments
args = _parse_args()
......@@ -364,6 +412,7 @@ if __name__ == '__main__':
ueStart0Status = True
else:
ueStart0Status = False
(ueTraffic0Status, ueTrafficTest0) = detailsUeTrafficTest(0)
(ueStop0Status, ueStopTest0) = detailsUeStopTest(0)
if ueStop0Status and not args.ue_test0_stop_failed:
ueStop0Status = True
......@@ -389,6 +438,8 @@ if __name__ == '__main__':
wfile.write(ranDetails)
wfile.write(generate_chapter('First COTS-UE Connection', 'Registration / PDU session establishment / Ping Traffic status', ueStart0Status))
wfile.write(ueStartTest0)
wfile.write(generate_chapter('First COTS-UE Traffic Test', 'Traceroute / Curl', ueTraffic0Status))
wfile.write(ueTrafficTest0)
wfile.write(generate_chapter('First COTS-UE Deconnection', 'PDU Session release / Deregistration', ueStop0Status))
wfile.write(ueStopTest0)
wfile.write(generate_chapter('Second COTS-UE Connection', 'Registration / PDU session establishment / Ping Traffic status', ueStart1Status))
......
Subproject commit d18a067dcf7acb8a7075216f44d36174d77a7b65
Subproject commit b9ca1e67d3e4b4fee5075d90e98015698ab1f0a1
......@@ -59,6 +59,7 @@ echo $SESSION
echo "Requesting IPv4 and IPv6 information through mbimcli proxy:"
mbimcli -d $CONTROLDEV -p --query-ip-configuration
IPDATA=$(mbimcli -d $CONTROLDEV -p --query-ip-configuration=$SESSION)
UBUNTU_VERSION=`grep 'VERSION=' /etc/os-release`
function parse_ip {
# IP [0]: '10.134.203.177/30'
......@@ -200,7 +201,11 @@ if [[ "${#ipv4_addresses[@]}" > 0 ]]; then
printf "ip link set mtu $ipv4_mtu dev $DEV \n" >> $execfile
fi
if [[ "${#ipv4_dns[@]}" > 0 ]]; then
printf "systemd-resolve -4 --interface=$DEV --set-dns=%s\n" "${ipv4_dns[@]}" >>$execfile
if [[ $UBUNTU_VERSION =~ "Jammy" ]]; then
printf "resolvectl dns -4 $DEV %s\n" "${ipv4_dns[@]}" >>$execfile
else
printf "systemd-resolve -4 --interface=$DEV --set-dns=%s\n" "${ipv4_dns[@]}" >>$execfile
fi
fi
fi
......@@ -211,7 +216,11 @@ if [[ "${#ipv6_addresses[@]}" > 0 ]]; then
printf "ip -6 link set mtu $ipv6_mtu dev $DEV\n" >> $execfile
fi
if [[ "${#ipv6_dns[@]}" > 0 ]]; then
printf "systemd-resolve -6 --interface=$DEV --set-dns=%s\n" "${ipv6_dns[@]}" >>$execfile
if [[ $UBUNTU_VERSION =~ "Jammy" ]]; then
printf "resolvectl dns -6 $DEV %s\n" "${ipv6_dns[@]}" >>$execfile
else
printf "systemd-resolve -6 --interface=$DEV --set-dns=%s\n" "${ipv6_dns[@]}" >>$execfile
fi
fi
fi
echo "Applying the following network interface configurations:"
......
......@@ -10,7 +10,7 @@ services:
environment:
USE_B2XX: 'yes'
USE_VOLUMED_CONF: True
USE_ADDITIONAL_OPTIONS: --sa --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function
USE_ADDITIONAL_OPTIONS: --sa --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function --opt.type wireshark
volumes:
- /dev/bus/usb/:/dev/bus/usb/
- ./gnb-n77.conf:/opt/oai-gnb/etc/mounted.conf
......
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