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

Merge branch 'ci-more-details-start-stop-scripts' into 'master'

feat(ci): more details in the start/stop scripts for COTS-UE Test pipeline

See merge request oai/cn5g/oai-cn5g-fed!98
parents f4477e41 0c340812
No related branches found
No related tags found
1 merge request!98feat(ci): more details in the start/stop scripts for COTS-UE Test pipeline
...@@ -328,10 +328,22 @@ def detailsUeStopTest(runNb): ...@@ -328,10 +328,22 @@ def detailsUeStopTest(runNb):
detailsHtml += generate_list_footer() detailsHtml += generate_list_footer()
detailsHtml += generate_button_footer() detailsHtml += generate_button_footer()
return (False, detailsHtml) return (False, detailsHtml)
status = True
previousCmd = ''
errorIssues = ''
with open(os.path.join(cwd, f'archives/test-stop{runNb}.log'), 'r') as testRunLog:
for line in testRunLog:
if re.search('^---- ', line) is not None:
previousCmd = re.sub('^---- ', '', line.strip())
if re.search('error: operation failed:', line) is not None:
status = False
errorIssues += generate_list_row(f'This command returned an error: <pre><b>{previousCmd}</b></pre>', 'fire')
errorIssues += generate_list_row(line.strip(), 'remove-sign')
detailsHtml += errorIssues
detailsHtml += generate_list_row(f'More details in archives/test-stop{runNb}.log', 'info-sign') detailsHtml += generate_list_row(f'More details in archives/test-stop{runNb}.log', 'info-sign')
detailsHtml += generate_list_footer() detailsHtml += generate_list_footer()
detailsHtml += generate_button_footer() detailsHtml += generate_button_footer()
return (True, detailsHtml) return (status, detailsHtml)
if __name__ == '__main__': if __name__ == '__main__':
# Parse the arguments # Parse the arguments
......
...@@ -21,16 +21,24 @@ DEVICE=$(ls /dev/cdc*) ...@@ -21,16 +21,24 @@ DEVICE=$(ls /dev/cdc*)
echo "-------Setting up $INTERFACE for testing-------" echo "-------Setting up $INTERFACE for testing-------"
ifconfig $INTERFACE up ifconfig $INTERFACE up
if [[ -v DNN1 ]]; then echo "---- ip link add link wwan0 name ${INTERFACE}.1 type vlan id 1"; fi
if [[ -v DNN1 ]]; then ip link add link wwan0 name $INTERFACE.1 type vlan id 1; fi if [[ -v DNN1 ]]; then ip link add link wwan0 name $INTERFACE.1 type vlan id 1; fi
if [[ -v DNN1 ]]; then echo "---- ip link set ${INTERFACE}.1 up"; fi
if [[ -v DNN1 ]]; then ip link set $INTERFACE.1 up; fi if [[ -v DNN1 ]]; then ip link set $INTERFACE.1 up; fi
echo "---- mbimcli -p -d ${DEVICE} --set-radio-state=on"
mbimcli -p -d $DEVICE --set-radio-state=on mbimcli -p -d $DEVICE --set-radio-state=on
sleep 2 sleep 2
echo "---- mbimcli -p -d ${DEVICE} --attach-packet-service"
mbimcli -p -d $DEVICE --attach-packet-service mbimcli -p -d $DEVICE --attach-packet-service
echo "---- mbimcli -p -d ${DEVICE} --connect=session-id=0,apn=${DNN0},ip-type=${DNN_TYPE0}"
mbimcli -p -d $DEVICE --connect=session-id=0,apn=$DNN0,ip-type=$DNN_TYPE0 mbimcli -p -d $DEVICE --connect=session-id=0,apn=$DNN0,ip-type=$DNN_TYPE0
echo "---- ./mbim-set-ip.sh ${DEVICE} ${INTERFACE} 0"
./mbim-set-ip.sh $DEVICE $INTERFACE 0 ./mbim-set-ip.sh $DEVICE $INTERFACE 0
if [[ -v DNN1 ]]; then echo "---- mbimcli -p -d ${DEVICE} --connect=session-id=1,apn=${DNN1},ip-type=${DNN_TYPE1}"; fi
if [[ -v DNN1 ]]; then mbimcli -p -d $DEVICE --connect=session-id=1,apn=$DNN1,ip-type=$DNN_TYPE1; fi if [[ -v DNN1 ]]; then mbimcli -p -d $DEVICE --connect=session-id=1,apn=$DNN1,ip-type=$DNN_TYPE1; fi
if [[ -v DNN1 ]]; then echo "---- ./mbim-set-ip.sh ${DEVICE} ${INTERFACE}.1 1"; fi
if [[ -v DNN1 ]]; then ./mbim-set-ip.sh $DEVICE $INTERFACE.1 1; fi if [[ -v DNN1 ]]; then ./mbim-set-ip.sh $DEVICE $INTERFACE.1 1; fi
DNN0_IPADDRESS=$(ip -f inet addr show $INTERFACE | awk '/inet / {print $2}') DNN0_IPADDRESS=$(ip -f inet addr show $INTERFACE | awk '/inet / {print $2}')
......
...@@ -5,10 +5,15 @@ ...@@ -5,10 +5,15 @@
DEVICE=$(ls /dev/cdc*) DEVICE=$(ls /dev/cdc*)
INTERFACE=${INTERFACE:-wwan0} INTERFACE=${INTERFACE:-wwan0}
DNN1=ims DNN1=ims
echo "---- mbimcli -d ${DEVICE} -p --disconnect=0"
mbimcli -d $DEVICE -p --disconnect=0 mbimcli -d $DEVICE -p --disconnect=0
if [[ -v DNN1 ]]; then echo "---- mbimcli -d ${DEVICE} -p --disconnect=1"; fi
if [[ -v DNN1 ]]; then mbimcli -d $DEVICE -p --disconnect=1; fi if [[ -v DNN1 ]]; then mbimcli -d $DEVICE -p --disconnect=1; fi
if [[ -v DNN1 ]]; then echo "---- ip link set ${INTERFACE}.1 down"; fi
if [[ -v DNN1 ]]; then ip link set $INTERFACE.1 down; fi if [[ -v DNN1 ]]; then ip link set $INTERFACE.1 down; fi
if [[ -v DNN1 ]]; then echo "---- ip link del link wwan0 name ${INTERFACE}.1 type vlan id 1"; fi
if [[ -v DNN1 ]]; then ip link del link wwan0 name $INTERFACE.1 type vlan id 1; fi if [[ -v DNN1 ]]; then ip link del link wwan0 name $INTERFACE.1 type vlan id 1; fi
echo "---- mbimcli -p -d ${DEVICE} --set-radio-state=off"
mbimcli -p -d $DEVICE --set-radio-state=off mbimcli -p -d $DEVICE --set-radio-state=off
echo "-------Removing the $INTERFACE -------" echo "-------Removing the $INTERFACE -------"
......
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