src/connectivity/wlan/drivers/third_party/broadcom/brcmfmac/sim/test/assoc_test.cc
// Verify that if an AP rejects an association request we return a failure
Verify that if an AP rejects an association request we return a failure
Verify that if an AP rejects an association request we return a failure
TEST_F(AssocTest, ApRejectedRequest) {
  Init();
  simulation::FakeAp ap(env_.get(), kDefaultBssid, kDefaultSsid, kDefaultChannel);
  ap.EnableBeacon(zx::msec(100));
  ap.SetAssocHandling(simulation::FakeAp::ASSOC_REJECTED);
  aps_.push_back(&ap);
  context_.expected_results.push_front(WLAN_ASSOC_RESULT_REFUSED_REASON_UNSPECIFIED);
  ScheduleAssocReq(zx::msec(10));
  env_->Run();
  EXPECT_EQ(assoc_responses_.size(), 1U);
  EXPECT_EQ(assoc_responses_.front().status, WLAN_STATUS_CODE_REFUSED);
  EXPECT_EQ(context_.assoc_resp_count, 1U);
}
TEST_F ( AssocTest , ApRejectedRequest ) { Init ( ) ; simulation :: FakeAp ap ( env_ . get ( ) , kDefaultBssid , kDefaultSsid , kDefaultChannel ) ; ap . EnableBeacon ( zx :: msec ( 100 ) ) ; ap . SetAssocHandling ( simulation :: FakeAp :: ASSOC_REJECTED ) ; aps_ . push_back ( & ap ) ; context_ . expected_results . push_front ( WLAN_ASSOC_RESULT_REFUSED_REASON_UNSPECIFIED ) ; ScheduleAssocReq ( zx :: msec ( 10 ) ) ; env_ -> Run ( ) ; EXPECT_EQ ( assoc_responses_ . size ( ) , 1U ) ; EXPECT_EQ ( assoc_responses_ . front ( ) . status , WLAN_STATUS_CODE_REFUSED ) ; EXPECT_EQ ( context_ . assoc_resp_count , 1U ) ; }
Verify that if an AP rejects an association request we return a failure
Verify that if an AP rejects an association request we return a failure
// Create our device instance // Start up fake APs // We should have gotten a rejection from the fake AP // Make sure we got our response from the driver