From 24b46f3f020ca5f59033199b1a38fd0bbc26294d Mon Sep 17 00:00:00 2001
From: Raphael Defosseux <raphael.defosseux@eurecom.fr>
Date: Fri, 19 Apr 2019 12:17:02 +0200
Subject: [PATCH] CI: running the RRC Inactivity Timer scenarion first once
 without flexran controller

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
---
 .../enb.band7.tm1.25PRB.usrpb210.conf         |  2 +-
 ci-scripts/main.py                            |  5 +-
 .../enb_usrp210_band7_test_05mhz_tm1.xml      | 51 +++++++++++++++++--
 3 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
index f7ca1ef0b60..c8951519819 100644
--- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
@@ -243,7 +243,7 @@ THREAD_STRUCT = (
 
 NETWORK_CONTROLLER :
 {
-    FLEXRAN_ENABLED        = "yes";
+    FLEXRAN_ENABLED        = "no";
     FLEXRAN_INTERFACE_NAME = "eth0";
     FLEXRAN_IPV4_ADDRESS   = "CI_MME_IP_ADDR";
     FLEXRAN_PORT           = 2210;
diff --git a/ci-scripts/main.py b/ci-scripts/main.py
index ab2ffc66067..89c022e7725 100644
--- a/ci-scripts/main.py
+++ b/ci-scripts/main.py
@@ -535,7 +535,9 @@ class SSHConnection():
 		self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5)
 		self.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2);
 		self.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2);
-		if self.flexranCtrlInstalled == False or self.flexranCtrlStarted == False:
+		if self.flexranCtrlInstalled and self.flexranCtrlStarted:
+			self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED        = "yes";/\' ' + ci_full_config_file, '\$', 2);
+		else:
 			self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED        = "no";/\' ' + ci_full_config_file, '\$', 2);
 		# Launch eNB with the modified config file
 		self.command('source oaienv', '\$', 5)
@@ -1281,6 +1283,7 @@ class SSHConnection():
 				htmlOptions = 'N/A'
 			self.close()
 		else:
+			passStatus = True
 			htmlOptions = 'N/A'
 
 		if (status_queue.empty()):
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml
index 63b96d77448..c9dd913309c 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml
@@ -27,8 +27,9 @@
 	<TestCaseRequestedList>
  040101
  030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201
- 050102
  030102 000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 030201
+ 050102
+ 030102 000020 040301 040504 000021 040302 000001 000022 040303 000002 040504 000023 040401 040201 030201
  050202
 	</TestCaseRequestedList>
 	<TestCaseExclusionList></TestCaseExclusionList>
@@ -41,8 +42,8 @@
 
         <testCase id="000002">
                 <class>IdleSleep</class>
-                <desc>Waiting for 5 seconds</desc>
-                <idle_sleep_time_in_sec>5</idle_sleep_time_in_sec>
+                <desc>Waiting for 10 seconds</desc>
+                <idle_sleep_time_in_sec>10</idle_sleep_time_in_sec>
         </testCase>
 
         <testCase id="000010">
@@ -69,6 +70,30 @@
 		<expectedNbOfConnectedUEs>2</expectedNbOfConnectedUEs>
         </testCase>
 
+        <testCase id="000020">
+                <class>CheckStatusUE</class>
+                <desc>Check UE(s) status before attachment</desc>
+		<expectedNbOfConnectedUEs>0</expectedNbOfConnectedUEs>
+        </testCase>
+
+        <testCase id="000021">
+                <class>CheckStatusUE</class>
+                <desc>Check UE(s) status before data disabling</desc>
+		<expectedNbOfConnectedUEs>2</expectedNbOfConnectedUEs>
+        </testCase>
+
+        <testCase id="000022">
+                <class>CheckStatusUE</class>
+                <desc>Check UE(s) status after data disabling</desc>
+		<expectedNbOfConnectedUEs>0</expectedNbOfConnectedUEs>
+        </testCase>
+
+        <testCase id="000023">
+                <class>CheckStatusUE</class>
+                <desc>Check UE(s) status after data re-enabling</desc>
+		<expectedNbOfConnectedUEs>2</expectedNbOfConnectedUEs>
+        </testCase>
+
         <testCase id="050102">
                 <class>Initialize_FlexranCtrl</class>
                 <desc>Starting Flexran Controller</desc>
@@ -91,6 +116,12 @@
 		<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args>
 	</testCase>
 
+	<testCase id="030103">
+		<class>Initialize_eNB</class>
+		<desc>Initialize eNB (FDD/Band7/5MHz)</desc>
+		<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args>
+	</testCase>
+
 	<testCase id="030201">
 		<class>Terminate_eNB</class>
 		<desc>Terminate eNB</desc>
@@ -147,6 +178,20 @@
                 <ping_packetloss_threshold>5</ping_packetloss_threshold>
         </testCase>
 
+        <testCase id="040504">
+                <class>Ping</class>
+                <desc>ping (5MHz - 20 sec)</desc>
+                <ping_args>-c 20</ping_args>
+                <ping_packetloss_threshold>5</ping_packetloss_threshold>
+        </testCase>
+
+        <testCase id="040505">
+                <class>Ping</class>
+                <desc>ping (5MHz - 20 sec)</desc>
+                <ping_args>-c 20</ping_args>
+                <ping_packetloss_threshold>5</ping_packetloss_threshold>
+        </testCase>
+
         <testCase id="040603">
 		<class>Iperf</class>
 		<desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile)</desc>
-- 
GitLab