[Network][Non-ACR][Do not deactivate Wi-Fi unnecessarily] 05/197405/9
authorCheoleun Moon <chleun.moon@samsung.com>
Fri, 11 Jan 2019 05:04:18 +0000 (14:04 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Tue, 15 Jan 2019 22:57:30 +0000 (07:57 +0900)
Change-Id: Ia94a02a095cbbc39266765e69cfcf25205fa31e9
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionManager.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionProfile.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionProfileManager.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionProfileStateEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionStateChangedEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionTypeEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSProfileStateEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSRssiLevelChangedEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiAP.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiManager.cs

index 53e256ab802d9704549824cd8ebc4d30fa22fec9..b51ddd0e721f6158e52897bc43256bb427fbaaad 100755 (executable)
@@ -813,17 +813,17 @@ namespace Tizen.Network.Connection.Tests
             WiFiAP _wifiAP = null;
             try
             {
-                await networkSetup.ConnectWiFi(networkParameter.wnPRIVATE, networkParameter.wType.wPrivate, networkParameter.wPASS);
+                await setUp();
                 ConnectionManager.ProxyAddressChanged += EventHandlerProxyAddressChanged;
                 _wifiAP = WiFiManager.GetConnectedAP();
                 Assert.IsNotNull(_wifiAP, "No WiFi connection");
                 _wifiAP.NetworkInformation.ProxyType = WiFiProxyType.Manual;
                 _wifiAP.NetworkInformation.ProxyAddress = "192.168.1.6:8080";
-                await Task.Delay(5000);
+                await Task.Delay(3000);
                 Log.Info(Globals.LogTag, "GetMacAddress=" + ConnectionManager.GetMacAddress(ConnectionType.WiFi));
                 Log.Info(Globals.LogTag, "GetIpAddress=" + ConnectionManager.GetIPAddress(AddressFamily.IPv4));
                 Log.Info(Globals.LogTag, "GetProxy=" + ConnectionManager.GetProxy(AddressFamily.IPv4));
-                await tearDown();
+                networkSetup.ForgetCurrentAP();
                 ConnectionManager.ProxyAddressChanged -= EventHandlerProxyAddressChanged;
                 // POSTCONDITION
                 await setUp();
index 3b48aae5a970c58c617a43b17d2c5bc845b45633..01b49693772b08fff01fbcd70b3efd960e3397c9 100755 (executable)
@@ -43,12 +43,6 @@ namespace Tizen.Network.Connection.Tests
             await Task.Delay(3000);
         }
 
-        public static async Task tearDown()
-        {
-            await networkSetup.DeactivateWiFi();
-            await Task.Delay(2000);
-        }
-
         [Test]
         [Category("P1")]
         [Description("get Id of a connection profile exist")]
@@ -342,7 +336,8 @@ namespace Tizen.Network.Connection.Tests
                  * turn on a Public WiFi
                  * */
                 await setUp();
-                /*TEST CODE */
+
+                /* TEST CODE */
                 _connectionProfile = ConnectionProfileManager.GetCurrentProfile();
                 Assert.IsNotNull(_connectionProfile);
                 Log.Info(Globals.LogTag, "GetCurrentProfile done");
@@ -363,7 +358,8 @@ namespace Tizen.Network.Connection.Tests
                 Assert.AreEqual(new IPAddress(BitConverter.GetBytes(preIP)).ToString(), addInfor.IP.ToString(), "set IP is fail");
                 Assert.AreEqual(IPConfigType.Static.ToString(), addInfor.IPConfigType.ToString(), "set IpConfigType is fail");
 
-                await tearDown();
+                /* POSTCONDITION */
+                networkSetup.ForgetCurrentAP();
                 await setUp();
                 Log.Info(Globals.LogTag, "Finished");
             }
@@ -406,7 +402,7 @@ namespace Tizen.Network.Connection.Tests
                  * */
                 await setUp();
 
-                /*TEST CODE */
+                /* TEST CODE */
                 _connectionProfile = ConnectionProfileManager.GetCurrentProfile();
                 Assert.IsNotNull(_connectionProfile);
                 var addInfor = _connectionProfile.IPv6Settings;
@@ -431,7 +427,8 @@ namespace Tizen.Network.Connection.Tests
                 Assert.IsTrue(found, "Can't find IPv6 ");
                 Assert.AreEqual(IPConfigType.Static.ToString(), addInfor.IPConfigType.ToString(), "set IpConfigType is fail");
 
-                await tearDown();
+                /* POSTCONDITION */
+                networkSetup.ForgetCurrentAP();
                 await setUp();
                 Log.Info(Globals.LogTag, "Finished");
             }
@@ -473,16 +470,16 @@ namespace Tizen.Network.Connection.Tests
                  * turn on a Public WiFi
                  * */
                 await setUp();
-                /*TEST CODE */
+
+                /* TEST CODE */
                 _connectionProfile = ConnectionProfileManager.GetCurrentProfile();
                 Assert.IsNotNull(_connectionProfile);
 
                 _connectionProfile.ProxyType = ProxyType.Manual;
                 Assert.AreEqual(ProxyType.Manual.ToString(), _connectionProfile.ProxyType.ToString(), "Set ProxyType is fail");
-                /**
-                 * POST CONDITION
-                 */
-                await tearDown();
+
+                 /* POSTCONDITION */
+                networkSetup.ForgetCurrentAP();
                 await setUp();
             }
             catch (NotSupportedException)
@@ -523,19 +520,18 @@ namespace Tizen.Network.Connection.Tests
                  * turn on a Public WiFi
                  * */
                 await setUp();
-                /*TEST CODE */
+
+                /* TEST CODE */
                 _connectionProfile = ConnectionProfileManager.GetCurrentProfile();
                 Assert.IsNotNull(_connectionProfile);
 
                 var proxy = "192.168.1.100";
                 _connectionProfile.ProxyAddress = proxy;
                 Assert.AreEqual(proxy, _connectionProfile.ProxyAddress.ToString(), "Set proxyAddress is fail");
-                /**
-                 * POST CONDITION
-                 */
-                await tearDown();
-                await setUp();
 
+                /* POSTCONDITION */
+                networkSetup.ForgetCurrentAP();
+                await setUp();
             }
             catch (NotSupportedException)
             {
index b3ffcae81521987726888a53696aa694271a8235..c2c48317aec58453005f8a93270cbc6da2084b28 100755 (executable)
@@ -206,11 +206,6 @@ namespace Tizen.Network.Tests
                     return;
                 }
 
-                if (isWiFiSupported && WiFiManager.IsActive)
-                {
-                    await networkSetup.DeactivateWiFi();
-                }
-
                 /* TEST CODE */
                 _currCP = ConnectionProfileManager.GetDefaultCellularProfile(CellularServiceType.MMS);
                 Assert.IsNotNull(_currCP, "Object should be not NULL");
index b99c84d2652b5a131ae5e61b7ec465be50bdc332..887dca66324d1b0f726c417c10aa4cba3ae0d61b 100755 (executable)
@@ -37,11 +37,6 @@ namespace Tizen.Network.Connection.Tests
             await networkSetup.ConnectWiFi(networkParameter.wnPRIVATE, networkParameter.wType.wPrivate, networkParameter.wPASS);
         }
 
-        public static async Task tearDown()
-        {
-            await networkSetup.DeactivateWiFi();
-        }
-
         public static void EventHandlerProfileStateChanged(object sender, EventArgs e)
         {
             _flag = true;
index 9d6da198d3b4df2b1e05e7a05492df332d47576e..61c9a1daef2ccb137eefc900240bfeb6717170f9 100755 (executable)
@@ -38,11 +38,6 @@ namespace Tizen.Network.WiFi.Tests
             await networkSetup.ConnectWiFi(networkParameter.wnPRIVATE, networkParameter.wType.wPrivate, networkParameter.wPASS);
         }
 
-        public static async Task tearDown()
-        {
-            await networkSetup.DeactivateWiFi();
-        }
-
         private static void EventHandlerConnectionStateChangedCBState(object sender, EventArgs e)
         {
             if (WiFiManager.ConnectionState.ToString() == ((ConnectionStateChangedEventArgs)e).State.ToString())
@@ -77,7 +72,7 @@ namespace Tizen.Network.WiFi.Tests
                  */
                 WiFiManager.ConnectionStateChanged += EventHandlerConnectionStateChangedCBState;
                 await Task.Delay(3000);
-                await tearDown();
+                networkSetup.ForgetCurrentAP();
                 await Task.Delay(3000);
                 Assert.IsTrue(_flag, "Flag should be true after checking");
 
@@ -121,8 +116,7 @@ namespace Tizen.Network.WiFi.Tests
                  */
                 await setUp();
                 _wifiAP1 = WiFiManager.GetConnectedAP();
-                if (WiFiManager.IsActive)
-                    await tearDown();
+                networkSetup.ForgetCurrentAP();
                 Assert.IsFalse(_flag, "Flag should be fail before checking");
 
                 /*
index 22d2d009f7b807aa29afa66ddd9fdebe12c152b2..6bff1ac6b92726ba985b530419ac25a295bf28a4 100755 (executable)
@@ -41,11 +41,6 @@ namespace Tizen.Network.Connection.Tests
             await networkSetup.ConnectWiFi(networkParameter.wnPRIVATE, networkParameter.wType.wPrivate, networkParameter.wPASS);
         }
 
-        public static async Task tearDown()
-        {
-            await networkSetup.DeactivateWiFi();
-        }
-
         [Test]
         [Category("P1")]
         [Description("Get State of Profile")]
@@ -75,7 +70,7 @@ namespace Tizen.Network.Connection.Tests
                     await setUp();
                     await Task.Delay(3000);
                     Log.Info(Globals.LogTag, "ConnectionType_GET ConnectionTypeChanged WiFi Connected");
-                    await tearDown();
+                    networkSetup.ForgetCurrentAP();
                     await Task.Delay(2000);
                     Log.Info(Globals.LogTag, "ConnectionType_GET ConnectionTypeChanged WiFi Disconnected");
                     Assert.IsTrue(_flag, "ConnectionType is not changed");
index f42032abbc3a18a7c67b4099df792a9442db662a..b9d8ff593182478d123a6bedfc59b9d13900bd43 100755 (executable)
@@ -39,12 +39,6 @@ namespace Tizen.Network.Connection.Tests
             await Task.Delay(3000);
         }
 
-        public static async Task tearDown()
-        {
-            await networkSetup.DeactivateWiFi();
-            await Task.Delay(2000);
-        }
-
         private static void EventHandlerProfileStateChangedCB(object sender, EventArgs e)
         {
             _flag = true;
@@ -85,7 +79,7 @@ namespace Tizen.Network.Connection.Tests
                 Assert.IsNotNull(_connectionProfile, "No Profile Found");
                 _connectionProfile.ProfileStateChanged += EventHandlerProfileStateChangedCB;
                 await Task.Delay(3000);
-                await tearDown();
+                networkSetup.ForgetCurrentAP();
                 Log.Info(Globals.LogTag, "ConnectionProfile3=" + _connectionProfile.GetState(AddressFamily.IPv4).ToString());
                 await Task.Delay(3000);
                 Log.Info(Globals.LogTag, "ConnectionProfile5=" + _connectionProfile.GetState(AddressFamily.IPv4).ToString());
index cfced5824750f76d2b2b8b2dc17e8a83d58efc27..ff7c928f6608bea873bf84d03add07bb35e288da 100755 (executable)
@@ -38,11 +38,6 @@ namespace Tizen.Network.WiFi.Tests
             await networkSetup.ConnectWiFi(networkParameter.wnPRIVATE, networkParameter.wType.wPrivate, networkParameter.wPASS);
         }
 
-        public static async Task tearDown()
-        {
-            await networkSetup.DeactivateWiFi();
-        }
-
         private static void EventHandlerRssiLevelChangedCB(object sender, EventArgs e)
         {
             _flag = true;
@@ -64,7 +59,7 @@ namespace Tizen.Network.WiFi.Tests
                  */
                 WiFiManager.RssiLevelChanged += EventHandlerRssiLevelChangedCB;
                 await Task.Delay(3000);
-                await tearDown();
+                networkSetup.ForgetCurrentAP();
                 await Task.Delay(3000);
                 await setUp();
                 await Task.Delay(3000);
index bb310819b5954e4ba9b9649311880adef9208bec..98bfe34587be156901d6e9f1f84b3628b7583151 100755 (executable)
@@ -46,7 +46,7 @@ namespace Tizen.Network.WiFi.Tests
             Log.Info(Globals.LogTag, "Postconditions for each TEST");
         }
 
-        public static async Task SetUp()
+        public static async Task setUp()
         {
             await networkSetup.ConnectWiFi(networkParameter.wnPRIVATE, networkParameter.wType.wPrivate, networkParameter.wPASS);
         }
@@ -184,7 +184,7 @@ namespace Tizen.Network.WiFi.Tests
                 /* Precondition
                  * Setup WiFi type public
                  * */
-                await SetUp();
+                await setUp();
 
                 /**
                  * TEST CODE
@@ -262,7 +262,7 @@ namespace Tizen.Network.WiFi.Tests
 
                 Log.Info(Globals.LogTag, "Successfully done");
                 // POSTCONDITION
-                await SetUp();
+                await setUp();
             }
             catch (NotSupportedException)
             {
@@ -304,7 +304,7 @@ namespace Tizen.Network.WiFi.Tests
                 /**
                  * PRE CONDITION
                  * */
-                await SetUp();
+                await setUp();
                 /** TEST CODE **/
                 Assert.AreEqual(WiFiConnectionState.Connected.ToString(), WiFiManager.ConnectionState.ToString(), "WiFi is not connected");
                 _wifiAP = WiFiManager.GetConnectedAP();
@@ -433,7 +433,7 @@ namespace Tizen.Network.WiFi.Tests
                 /*
                  * PRECONDITION
                  */
-                await SetUp();
+                await setUp();
 
                 /*
                  * TEST CODE
@@ -446,14 +446,8 @@ namespace Tizen.Network.WiFi.Tests
 
                 Log.Info(Globals.LogTag, "Successfully done");
 
-                /**
-                 * POSTCONDITION
-                 * Turn off WiFi
-                 * */
-                await WiFiManager.DeactivateAsync();
-                await Task.Delay(5000);
-                // POSTCONDITION
-                await SetUp();
+                /* POSTCONDITION */
+                await setUp();
             }
             catch (NotSupportedException)
             {
@@ -489,19 +483,19 @@ namespace Tizen.Network.WiFi.Tests
             try
             {
                 // PRECONDITION
-                await SetUp();
+                await setUp();
 
                 // TEST CODE
                 _wifiAP = WiFiManager.GetConnectedAP();
                 Assert.IsNotNull(_wifiAP, "No WiFi connection");
                 await _wifiAP.ForgetAPAsync();
-                Task.Delay(2000);
+                await Task.Delay(2000);
                 Assert.AreEqual(WiFiConnectionState.Disconnected.ToString(), WiFiManager.ConnectionState.ToString(), "ConnectionState of removed AP  should be is DISCONNECT");
 
                 Log.Info(Globals.LogTag, "Successfully done");
 
                 // POSTCONDITION
-                await SetUp();
+                await setUp();
             }
             catch (NotSupportedException)
             {
@@ -537,7 +531,7 @@ namespace Tizen.Network.WiFi.Tests
             try
             {
                 // PRECONDITION
-                await SetUp();
+                await setUp();
 
                 // TEST CODE
                 _wifiAP = WiFiManager.GetConnectedAP();
@@ -585,7 +579,7 @@ namespace Tizen.Network.WiFi.Tests
             try
             {
                 // PRECONDITION
-                await SetUp();
+                await setUp();
 
                 // TEST CODE
                 _wifiAP = WiFiManager.GetConnectedAP();
@@ -636,7 +630,7 @@ namespace Tizen.Network.WiFi.Tests
             try
             {
                 Log.Info(Globals.LogTag, "Update_UPDATE start");
-                await SetUp();
+                await setUp();
                 /* TEST CODE */
                 _wifiAP = WiFiManager.GetConnectedAP();
                 Assert.IsNotNull(_wifiAP, "No WiFi connection");
@@ -698,7 +692,7 @@ namespace Tizen.Network.WiFi.Tests
                 Assert.IsTrue(task.IsCanceled, "ConnectWpsWithoutSsidAsync() isn't cancelled");
 
                 // Postcondition
-                await SetUp();
+                await setUp();
             }
             catch (NotSupportedException)
             {
@@ -731,7 +725,7 @@ namespace Tizen.Network.WiFi.Tests
                 Assert.IsTrue(false, "InvalidOperationException must be thrown");
 
                 // Postcondition
-                await SetUp();
+                await setUp();
             }
             catch (InvalidOperationException ex)
             {
index f0cfa2e5dbe8ca11eb5d3c0f47b39e3ba3446a10..6cdbadaecf30747ed79268bd318cfa5028c8ad5e 100755 (executable)
@@ -294,20 +294,16 @@ namespace Tizen.Network.WiFi.Tests
         {
             try
             {
-                /**
-                 * PRE CONDITION
-                 * turn off WiFi
-                 * */
-                if (WiFiManager.IsActive)
-                    await tearDown();
-
                 /** TEST CODE **/
                 var count = 0;
-                await WiFiManager.ActivateAsync();
-                await Task.Delay(5000);
+                if (!WiFiManager.IsActive)
+                {
+                    await WiFiManager.ActivateAsync();
+                    await Task.Delay(3000);
+                }
                 await WiFiManager.ScanSpecificAPAsync(networkParameter.wnPRIVATE);
                 var listApp = WiFiManager.GetFoundSpecificAPs();
-                await Task.Delay(5000);
+                await Task.Delay(3000);
                 foreach (var item in listApp)
                     count++;
                 Assert.Greater(count, 0, "GetFoundSpecificAps is fail");
@@ -508,7 +504,7 @@ namespace Tizen.Network.WiFi.Tests
                 if (WiFiManager.IsActive)
                 {
                     Log.Info(Globals.LogTag, "WiFi is activated");
-                    await tearDown();
+                    networkSetup.ForgetCurrentAP();
                 }
                 await setUp();
                 Assert.True(_flag, "Event RssiLevelChanged hasn't been call.");
@@ -548,7 +544,7 @@ namespace Tizen.Network.WiFi.Tests
 
                 /** TEST CODE */
                 Assert.AreEqual((int)(WiFiConnectionState.Connected), (int)(WiFiManager.ConnectionState), "ConnectionState didn't return connected after connect to WiFiAp");
-                await tearDown();
+                networkSetup.ForgetCurrentAP();
                 Assert.AreEqual((int)(WiFiConnectionState.Disconnected), (int)(WiFiManager.ConnectionState), "ConnectionState didn't return disconnected after discnnect");
 
                 Log.Info(Globals.LogTag, "Successfully done");
@@ -819,7 +815,7 @@ namespace Tizen.Network.WiFi.Tests
                  * PRECONDITION
                  */
                 if (WiFiManager.IsActive)
-                    await tearDown();
+                    networkSetup.ForgetCurrentAP();
                 Assert.IsFalse(_flag, "Flag should be fail before checking");
 
                 /*