src/connectivity/wlan/drivers/testing/lib/sim-fake-ap/test/assoc_unittests.cc
/* Verify that association requests are rejected when the association handling state is set to
   ASSOC_REJECTED.

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

Timeline for this test:
1s: send assoc request
Verify that association requests are rejected when the association handling state is set to ASSOC_REJECTED . Timeline for this test : 1s : send assoc request
TEST_F(AssocTest, RejectAssociations) {
  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_REJECTED);
  env_.Run();
  EXPECT_EQ(assoc_resp_count_, 1U);
  ASSERT_EQ(assoc_status_list_.size(), (size_t)1);
  EXPECT_EQ(assoc_status_list_.front(), (uint16_t)WLAN_STATUS_CODE_REFUSED);
  assoc_status_list_.pop_front();
}
TEST_F ( AssocTest , RejectAssociations ) { 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_REJECTED ) ; env_ . Run ( ) ; EXPECT_EQ ( assoc_resp_count_ , 1U ) ; ASSERT_EQ ( assoc_status_list_ . size ( ) , ( size_t ) 1 ) ; EXPECT_EQ ( assoc_status_list_ . front ( ) , ( uint16_t ) WLAN_STATUS_CODE_REFUSED ) ; assoc_status_list_ . pop_front ( ) ; }
Verify that association requests are rejected when the association handling state is set to
ASSOC_REJECTED.
Verify that association requests are rejected when the association handling state is set to ASSOC_REJECTED .
// Schedule first request