From 2d46faaf13637401361eeb5ec15d90b66bd6bc59 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 29 Sep 2021 21:28:53 +0200 Subject: [PATCH] check mtu is as expected --- ci-scripts/ci_ueinfra.yaml | 3 ++- ci-scripts/cls_module_ue.py | 27 +++++++++++++++++++++++++++ ci-scripts/cls_oaicitest.py | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml index ccb03299c5..c8ba1fd042 100644 --- a/ci-scripts/ci_ueinfra.yaml +++ b/ci-scripts/ci_ueinfra.yaml @@ -24,7 +24,7 @@ nrmodule2_quectel: WakeupScript : ci_ctl_qtel.py /dev/ttyUSB7 wup DetachScript : ci_ctl_qtel.py /dev/ttyUSB7 detach LogStore : /media/ci_qlogs - PLMN : 20899 + PLMN : 20897 UENetwork : wwan1 HostIPAddress : 192.168.18.189 HostUsername : nrmodule2 @@ -32,6 +32,7 @@ nrmodule2_quectel: HostSourceCodePath : none StartCommands : - sudo -S ip link set dev wwan1 mtu 1500 + MTU : 1500 dummy: ID: '' State : '' diff --git a/ci-scripts/cls_module_ue.py b/ci-scripts/cls_module_ue.py index 96d4e0310e..3363a5fff5 100644 --- a/ci-scripts/cls_module_ue.py +++ b/ci-scripts/cls_module_ue.py @@ -131,6 +131,33 @@ class Module_UE: logging.debug('\u001B[1;37;41m Module IP Address Not Found! \u001B[0m') return -1 + def CheckModuleMTU(self): + HOST=self.HostUsername+'@'+self.HostIPAddress + response= [] + tentative = 3 + while (len(response)==0) and (tentative>0): + COMMAND="ip a show dev " + self.UENetwork + " | grep mtu" + logging.debug(COMMAND) + ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + response = ssh.stdout.readlines() + tentative-=1 + time.sleep(10) + if (tentative==0) and (len(response)==0): + logging.debug('\u001B[1;37;41m Module NIC MTU Not Found! Time expired \u001B[0m') + return -1 + else: #check response + result = re.search('mtu (?P[0-9]+)', response[0].decode("utf-8") ) + if result is not None: + if (result.group('mtu') is not None) and (result.group('mtu')==self.MTU) : + logging.debug('\u001B[1mUE Module NIC MTU is ' + self.MTU + ' as requested\u001B[0m') + return 0 + else: + logging.debug('\u001B[1;37;41m Incorrect Module NIC MTU ' + str(result.group('mtu')) + '! Expected : ' + str(self.MTU) + '\u001B[0m') + return -1 + else: + logging.debug('\u001B[1;37;41m Module NIC MTU Not Found! \u001B[0m') + return -1 + def EnableTrace(self): if self.ue_trace=="yes": mySSH = sshconnection.SSHConnection() diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 0b6ed88f85..bd5fd5bf0b 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -407,6 +407,8 @@ class OaiCiTest(): cmd = 'echo ' + EPC.Password + ' | ' + startcommand SSH.command(cmd,'\$',5) SSH.close() + #check that the MTU is as expected / requested + Module_UE.CheckModuleMTU() else: #status==-1 failed to retrieve IP address HTML.CreateHtmlTestRow('N/A', 'KO', CONST.UE_IP_ADDRESS_ISSUE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE)