src/connectivity/wlan/drivers/third_party/broadcom/brcmfmac/sim/test/timeout_test.cc
// This test case will verify the following senerio: After the driver issuing a connect command to
// firmware, sme sends a deauth_req to driver before firmware response, and sme issue a scan after
// that, the scan will be successfully executed.
This test case will verify the following senerio: After the driver issuing a connect command to
firmware, sme sends a deauth_req to driver before firmware response, and sme issue a scan after
that, the scan will be successfully executed.
This test case will verify the following senerio : After the driver issuing a connect command to firmware sme sends a deauth_req to driver before firmware response and sme issue a scan after that the scan will be successfully executed .
TEST_F(TimeoutTest, ScanAfterAssocTimeout) {
  Init();
  simulation::FakeAp ap(env_.get(), kDefaultBssid, kDefaultSsid, kDefaultChannel);
  ap.EnableBeacon(kBeaconInterval);
  brcmf_simdev* sim = device_->GetSim();
  sim->sim_fw->err_inj_.AddErrInjCmd(BRCMF_C_SET_SSID, ZX_OK, client_ifc_.iface_id_);
  client_ifc_.AssociateWith(ap, zx::msec(10));
  SCHEDULE_CALL(zx::sec(1), &SimInterface::DeauthenticateFrom, &client_ifc_, kDefaultBssid,
                WLAN_DEAUTH_REASON_UNSPECIFIED);
  SCHEDULE_CALL(zx::sec(3), &SimInterface::StartScan, &client_ifc_, kDefaultScanTxnId, false);
  env_->Run(kTestDuration);
  EXPECT_EQ(client_ifc_.stats_.assoc_results.size(), 0U);
  EXPECT_EQ(client_ifc_.stats_.deauth_results.size(), 1U);
  auto result = client_ifc_.ScanResultCode(kDefaultScanTxnId);
  EXPECT_TRUE(result);
  EXPECT_EQ(*result, WLAN_SCAN_RESULT_SUCCESS);
  auto bss_list = client_ifc_.ScanResultBssList(kDefaultScanTxnId);
  EXPECT_EQ(bss_list->size(), 2U);
}
TEST_F ( TimeoutTest , ScanAfterAssocTimeout ) { Init ( ) ; simulation :: FakeAp ap ( env_ . get ( ) , kDefaultBssid , kDefaultSsid , kDefaultChannel ) ; ap . EnableBeacon ( kBeaconInterval ) ; brcmf_simdev * sim = device_ -> GetSim ( ) ; sim -> sim_fw -> err_inj_ . AddErrInjCmd ( BRCMF_C_SET_SSID , ZX_OK , client_ifc_ . iface_id_ ) ; client_ifc_ . AssociateWith ( ap , zx :: msec ( 10 ) ) ; SCHEDULE_CALL ( zx :: sec ( 1 ) , & SimInterface :: DeauthenticateFrom , & client_ifc_ , kDefaultBssid , WLAN_DEAUTH_REASON_UNSPECIFIED ) ; SCHEDULE_CALL ( zx :: sec ( 3 ) , & SimInterface :: StartScan , & client_ifc_ , kDefaultScanTxnId , false ) ; env_ -> Run ( kTestDuration ) ; EXPECT_EQ ( client_ifc_ . stats_ . assoc_results . size ( ) , 0U ) ; EXPECT_EQ ( client_ifc_ . stats_ . deauth_results . size ( ) , 1U ) ; auto result = client_ifc_ . ScanResultCode ( kDefaultScanTxnId ) ; EXPECT_TRUE ( result ) ; EXPECT_EQ ( * result , WLAN_SCAN_RESULT_SUCCESS ) ; auto bss_list = client_ifc_ . ScanResultBssList ( kDefaultScanTxnId ) ; EXPECT_EQ ( bss_list -> size ( ) , 2U ) ; }
This test case will verify the following senerio: After the driver issuing a connect command to
firmware, sme sends a deauth_req to driver before firmware response, and sme issue a scan after
that, the scan will be successfully executed.
This test case will verify the following senerio : After the driver issuing a connect command to firmware sme sends a deauth_req to driver before firmware response and sme issue a scan after that the scan will be successfully executed .
// Ignore association req in sim-fw. // There are three timers for them, and all have been cancelled. // This when we issue a deauth request right after and assoc_req, the successful deauth_req will // stop the connect timer for assoc_req, thus no assoc_conf event will be received. // Verify that the scan completed successfully // There is only one AP in the environmnet, but two scan results will be heard from SME since the // scan dwell time is twice the beacon interval.