mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1175057 - Fix the problem of the script timeout by ensuring it associates to the right ap. r=hchang
This commit is contained in:
parent
aaca3ac53b
commit
a1eaddd634
@ -776,7 +776,12 @@ let gTestSuite = (function() {
|
||||
.then(() => runEmulatorShellSafe(['hostapd', '-B', configFileName]))
|
||||
.then(function (reply) {
|
||||
// It may fail at the first time due to the previous ungracefully terminated one.
|
||||
if (reply[0] === 'bind(PF_UNIX): Address already in use') {
|
||||
if (reply.length === 0) {
|
||||
// The hostapd starts successfully
|
||||
return;
|
||||
}
|
||||
|
||||
if (reply[0].indexOf('bind(PF_UNIX): Address already in use') !== -1) {
|
||||
return startOneHostapd(aIndex);
|
||||
}
|
||||
});
|
||||
|
@ -14,6 +14,8 @@ const STATIC_IP_CONFIG = {
|
||||
dns2: "8.8.4.4",
|
||||
};
|
||||
|
||||
const TESTING_HOSTAPD = [{ ssid: 'ap0' }];
|
||||
|
||||
function testAssociateWithStaticIp(aNetwork, aStaticIpConfig) {
|
||||
return gTestSuite.setStaticIpMode(aNetwork, aStaticIpConfig)
|
||||
.then(() => gTestSuite.testAssociate(aNetwork))
|
||||
@ -32,10 +34,32 @@ function testAssociateWithStaticIp(aNetwork, aStaticIpConfig) {
|
||||
});
|
||||
}
|
||||
|
||||
function findDesireNetwork(aNetworks) {
|
||||
let i = gTestSuite.getFirstIndexBySsid(TESTING_HOSTAPD[0].ssid, aNetworks);
|
||||
|
||||
if (-1 !== i) {
|
||||
return aNetworks[i];
|
||||
}
|
||||
|
||||
return aNetworks[0];
|
||||
}
|
||||
|
||||
// Start test.
|
||||
gTestSuite.doTest(function() {
|
||||
gTestSuite.doTestWithoutStockAp(function() {
|
||||
return gTestSuite.ensureWifiEnabled(true)
|
||||
|
||||
// Start custom hostapd for testing.
|
||||
.then(() => gTestSuite.startHostapds(TESTING_HOSTAPD))
|
||||
.then(() => gTestSuite.verifyNumOfProcesses('hostapd',
|
||||
TESTING_HOSTAPD.length))
|
||||
|
||||
// Perform a wifi scan, and then run the static ip test
|
||||
.then(() => gTestSuite.requestWifiScan())
|
||||
.then((aNetworks) => testAssociateWithStaticIp(aNetworks[0],
|
||||
STATIC_IP_CONFIG));
|
||||
.then((aNetworks) => findDesireNetwork(aNetworks))
|
||||
.then((aNetwork) => testAssociateWithStaticIp(aNetwork,
|
||||
STATIC_IP_CONFIG))
|
||||
|
||||
// Kill running hostapd.
|
||||
.then(gTestSuite.killAllHostapd)
|
||||
.then(() => gTestSuite.verifyNumOfProcesses('hostapd', 0));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user