From: Cheoleun Moon Date: Tue, 22 Jan 2019 04:45:50 +0000 (+0900) Subject: [Network][Non-ACR][Remove unnecessary power-off of wifi] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0894b6eb33e19f76d661e8adb53ebc710662fb3;p=test%2Ftct%2Fcsharp%2Fapi.git [Network][Non-ACR][Remove unnecessary power-off of wifi] Change-Id: Id55c16ba12cabf8772a1ffc931d7a9f94e9b423f Signed-off-by: Cheoleun Moon --- diff --git a/tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiAP.cs b/tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiAP.cs index 7853b3f..89cb1d8 100755 --- a/tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiAP.cs +++ b/tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiAP.cs @@ -51,11 +51,6 @@ namespace Tizen.Network.WiFi.Tests await networkSetup.ConnectWiFi(networkParameter.wnPRIVATE, networkParameter.wType.wPrivate, networkParameter.wPASS); } - public async Task tearDown() - { - await networkSetup.DeactivateWiFi(); - } - [Test] [Category("P1")] [Description("Create a WiFi AP")] @@ -232,34 +227,31 @@ namespace Tizen.Network.WiFi.Tests WiFiAP _wifiAP2 = null; try { - /** - * PRE CONDITION - * turn off WiFi - * */ - if (WiFiManager.IsActive) - await tearDown(); + if (!WiFiManager.IsActive) + await WiFiManager.ActivateAsync(); + await networkSetup.ForgetCurrentAP(); - /** TEST CODE */ - await WiFiManager.ActivateAsync(); await WiFiManager.ScanAsync(); var list = WiFiManager.GetFoundAPs(); Log.Info(Globals.LogTag, "Got found aps"); - foreach (var item in list) + foreach (var ap in list) { - if (item.NetworkInformation.Essid == networkParameter.wnPUBLIC) + if (ap.NetworkInformation.Essid == networkParameter.wnPRIVATE) { - _wifiAP = item; + _wifiAP = ap; break; } } Assert.IsNotNull(_wifiAP, "Can't create a WiFi ap"); Log.Info(Globals.LogTag, "Try to Connect to " + _wifiAP.NetworkInformation.Essid.ToString()); + _wifiAP.SecurityInformation.SetPassphrase(networkParameter.wPASS); await _wifiAP.ConnectAsync(); _wifiAP2 = WiFiManager.GetConnectedAP(); Assert.IsNotNull(_wifiAP2, "No WiFi connection"); Assert.AreEqual(_wifiAP.NetworkInformation.Essid.ToString(), _wifiAP2.NetworkInformation.Essid.ToString(), "Can't connect to a WiFi"); Log.Info(Globals.LogTag, "Successfully done"); + // POSTCONDITION await setUp(); } @@ -583,9 +575,11 @@ namespace Tizen.Network.WiFi.Tests _wifiAP = WiFiManager.GetConnectedAP(); Assert.IsNotNull(_wifiAP, "No WiFi connection"); - await tearDown(); + await networkSetup.ForgetCurrentAP(); await _wifiAP.ForgetAPAsync(); Assert.IsTrue(false, "InvalidOperationException should be thrown"); + + await setUp(); } catch (NotSupportedException) { diff --git a/tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiManager.cs b/tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiManager.cs index feac077..15c272e 100755 --- a/tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiManager.cs +++ b/tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiManager.cs @@ -249,12 +249,11 @@ namespace Tizen.Network.WiFi.Tests * PRE CONDITION * turn off WiFi * */ - if (WiFiManager.IsActive) - await tearDown(); + if (!WiFiManager.IsActive) + await WiFiManager.ActivateAsync(); /** TEST CODE **/ var count = 0; - await WiFiManager.ActivateAsync(); await WiFiManager.ScanAsync(); var listApp = WiFiManager.GetFoundAPs(); foreach (var item in listApp)