From: Cheoleun Moon Date: Tue, 6 Aug 2019 09:03:07 +0000 (+0900) Subject: [WiFi][NonAcr][Try more specific scans due to possibility of temporary network issue] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ccf1dcb651ae50e9fee66c5f99a53f8fb4304087;p=test%2Ftct%2Fcsharp%2Fapi.git [WiFi][NonAcr][Try more specific scans due to possibility of temporary network issue] Change-Id: I1dd947e0d4ce770e971619402e3ba2d7b0bca846 Signed-off-by: Cheoleun Moon --- diff --git a/tct-suite-vs/Tizen.WiFi.Tests/testcase/TSWiFiManager.cs b/tct-suite-vs/Tizen.WiFi.Tests/testcase/TSWiFiManager.cs index 50b28e6..6b29c8b 100755 --- a/tct-suite-vs/Tizen.WiFi.Tests/testcase/TSWiFiManager.cs +++ b/tct-suite-vs/Tizen.WiFi.Tests/testcase/TSWiFiManager.cs @@ -740,15 +740,27 @@ namespace Tizen.Network.WiFi.Tests /* * TEST CODE */ - var count = 0; - await WiFiManager.ScanSpecificAPAsync(networkParameter.wnPRIVATE1); - var listAp = WiFiManager.GetFoundSpecificAPs(); - foreach (var item in listAp) + var found = false; + const int MAX_SCAN_TRY = 3; + for (int i = 0; i < MAX_SCAN_TRY; i++) { - count++; - item.Dispose(); + await WiFiManager.ScanSpecificAPAsync(networkParameter.wnPRIVATE1); + var listAp = WiFiManager.GetFoundSpecificAPs(); + foreach (WiFiAP item in listAp) + { + if (item.NetworkInformation.Essid == networkParameter.wnPRIVATE1) + { + found = true; + } + item.Dispose(); + } + if (found) + { + break; + } + await Task.Delay(1000); } - Assert.Greater(count, 0, "ScanSpecificApAsync can't scan WiFi private"); + Assert.IsTrue(found, "ScanSpecificApAsync can't scan WiFi private"); Log.Info(Globals.LogTag, "Successfully done"); } @@ -787,15 +799,27 @@ namespace Tizen.Network.WiFi.Tests * TEST CODE * Scan all HIDDEN APs which have name containing a given certain phrase. */ - var count = 0; - await WiFiManager.ScanSpecificAPAsync(networkParameter.wnHIDDEN); - var listAp = WiFiManager.GetFoundSpecificAPs(); - foreach (var item in listAp) + var found = false; + const int MAX_SCAN_TRY = 3; + for (int i = 0; i < MAX_SCAN_TRY; i++) { - count++; - item.Dispose(); + await WiFiManager.ScanSpecificAPAsync(networkParameter.wnHIDDEN); + var listAp = WiFiManager.GetFoundSpecificAPs(); + foreach (WiFiAP item in listAp) + { + if (item.NetworkInformation.Essid == networkParameter.wnHIDDEN) + { + found = true; + } + item.Dispose(); + } + if (found) + { + break; + } + await Task.Delay(1000); } - Assert.Greater(count, 0, "ScanSpecificApAsync can't scan WiFi HIDDEN"); + Assert.IsTrue(found, "ScanSpecificApAsync can't scan WiFi HIDDEN"); Log.Info(Globals.LogTag, "Successfully done"); }