src/connectivity/wlan/drivers/testing/lib/sim-fake-ap/test/assoc_unittests.cc
TEST_F(AssocTest, IgnoreAssociations) {
  FinishAuth();
  // Schedule assoc req
  auto handler = std::make_unique<std::function<void()>>();
  simulation::SimAssocReqFrame assoc_req_frame(kClientMacAddr, kApBssid, kApSsid);
  *handler = std::bind(&simulation::Environment::Tx, &env_, assoc_req_frame, kDefaultTxInfo, this);
  env_.ScheduleNotification(std::move(handler), zx::sec(1));

  ap_.SetAssocHandling(simulation::FakeAp::ASSOC_IGNORED);

  env_.Run();

  // Verify that no assoc responses were seen in the environment
  EXPECT_EQ(assoc_resp_count_, 0U);
}
/* Verify that association requests are ignored when the association handling state is set to
   ASSOC_IGNORED.

   Timeline for this test:
   1s: send assoc request
 */
Verify that association requests are ignored when the association handling state is set to
ASSOC_IGNORED.

Timeline for this test:
1s: send assoc request
Verify that association requests are ignored when the association handling state is set to ASSOC_IGNORED . Timeline for this test : 1s : send assoc request
TEST_F(AssocTest, IgnoreAssociations) {
  FinishAuth();
  auto handler = std::make_unique<std::function<void()>>();
  simulation::SimAssocReqFrame assoc_req_frame(kClientMacAddr, kApBssid, kApSsid);
  *handler = std::bind(&simulation::Environment::Tx, &env_, assoc_req_frame, kDefaultTxInfo, this);
  env_.ScheduleNotification(std::move(handler), zx::sec(1));
  ap_.SetAssocHandling(simulation::FakeAp::ASSOC_IGNORED);
  env_.Run();
  EXPECT_EQ(assoc_resp_count_, 0U);
}
TEST_F ( AssocTest , IgnoreAssociations ) { FinishAuth ( ) ; auto handler = std :: make_unique < std :: function < void ( ) > > ( ) ; simulation :: SimAssocReqFrame assoc_req_frame ( kClientMacAddr , kApBssid , kApSsid ) ; * handler = std :: bind ( & simulation :: Environment :: Tx , & env_ , assoc_req_frame , kDefaultTxInfo , this ) ; env_ . ScheduleNotification ( std :: move ( handler ) , zx :: sec ( 1 ) ) ; ap_ . SetAssocHandling ( simulation :: FakeAp :: ASSOC_IGNORED ) ; env_ . Run ( ) ; EXPECT_EQ ( assoc_resp_count_ , 0U ) ; }
Verify that association requests are ignored when the association handling state is set to
ASSOC_IGNORED.
Verify that association requests are ignored when the association handling state is set to ASSOC_IGNORED .
// Schedule assoc req // Verify that no assoc responses were seen in the environment