[wlan] Create fake_bss! macro for mocking BssDescription values

The fake_bss! macro is introduced in this change to simplify the way
fake BssDescription types are created for tests. The first argument of
fake_bss! is always the security type desired, and the remaining arguments
override the default fields of the fake BssDescription. The security
type for the fake BssDescription will determine the default values for
the cap, rsne, and vendor_ies fields.

The fake_bss! macro goes a long way to reduce the amount of custom
"fake bss" functions implemented in various places. Before this change
it was common to encounter function calls like

  fake_vht_bss_description()

in test code. This call of course does very little to explain to the
reader what part of the fake BSS is particularly important to the
test. Now, the reader will encounter something like this instead.

  fake_bss!(Open, chan: fidl_common::WlanChan {
      primary: 123,
      cbw: fidl_common::Cbw::Cbw80P80,
      secondary80: 42,
  }),

The latter makes it much more obvious which fields of the fake BSS are
relevant to the test. Here are a couple more examples.

  protected_bss(b"foo".to_vec()) -> fake_bss!(Wpa2, ssid: b"wpa2".to_vec())

  bss(-10, -10, ProtectionCfg::Wpa1) -> fake_bss!(Wpa1, rssi_dbm: -10, rcpi_dbmh: -10)

Fixed: 62886
Test: fx test wlan-common-tests wlan-mlme-tests wlan-sme-tests wlanstack-tests
Change-Id: I197a54a6812194f444c115f78c6bf5b0e3ab4c32
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/443497
Commit-Queue: Charles Celerier <chcl@google.com>
Reviewed-by: Kiet Tran <kiettran@google.com>
Testability-Review: Kiet Tran <kiettran@google.com>
diff --git a/src/connectivity/wlan/lib/common/rust/src/bss.rs b/src/connectivity/wlan/lib/common/rust/src/bss.rs
index 3e94ffc..133da71 100644
--- a/src/connectivity/wlan/lib/common/rust/src/bss.rs
+++ b/src/connectivity/wlan/lib/common/rust/src/bss.rs
@@ -250,49 +250,32 @@
 mod tests {
     use {
         super::*,
-        crate::test_utils::{
-            fake_frames::{
-                fake_unknown_rsne, fake_wpa1_ie, fake_wpa1_ie_body, fake_wpa2_enterprise_rsne,
-                fake_wpa2_legacy_rsne, fake_wpa2_mixed_rsne, fake_wpa2_rsne, fake_wpa2_wpa3_rsne,
-                fake_wpa3_enterprise_192_bit_rsne, fake_wpa3_rsne, invalid_wpa2_wpa3_rsne,
-                invalid_wpa3_enterprise_192_bit_rsne, invalid_wpa3_rsne,
-            },
-            fake_stas::fake_unprotected_bss_description,
+        crate::fake_bss,
+        crate::test_utils::fake_frames::{
+            fake_unknown_rsne, fake_wpa1_ie_body, fake_wpa2_legacy_rsne, invalid_wpa2_wpa3_rsne,
+            invalid_wpa3_enterprise_192_bit_rsne, invalid_wpa3_rsne,
         },
+        fidl_fuchsia_wlan_common as fidl_common, fidl_fuchsia_wlan_mlme as fidl_mlme,
     };
 
-    enum ProtectionCfg {
-        Open,
-        Wep,
-        Wpa1,
-        Wpa1Enhanced,
-        Wpa1Wpa2,
-        Wpa2,
-        Wpa2Mixed,
-        Wpa2Wpa3,
-        Wpa3,
-        Wpa2Enterprise,
-        Wpa3Enterprise,
-    }
-
     #[test]
     fn test_get_known_protection() {
-        assert_eq!(Protection::Open, bss(ProtectionCfg::Open).get_protection());
-        assert_eq!(Protection::Wep, bss(ProtectionCfg::Wep).get_protection());
-        assert_eq!(Protection::Wpa1, bss(ProtectionCfg::Wpa1).get_protection());
-        assert_eq!(Protection::Wpa1, bss(ProtectionCfg::Wpa1Enhanced).get_protection());
-        assert_eq!(Protection::Wpa1Wpa2Personal, bss(ProtectionCfg::Wpa1Wpa2).get_protection());
-        assert_eq!(Protection::Wpa1Wpa2Personal, bss(ProtectionCfg::Wpa2Mixed).get_protection());
-        assert_eq!(Protection::Wpa2Personal, bss(ProtectionCfg::Wpa2).get_protection());
-        assert_eq!(Protection::Wpa2Wpa3Personal, bss(ProtectionCfg::Wpa2Wpa3).get_protection());
-        assert_eq!(Protection::Wpa3Personal, bss(ProtectionCfg::Wpa3).get_protection());
-        assert_eq!(Protection::Wpa2Enterprise, bss(ProtectionCfg::Wpa2Enterprise).get_protection());
-        assert_eq!(Protection::Wpa3Enterprise, bss(ProtectionCfg::Wpa3Enterprise).get_protection());
+        assert_eq!(Protection::Open, fake_bss!(Open).get_protection());
+        assert_eq!(Protection::Wep, fake_bss!(Wep).get_protection());
+        assert_eq!(Protection::Wpa1, fake_bss!(Wpa1).get_protection());
+        assert_eq!(Protection::Wpa1, fake_bss!(Wpa1Enhanced).get_protection());
+        assert_eq!(Protection::Wpa1Wpa2Personal, fake_bss!(Wpa1Wpa2).get_protection());
+        assert_eq!(Protection::Wpa1Wpa2Personal, fake_bss!(Wpa2Mixed).get_protection());
+        assert_eq!(Protection::Wpa2Personal, fake_bss!(Wpa2).get_protection());
+        assert_eq!(Protection::Wpa2Wpa3Personal, fake_bss!(Wpa2Wpa3).get_protection());
+        assert_eq!(Protection::Wpa3Personal, fake_bss!(Wpa3).get_protection());
+        assert_eq!(Protection::Wpa2Enterprise, fake_bss!(Wpa2Enterprise).get_protection());
+        assert_eq!(Protection::Wpa3Enterprise, fake_bss!(Wpa3Enterprise).get_protection());
     }
 
     #[test]
     fn test_get_unknown_protection() {
-        let mut bss = bss(ProtectionCfg::Wpa2);
+        let mut bss = fake_bss!(Wpa2);
         bss.rsne = Some(fake_unknown_rsne());
         assert_eq!(Protection::Unknown, bss.get_protection());
 
@@ -311,90 +294,110 @@
 
     #[test]
     fn test_needs_eapol_exchange() {
-        assert!(bss(ProtectionCfg::Wpa1).needs_eapol_exchange());
-        assert!(bss(ProtectionCfg::Wpa2).needs_eapol_exchange());
+        assert!(fake_bss!(Wpa1).needs_eapol_exchange());
+        assert!(fake_bss!(Wpa2).needs_eapol_exchange());
 
-        assert!(!bss(ProtectionCfg::Open).needs_eapol_exchange());
-        assert!(!bss(ProtectionCfg::Wep).needs_eapol_exchange());
+        assert!(!fake_bss!(Open).needs_eapol_exchange());
+        assert!(!fake_bss!(Wep).needs_eapol_exchange());
     }
 
     #[test]
     fn test_get_wpa_ie() {
         let mut buf = vec![];
-        bss(ProtectionCfg::Wpa1)
+        fake_bss!(Wpa1)
             .get_wpa_ie()
             .expect("failed to find WPA1 IE")
             .write_into(&mut buf)
             .expect("failed to serialize WPA1 IE");
         assert_eq!(fake_wpa1_ie_body(false), buf);
-        bss(ProtectionCfg::Wpa2).get_wpa_ie().expect_err("found unexpected WPA1 IE");
+        fake_bss!(Wpa2).get_wpa_ie().expect_err("found unexpected WPA1 IE");
     }
 
     #[test]
     fn test_get_latest_standard_ac() {
-        let mut bss = bss(ProtectionCfg::Open);
-        bss.vht_cap = Some(Box::new(fidl_mlme::VhtCapabilities { bytes: Default::default() }));
-        bss.vht_op = Some(Box::new(fidl_mlme::VhtOperation { bytes: Default::default() }));
+        let bss = fake_bss!(Open,
+                            vht_cap: Some(Box::new(fidl_mlme::VhtCapabilities { bytes: Default::default() })),
+                            vht_op: Some(Box::new(fidl_mlme::VhtOperation { bytes: Default::default() }))
+        );
         assert_eq!(Standard::Dot11Ac, bss.get_latest_standard());
     }
 
     #[test]
     fn test_get_latest_standard_n() {
-        let mut bss = bss(ProtectionCfg::Open);
-        bss.ht_cap = Some(Box::new(fidl_mlme::HtCapabilities { bytes: Default::default() }));
-        bss.ht_op = Some(Box::new(fidl_mlme::HtOperation { bytes: Default::default() }));
+        let bss = fake_bss!(Open,
+                            vht_cap: None,
+                            vht_op: None,
+                            ht_cap: Some(Box::new(fidl_mlme::HtCapabilities { bytes: Default::default() })),
+                            ht_op: Some(Box::new(fidl_mlme::HtOperation { bytes: Default::default() })),
+        );
         assert_eq!(Standard::Dot11N, bss.get_latest_standard());
     }
 
     #[test]
     fn test_get_latest_standard_g() {
-        let mut bss = bss(ProtectionCfg::Open);
-        bss.chan.primary = 1;
-        bss.rates = vec![12];
+        let bss = fake_bss!(Open,
+                            vht_cap: None,
+                            vht_op: None,
+                            ht_cap: None,
+                            ht_op: None,
+                            chan: fidl_common::WlanChan {
+                                primary: 1,
+                                secondary80: 0,
+                                cbw: fidl_common::Cbw::Cbw20,
+                            },
+                            rates: vec![12],
+        );
         assert_eq!(Standard::Dot11G, bss.get_latest_standard());
     }
 
     #[test]
     fn test_get_latest_standard_b() {
-        let mut bss = bss(ProtectionCfg::Open);
-        bss.chan.primary = 1;
-        bss.rates = vec![2];
+        let bss = fake_bss!(Open,
+                            vht_cap: None,
+                            vht_op: None,
+                            ht_cap: None,
+                            ht_op: None,
+                            chan: fidl_common::WlanChan {
+                                primary: 1,
+                                secondary80: 0,
+                                cbw: fidl_common::Cbw::Cbw20,
+                            },
+                            rates: vec![2],
+        );
         assert_eq!(Standard::Dot11B, bss.get_latest_standard());
-        bss.rates = vec![ie::SupportedRate(2).with_basic(true).0];
+    }
+
+    #[test]
+    fn test_get_latest_standard_b_with_basic() {
+        let bss = fake_bss!(Open,
+                            vht_cap: None,
+                            vht_op: None,
+                            ht_cap: None,
+                            ht_op: None,
+                            chan: fidl_common::WlanChan {
+                                primary: 1,
+                                secondary80: 0,
+                                cbw: fidl_common::Cbw::Cbw20,
+                            },
+                            rates: vec![ie::SupportedRate(2).with_basic(true).0],
+        );
         assert_eq!(Standard::Dot11B, bss.get_latest_standard());
     }
 
     #[test]
     fn test_get_latest_standard_a() {
-        let mut bss = bss(ProtectionCfg::Open);
-        bss.chan.primary = 36;
+        let bss = fake_bss!(Open,
+                            vht_cap: None,
+                            vht_op: None,
+                            ht_cap: None,
+                            ht_op: None,
+                            chan: fidl_common::WlanChan {
+                                primary: 36,
+                                secondary80: 0,
+                                cbw: fidl_common::Cbw::Cbw20,
+                            },
+                            rates: vec![48],
+        );
         assert_eq!(Standard::Dot11A, bss.get_latest_standard());
     }
-
-    fn bss(protection: ProtectionCfg) -> fidl_mlme::BssDescription {
-        let bss = fake_unprotected_bss_description(b"foo".to_vec());
-        fidl_mlme::BssDescription {
-            cap: CapabilityInfo(0)
-                .with_privacy(match protection {
-                    ProtectionCfg::Open => false,
-                    _ => true,
-                })
-                .0,
-            rsne: match protection {
-                ProtectionCfg::Wpa3Enterprise => Some(fake_wpa3_enterprise_192_bit_rsne()),
-                ProtectionCfg::Wpa2Enterprise => Some(fake_wpa2_enterprise_rsne()),
-                ProtectionCfg::Wpa3 => Some(fake_wpa3_rsne()),
-                ProtectionCfg::Wpa2Wpa3 => Some(fake_wpa2_wpa3_rsne()),
-                ProtectionCfg::Wpa2 | ProtectionCfg::Wpa1Wpa2 => Some(fake_wpa2_rsne()),
-                ProtectionCfg::Wpa2Mixed => Some(fake_wpa2_mixed_rsne()),
-                _ => None,
-            },
-            vendor_ies: match protection {
-                ProtectionCfg::Wpa1 | ProtectionCfg::Wpa1Wpa2 => Some(fake_wpa1_ie(false)),
-                ProtectionCfg::Wpa1Enhanced => Some(fake_wpa1_ie(true)),
-                _ => None,
-            },
-            ..bss
-        }
-    }
 }
diff --git a/src/connectivity/wlan/lib/common/rust/src/test_utils/fake_frames.rs b/src/connectivity/wlan/lib/common/rust/src/test_utils/fake_frames.rs
index 6ac99c2..71d8616 100644
--- a/src/connectivity/wlan/lib/common/rust/src/test_utils/fake_frames.rs
+++ b/src/connectivity/wlan/lib/common/rust/src/test_utils/fake_frames.rs
@@ -364,6 +364,16 @@
     ]
 }
 
+pub fn fake_eap_rsne() -> Vec<u8> {
+    vec![
+        48, 18, // Element header
+        1, 0, // Version
+        0x00, 0x0F, 0xAC, 4, // Group Cipher: CCMP-128
+        1, 0, 0x00, 0x0F, 0xAC, 4, // 1 Pairwise Cipher: CCMP-128
+        1, 0, 0x00, 0x0F, 0xAC, 1, // 1 AKM:  802.1X
+    ]
+}
+
 // RSNE with AKM that we can't classify into a protection type
 pub fn fake_unknown_rsne() -> Vec<u8> {
     vec![
diff --git a/src/connectivity/wlan/lib/common/rust/src/test_utils/fake_stas.rs b/src/connectivity/wlan/lib/common/rust/src/test_utils/fake_stas.rs
index 9d59c64..99f47cc 100644
--- a/src/connectivity/wlan/lib/common/rust/src/test_utils/fake_stas.rs
+++ b/src/connectivity/wlan/lib/common/rust/src/test_utils/fake_stas.rs
@@ -3,42 +3,93 @@
 // found in the LICENSE file.
 
 use fidl_fuchsia_wlan_common as fidl_common;
-use fidl_fuchsia_wlan_mlme as fidl_mlme;
+pub use fidl_fuchsia_wlan_mlme as fidl_mlme;
 
-type Ssid = Vec<u8>;
+use crate::{
+    ie::fake_ies::{fake_ht_cap_bytes, fake_ht_op_bytes, fake_vht_cap_bytes, fake_vht_op_bytes},
+    mac,
+    test_utils::fake_frames::{
+        fake_eap_rsne, fake_wpa1_ie, fake_wpa2_enterprise_rsne, fake_wpa2_legacy_rsne,
+        fake_wpa2_mixed_rsne, fake_wpa2_rsne, fake_wpa2_wpa3_rsne,
+        fake_wpa3_enterprise_192_bit_rsne, fake_wpa3_rsne,
+    },
+};
 
-pub fn fake_bss_description(
-    ssid: Ssid,
-    rsne_bytes: Option<Vec<u8>>,
-    vendor_ies_bytes: Option<Vec<u8>>,
-) -> fidl_mlme::BssDescription {
+pub enum FakeProtectionCfg__ {
+    Open,
+    Wep,
+    Wpa1,
+    Wpa1Enhanced,
+    Wpa2Legacy,
+    Wpa1Wpa2,
+    Wpa2Mixed,
+    Wpa2Enterprise,
+    Wpa2,
+    Wpa2Wpa3,
+    Wpa3,
+    Wpa3Enterprise,
+    Wpa2NoPrivacy,
+    Eap,
+}
+
+pub fn build_fake_bss__(protection_cfg: FakeProtectionCfg__) -> fidl_mlme::BssDescription {
     fidl_mlme::BssDescription {
         bssid: [7, 1, 2, 77, 53, 8],
-        ssid,
+        ssid: b"fake-ssid".to_vec(),
         bss_type: fidl_mlme::BssTypes::Infrastructure,
         beacon_period: 100,
         dtim_period: 100,
         timestamp: 0,
         local_time: 0,
-        cap: crate::mac::CapabilityInfo(0).with_privacy(rsne_bytes.is_some()).0,
-        rates: vec![],
+        rates: vec![0x82, 0x84, 0x8b, 0x96, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6c],
         country: None,
-        rsne: rsne_bytes,
-        vendor_ies: vendor_ies_bytes,
 
         rcpi_dbmh: 0,
         rsni_dbh: 0,
 
-        ht_cap: None,
-        ht_op: None,
-        vht_cap: None,
-        vht_op: None,
-        chan: fidl_common::WlanChan { primary: 1, secondary80: 0, cbw: fidl_common::Cbw::Cbw20 },
+        ht_cap: Some(Box::new(fidl_mlme::HtCapabilities { bytes: fake_ht_cap_bytes() })),
+        ht_op: Some(Box::new(fidl_mlme::HtOperation { bytes: fake_ht_op_bytes() })),
+        vht_cap: Some(Box::new(fidl_mlme::VhtCapabilities { bytes: fake_vht_cap_bytes() })),
+        vht_op: Some(Box::new(fidl_mlme::VhtOperation { bytes: fake_vht_op_bytes() })),
+        chan: fidl_common::WlanChan { primary: 3, secondary80: 0, cbw: fidl_common::Cbw::Cbw40 },
         rssi_dbm: 0,
         snr_db: 0,
+
+        cap: mac::CapabilityInfo(0)
+            .with_privacy(match protection_cfg {
+                FakeProtectionCfg__::Open | FakeProtectionCfg__::Wpa2NoPrivacy => false,
+                _ => true,
+            })
+            .0,
+        rsne: match protection_cfg {
+            FakeProtectionCfg__::Wpa3Enterprise => Some(fake_wpa3_enterprise_192_bit_rsne()),
+            FakeProtectionCfg__::Wpa2Enterprise => Some(fake_wpa2_enterprise_rsne()),
+            FakeProtectionCfg__::Wpa3 => Some(fake_wpa3_rsne()),
+            FakeProtectionCfg__::Wpa2Wpa3 => Some(fake_wpa2_wpa3_rsne()),
+            FakeProtectionCfg__::Wpa2Mixed => Some(fake_wpa2_mixed_rsne()),
+            FakeProtectionCfg__::Wpa2Legacy => Some(fake_wpa2_legacy_rsne()),
+            FakeProtectionCfg__::Wpa1Wpa2
+            | FakeProtectionCfg__::Wpa2
+            | FakeProtectionCfg__::Wpa2NoPrivacy => Some(fake_wpa2_rsne()),
+            FakeProtectionCfg__::Eap => Some(fake_eap_rsne()),
+            _ => None,
+        },
+        vendor_ies: match protection_cfg {
+            FakeProtectionCfg__::Wpa1 | FakeProtectionCfg__::Wpa1Wpa2 => Some(fake_wpa1_ie(false)),
+            FakeProtectionCfg__::Wpa1Enhanced => Some(fake_wpa1_ie(true)),
+            _ => None,
+        },
     }
 }
 
-pub fn fake_unprotected_bss_description(ssid: Ssid) -> fidl_mlme::BssDescription {
-    fake_bss_description(ssid, None, None)
+#[macro_export]
+macro_rules! fake_bss {
+    ($protection_type:ident$(, $bss_key:ident: $bss_value:expr)* $(,)?) => {
+        $crate::test_utils::fake_stas::fidl_mlme::BssDescription {
+            $(
+                $bss_key: $bss_value,
+            )*
+                ..$crate::test_utils::fake_stas::build_fake_bss__($crate::test_utils::fake_stas::FakeProtectionCfg__::$protection_type)
+        }
+    }
 }
diff --git a/src/connectivity/wlan/lib/mlme/rust/src/client/mod.rs b/src/connectivity/wlan/lib/mlme/rust/src/client/mod.rs
index 1decfe9..3273a22 100644
--- a/src/connectivity/wlan/lib/mlme/rust/src/client/mod.rs
+++ b/src/connectivity/wlan/lib/mlme/rust/src/client/mod.rs
@@ -1065,13 +1065,7 @@
         },
         fidl_fuchsia_wlan_common as fidl_common,
         wlan_common::{
-            assert_variant,
-            ie::{
-                self, fake_wpa_ie, get_rsn_ie_bytes, get_vendor_ie_bytes_for_wpa_ie,
-                rsn::fake_wpa2_a_rsne,
-            },
-            stats::SignalStrengthAverage,
-            test_utils::fake_frames::*,
+            assert_variant, fake_bss, ie, stats::SignalStrengthAverage, test_utils::fake_frames::*,
             TimeUnit,
         },
         wlan_statemachine::*,
@@ -1221,11 +1215,7 @@
         let mut me = m.make_mlme();
         assert!(me.get_bound_client().is_none(), "MLME should not contain client, yet");
         me.on_sme_join(fidl_mlme::JoinRequest {
-            selected_bss: wlan_common::test_utils::fake_stas::fake_bss_description(
-                vec![],
-                None,
-                None,
-            ),
+            selected_bss: fake_bss!(Open),
             join_failure_timeout: 42,
             nav_sync_delay: 42,
             op_rates: vec![1, 2, 3],
@@ -1241,13 +1231,8 @@
         let mut m = MockObjects::new();
         let mut me = m.make_mlme();
         assert!(me.get_bound_client().is_none(), "MLME should not contain client, yet");
-        let rsne_bytes = get_rsn_ie_bytes(&fake_wpa2_a_rsne());
         me.on_sme_join(fidl_mlme::JoinRequest {
-            selected_bss: wlan_common::test_utils::fake_stas::fake_bss_description(
-                vec![],
-                Some(rsne_bytes),
-                None,
-            ),
+            selected_bss: fake_bss!(Wpa2),
             join_failure_timeout: 42,
             nav_sync_delay: 42,
             op_rates: vec![1, 2, 3],
@@ -1260,18 +1245,12 @@
     }
 
     #[test]
-    fn wpa_ie_implies_sta_eapol_required() {
+    fn wpa1_implies_sta_eapol_required() {
         let mut m = MockObjects::new();
         let mut me = m.make_mlme();
         assert!(me.get_bound_client().is_none(), "MLME should not contain client, yet");
-        let vendor_ies_bytes = get_vendor_ie_bytes_for_wpa_ie(&fake_wpa_ie())
-            .expect("could not write WPA IE to Vendor IE buffer");
         me.on_sme_join(fidl_mlme::JoinRequest {
-            selected_bss: wlan_common::test_utils::fake_stas::fake_bss_description(
-                vec![],
-                None,
-                Some(vendor_ies_bytes),
-            ),
+            selected_bss: fake_bss!(Wpa1),
             join_failure_timeout: 42,
             nav_sync_delay: 42,
             op_rates: vec![1, 2, 3],
@@ -1289,11 +1268,7 @@
         let mut me = m.make_mlme();
         assert!(me.get_bound_client().is_none(), "MLME should not contain client, yet");
         me.on_sme_join(fidl_mlme::JoinRequest {
-            selected_bss: wlan_common::test_utils::fake_stas::fake_bss_description(
-                vec![],
-                None,
-                None,
-            ),
+            selected_bss: fake_bss!(Open),
             join_failure_timeout: 42,
             nav_sync_delay: 42,
             op_rates: vec![1, 2, 3],
diff --git a/src/connectivity/wlan/lib/sme/src/client/bss.rs b/src/connectivity/wlan/lib/sme/src/client/bss.rs
index 0964d96..e9fc3dc 100644
--- a/src/connectivity/wlan/lib/sme/src/client/bss.rs
+++ b/src/connectivity/wlan/lib/sme/src/client/bss.rs
@@ -148,25 +148,19 @@
 mod tests {
     use {
         super::*,
-        crate::client::test_utils::{fake_bss_with_bssid, fake_wmm_param},
+        crate::client::test_utils::fake_wmm_param,
         fidl_fuchsia_wlan_common as fidl_common, fidl_fuchsia_wlan_mlme as fidl_mlme,
-        std::{cmp::Ordering, convert::TryInto},
-        wlan_common::{channel::Cbw, ie},
-        zerocopy::AsBytes,
+        std::cmp::Ordering,
+        wlan_common::channel::Cbw,
+        wlan_common::{
+            fake_bss,
+            ie::{
+                self,
+                fake_ies::{fake_ht_cap_bytes, fake_vht_cap_bytes},
+            },
+        },
     };
 
-    enum ProtectionCfg {
-        Open,
-        Wep,
-        Wpa1,
-        Wpa2Legacy,
-        Wpa2,
-        Wpa3,
-        Wpa2NoPrivacy,
-        Wpa2Wpa3MixedMode,
-        Eap,
-    }
-
     #[test]
     fn compare() {
         //  BSSes with the same RCPI, RSSI, and protection are equivalent.
@@ -174,40 +168,52 @@
         assert_eq!(
             Ordering::Equal,
             cfg.compare_bss(
-                &bss(-10, -30, ProtectionCfg::Wpa2),
-                &bss(-10, -30, ProtectionCfg::Wpa2)
+                &fake_bss!(Wpa2, rssi_dbm: -10, rcpi_dbmh: -30),
+                &fake_bss!(Wpa2, rssi_dbm: -10, rcpi_dbmh: -30)
             )
         );
         // Compatibility takes priority over everything else
         assert_bss_cmp(
             &cfg,
-            &bss(-10, -10, ProtectionCfg::Wpa1),
-            &bss(-50, -50, ProtectionCfg::Wpa2),
+            &fake_bss!(Wpa1, rssi_dbm: -10, rcpi_dbmh: -10),
+            &fake_bss!(Wpa2, rssi_dbm: -50, rcpi_dbmh: -50),
         );
         assert_bss_cmp(
             &cfg,
-            &bss(-10, -10, ProtectionCfg::Wpa1),
-            &bss(-50, -50, ProtectionCfg::Wpa2),
+            &fake_bss!(Wpa1, rssi_dbm: -10, rcpi_dbmh: -10),
+            &fake_bss!(Wpa2, rssi_dbm: -50, rcpi_dbmh: -50),
         );
         // Higher security is better.
         assert_bss_cmp(
             &cfg,
-            &bss(-10, -10, ProtectionCfg::Open),
-            &bss(-50, -50, ProtectionCfg::Wpa2),
+            &fake_bss!(Open, rssi_dbm: -10, rcpi_dbmh: -10),
+            &fake_bss!(Wpa2, rssi_dbm: -50, rcpi_dbmh: -50),
         );
 
         // RCPI in dBmh takes priority over RSSI in dBmh
         assert_bss_cmp(
             &cfg,
-            &bss(-20, -30, ProtectionCfg::Wpa2),
-            &bss(-30, -20, ProtectionCfg::Wpa2),
+            &fake_bss!(Wpa2, rssi_dbm: -20, rcpi_dbmh: -30),
+            &fake_bss!(Wpa2, rssi_dbm: -30, rcpi_dbmh: -20),
         );
         // Compare RSSI if RCPI is absent
-        assert_bss_cmp(&cfg, &bss(-30, 0, ProtectionCfg::Wpa2), &bss(-20, 0, ProtectionCfg::Wpa2));
+        assert_bss_cmp(
+            &cfg,
+            &fake_bss!(Wpa2, rssi_dbm: -30, rcpi_dbmh: 0),
+            &fake_bss!(Wpa2, rssi_dbm: -20, rcpi_dbmh: 0),
+        );
         // Having an RCPI measurement is always better than not having any measurement
-        assert_bss_cmp(&cfg, &bss(0, 0, ProtectionCfg::Wpa2), &bss(0, -200, ProtectionCfg::Wpa2));
+        assert_bss_cmp(
+            &cfg,
+            &fake_bss!(Wpa2, rssi_dbm: 0, rcpi_dbmh: 0),
+            &fake_bss!(Wpa2, rssi_dbm: 0, rcpi_dbmh: -200),
+        );
         // Having an RSSI measurement is always better than not having any measurement
-        assert_bss_cmp(&cfg, &bss(0, 0, ProtectionCfg::Wpa2), &bss(-100, 0, ProtectionCfg::Wpa2));
+        assert_bss_cmp(
+            &cfg,
+            &fake_bss!(Wpa2, rssi_dbm: 0, rcpi_dbmh: 0),
+            &fake_bss!(Wpa2, rssi_dbm: -100, rcpi_dbmh: 0),
+        );
     }
 
     #[test]
@@ -216,13 +222,13 @@
         // WEP is supported while WPA1 is not, so we prefer it.
         assert_bss_cmp(
             &cfg,
-            &bss(-10, -10, ProtectionCfg::Wpa1),
-            &bss(-50, -50, ProtectionCfg::Wep),
+            &fake_bss!(Wpa1, rssi_dbm: -10, rcpi_dbmh: -10),
+            &fake_bss!(Wep, rssi_dbm: -50, rcpi_dbmh: -50),
         );
         assert_bss_cmp(
             &cfg,
-            &bss(-10, -10, ProtectionCfg::Wep),
-            &bss(-50, -50, ProtectionCfg::Wpa2),
+            &fake_bss!(Wep, rssi_dbm: -10, rcpi_dbmh: -10),
+            &fake_bss!(Wpa2, rssi_dbm: -50, rcpi_dbmh: -50),
         );
     }
 
@@ -232,8 +238,8 @@
         // WEP is worse than WPA1 when both are supported.
         assert_bss_cmp(
             &cfg,
-            &bss(-50, -50, ProtectionCfg::Wep),
-            &bss(-10, -10, ProtectionCfg::Wpa1),
+            &fake_bss!(Wep, rssi_dbm: -50, rcpi_dbmh: -50),
+            &fake_bss!(Wpa1, rssi_dbm: -10, rcpi_dbmh: -10),
         );
     }
 
@@ -246,9 +252,9 @@
     #[test]
     fn get_best_bss_nonempty_list() {
         let cfg = ClientConfig::default();
-        let bss1 = bss(-30, -10, ProtectionCfg::Wep);
-        let bss2 = bss(-20, -10, ProtectionCfg::Wpa2);
-        let bss3 = bss(-80, -80, ProtectionCfg::Wpa2);
+        let bss1 = fake_bss!(Wep, rssi_dbm: -30, rcpi_dbmh: -10);
+        let bss2 = fake_bss!(Wpa2, rssi_dbm: -20, rcpi_dbmh: -10);
+        let bss3 = fake_bss!(Wpa2, rssi_dbm: -80, rcpi_dbmh: -80);
         let bss_list = vec![bss1, bss2, bss3];
         assert_eq!(cfg.get_best_bss(&bss_list), Some(&bss_list[1]));
     }
@@ -257,45 +263,60 @@
     fn verify_compatibility() {
         // Compatible:
         let cfg = ClientConfig::default();
-        assert!(cfg.is_bss_compatible(&bss(-30, -10, ProtectionCfg::Open)));
-        assert!(cfg.is_bss_compatible(&bss(-30, -10, ProtectionCfg::Wpa2)));
-        assert!(cfg.is_bss_compatible(&bss(-30, -10, ProtectionCfg::Wpa2Wpa3MixedMode)));
+        assert!(cfg.is_bss_compatible(&fake_bss!(Open)));
+        assert!(cfg.is_bss_compatible(&fake_bss!(Wpa2)));
+        assert!(cfg.is_bss_compatible(&fake_bss!(Wpa2Wpa3)));
 
         // Not compatible:
-        assert!(!cfg.is_bss_compatible(&bss(-30, -10, ProtectionCfg::Wpa1)));
-        assert!(!cfg.is_bss_compatible(&bss(-30, -10, ProtectionCfg::Wpa2Legacy)));
-        assert!(!cfg.is_bss_compatible(&bss(-30, -10, ProtectionCfg::Wpa2NoPrivacy)));
-        assert!(!cfg.is_bss_compatible(&bss(-30, -10, ProtectionCfg::Wpa3)));
-        assert!(!cfg.is_bss_compatible(&bss(-30, -10, ProtectionCfg::Eap)));
+        assert!(!cfg.is_bss_compatible(&fake_bss!(Wpa1)));
+        assert!(!cfg.is_bss_compatible(&fake_bss!(Wpa2Legacy)));
+        assert!(!cfg.is_bss_compatible(&fake_bss!(Wpa2NoPrivacy)));
+        assert!(!cfg.is_bss_compatible(&fake_bss!(Wpa3)));
+        assert!(!cfg.is_bss_compatible(&fake_bss!(Eap)));
 
         // WEP support is configurable to be on or off:
         let cfg = ClientConfig::from_config(Config::default().with_wep(), false);
-        assert!(cfg.is_bss_compatible(&bss(-30, -10, ProtectionCfg::Wep)));
+        assert!(cfg.is_bss_compatible(&fake_bss!(Wep)));
 
         // WPA3 support is configurable to be on or off:
         let cfg = ClientConfig::from_config(Config::default(), true);
-        assert!(cfg.is_bss_compatible(&bss(-30, -10, ProtectionCfg::Wpa3)));
+        assert!(cfg.is_bss_compatible(&fake_bss!(Wpa3)));
     }
 
     #[test]
     fn convert_bss() {
         let cfg = ClientConfig::default();
         assert_eq!(
-            cfg.convert_bss_description(&bss(-30, -10, ProtectionCfg::Wpa2), None),
+            cfg.convert_bss_description(
+                &fake_bss!(Wpa2,
+                    ssid: vec![],
+                    bssid: [0u8; 6],
+                    rssi_dbm: -30,
+                    snr_db: 0,
+                    chan: fidl_common::WlanChan {
+                        primary: 1,
+                        secondary80: 0,
+                        cbw: fidl_common::Cbw::Cbw20,
+                    },
+                    ht_cap: Some(Box::new(fidl_mlme::HtCapabilities {
+                        bytes: fake_ht_cap_bytes()
+                    })),
+                    vht_cap: Some(Box::new(fidl_mlme::VhtCapabilities {
+                        bytes: fake_vht_cap_bytes()
+                    })),
+                ),
+                None
+            ),
             BssInfo {
                 bssid: [0u8; 6],
                 ssid: vec![],
-                rx_dbm: -5,
+                rx_dbm: -30,
                 snr_db: 0,
                 channel: Channel { primary: 1, cbw: Cbw::Cbw20 },
                 protection: Protection::Wpa2Personal,
                 compatible: true,
-                ht_cap: Some(fidl_mlme::HtCapabilities {
-                    bytes: ie::fake_ht_capabilities().as_bytes().try_into().unwrap()
-                }),
-                vht_cap: Some(fidl_mlme::VhtCapabilities {
-                    bytes: ie::fake_vht_capabilities().as_bytes().try_into().unwrap()
-                }),
+                ht_cap: Some(fidl_mlme::HtCapabilities { bytes: fake_ht_cap_bytes() }),
+                vht_cap: Some(fidl_mlme::VhtCapabilities { bytes: fake_vht_cap_bytes() }),
                 probe_resp_wsc: None,
                 wmm_param: None,
             }
@@ -304,42 +325,72 @@
         let wmm_param = *ie::parse_wmm_param(&fake_wmm_param().bytes[..])
             .expect("expect WMM param to be parseable");
         assert_eq!(
-            cfg.convert_bss_description(&bss(-30, -10, ProtectionCfg::Wpa2), Some(wmm_param)),
+            cfg.convert_bss_description(
+                &fake_bss!(Wpa2,
+                    ssid: vec![],
+                    bssid: [0u8; 6],
+                    rssi_dbm: -30,
+                    snr_db: 0,
+                    chan: fidl_common::WlanChan {
+                        primary: 1,
+                        secondary80: 0,
+                        cbw: fidl_common::Cbw::Cbw20,
+                    },
+                    ht_cap: Some(Box::new(fidl_mlme::HtCapabilities {
+                        bytes: fake_ht_cap_bytes()
+                    })),
+                    vht_cap: Some(Box::new(fidl_mlme::VhtCapabilities {
+                        bytes: fake_vht_cap_bytes()
+                    })),
+                ),
+                Some(wmm_param)
+            ),
             BssInfo {
                 bssid: [0u8; 6],
                 ssid: vec![],
-                rx_dbm: -5,
+                rx_dbm: -30,
                 snr_db: 0,
                 channel: Channel { primary: 1, cbw: Cbw::Cbw20 },
                 protection: Protection::Wpa2Personal,
                 compatible: true,
-                ht_cap: Some(fidl_mlme::HtCapabilities {
-                    bytes: ie::fake_ht_capabilities().as_bytes().try_into().unwrap()
-                }),
-                vht_cap: Some(fidl_mlme::VhtCapabilities {
-                    bytes: ie::fake_vht_capabilities().as_bytes().try_into().unwrap()
-                }),
+                ht_cap: Some(fidl_mlme::HtCapabilities { bytes: fake_ht_cap_bytes() }),
+                vht_cap: Some(fidl_mlme::VhtCapabilities { bytes: fake_vht_cap_bytes() }),
                 probe_resp_wsc: None,
                 wmm_param: Some(wmm_param),
             }
         );
 
         assert_eq!(
-            cfg.convert_bss_description(&bss(-30, -10, ProtectionCfg::Wep), None),
+            cfg.convert_bss_description(
+                &fake_bss!(Wep,
+                    ssid: vec![],
+                    bssid: [0u8; 6],
+                    rssi_dbm: -30,
+                    snr_db: 0,
+                    chan: fidl_common::WlanChan {
+                        primary: 1,
+                        secondary80: 0,
+                        cbw: fidl_common::Cbw::Cbw20,
+                    },
+                    ht_cap: Some(Box::new(fidl_mlme::HtCapabilities {
+                        bytes: fake_ht_cap_bytes()
+                    })),
+                    vht_cap: Some(Box::new(fidl_mlme::VhtCapabilities {
+                        bytes: fake_vht_cap_bytes()
+                    })),
+                ),
+                None
+            ),
             BssInfo {
                 bssid: [0u8; 6],
                 ssid: vec![],
-                rx_dbm: -5,
+                rx_dbm: -30,
                 snr_db: 0,
                 channel: Channel { primary: 1, cbw: Cbw::Cbw20 },
                 protection: Protection::Wep,
                 compatible: false,
-                ht_cap: Some(fidl_mlme::HtCapabilities {
-                    bytes: ie::fake_ht_capabilities().as_bytes().try_into().unwrap()
-                }),
-                vht_cap: Some(fidl_mlme::VhtCapabilities {
-                    bytes: ie::fake_vht_capabilities().as_bytes().try_into().unwrap()
-                }),
+                ht_cap: Some(fidl_mlme::HtCapabilities { bytes: fake_ht_cap_bytes() }),
+                vht_cap: Some(fidl_mlme::VhtCapabilities { bytes: fake_vht_cap_bytes() }),
                 probe_resp_wsc: None,
                 wmm_param: None,
             }
@@ -347,21 +398,36 @@
 
         let cfg = ClientConfig::from_config(Config::default().with_wep(), false);
         assert_eq!(
-            cfg.convert_bss_description(&bss(-30, -10, ProtectionCfg::Wep), None),
+            cfg.convert_bss_description(
+                &fake_bss!(Wep,
+                    ssid: vec![],
+                    bssid: [0u8; 6],
+                    rssi_dbm: -30,
+                    snr_db: 0,
+                    chan: fidl_common::WlanChan {
+                        primary: 1,
+                        secondary80: 0,
+                        cbw: fidl_common::Cbw::Cbw20,
+                    },
+                    ht_cap: Some(Box::new(fidl_mlme::HtCapabilities {
+                        bytes: fake_ht_cap_bytes()
+                    })),
+                    vht_cap: Some(Box::new(fidl_mlme::VhtCapabilities {
+                        bytes: fake_vht_cap_bytes()
+                    })),
+                ),
+                None
+            ),
             BssInfo {
                 bssid: [0u8; 6],
                 ssid: vec![],
-                rx_dbm: -5,
+                rx_dbm: -30,
                 snr_db: 0,
                 channel: Channel { primary: 1, cbw: Cbw::Cbw20 },
                 protection: Protection::Wep,
                 compatible: true,
-                ht_cap: Some(fidl_mlme::HtCapabilities {
-                    bytes: ie::fake_ht_capabilities().as_bytes().try_into().unwrap()
-                }),
-                vht_cap: Some(fidl_mlme::VhtCapabilities {
-                    bytes: ie::fake_vht_capabilities().as_bytes().try_into().unwrap()
-                }),
+                ht_cap: Some(fidl_mlme::HtCapabilities { bytes: fake_ht_cap_bytes() }),
+                vht_cap: Some(fidl_mlme::VhtCapabilities { bytes: fake_vht_cap_bytes() }),
                 probe_resp_wsc: None,
                 wmm_param: None,
             }
@@ -371,9 +437,9 @@
     #[test]
     fn count_ssid_in_bss_list() {
         let cfg = ClientConfig::default();
-        let bss1 = fake_bss_with_bssid(b"foo".to_vec(), [1, 1, 1, 1, 1, 1]);
-        let bss2 = fake_bss_with_bssid(b"bar".to_vec(), [2, 2, 2, 2, 2, 2]);
-        let bss3 = fake_bss_with_bssid(b"foo".to_vec(), [3, 3, 3, 3, 3, 3]);
+        let bss1 = fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [1, 1, 1, 1, 1, 1]);
+        let bss2 = fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [2, 2, 2, 2, 2, 2]);
+        let bss3 = fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [3, 3, 3, 3, 3, 3]);
         let num_ssid = cfg.count_ssid(&vec![bss1, bss2, bss3]);
 
         assert_eq!(2, num_ssid);
@@ -399,128 +465,4 @@
         assert_eq!(Ordering::Less, cfg.compare_bss(worse, better));
         assert_eq!(Ordering::Greater, cfg.compare_bss(better, worse));
     }
-
-    fn bss(_rssi_dbm: i8, _rcpi_dbmh: i16, protection: ProtectionCfg) -> fidl_mlme::BssDescription {
-        let ret = fidl_mlme::BssDescription {
-            bssid: [0, 0, 0, 0, 0, 0],
-            ssid: vec![],
-
-            bss_type: fidl_mlme::BssTypes::Infrastructure,
-            beacon_period: 100,
-            dtim_period: 100,
-            timestamp: 0,
-            local_time: 0,
-
-            cap: wlan_common::mac::CapabilityInfo(0)
-                .with_privacy(match protection {
-                    ProtectionCfg::Open | ProtectionCfg::Wpa2NoPrivacy => false,
-                    _ => true,
-                })
-                .0,
-            rates: vec![],
-            country: None,
-            rsne: match protection {
-                ProtectionCfg::Wpa2Legacy => Some(fake_wpa2_legacy_rsne()),
-                ProtectionCfg::Wpa2 | ProtectionCfg::Wpa2NoPrivacy => Some(fake_wpa2_rsne()),
-                ProtectionCfg::Wpa3 => Some(fake_wpa3_rsne()),
-                ProtectionCfg::Wpa2Wpa3MixedMode => Some(fake_wpa2_wpa3_mixed_mode_rsne()),
-                ProtectionCfg::Eap => Some(fake_eap_rsne()),
-                _ => None,
-            },
-            vendor_ies: match protection {
-                ProtectionCfg::Wpa1 => Some(fake_wpa1_ie()),
-                _ => None,
-            },
-
-            rcpi_dbmh: _rcpi_dbmh,
-            rsni_dbh: 0,
-
-            ht_cap: Some(Box::new(fidl_mlme::HtCapabilities {
-                bytes: ie::fake_ht_capabilities().as_bytes().try_into().unwrap(),
-            })),
-            ht_op: None,
-            vht_cap: Some(Box::new(fidl_mlme::VhtCapabilities {
-                bytes: ie::fake_vht_capabilities().as_bytes().try_into().unwrap(),
-            })),
-            vht_op: None,
-            chan: fidl_common::WlanChan {
-                primary: 1,
-                secondary80: 0,
-                cbw: fidl_common::Cbw::Cbw20,
-            },
-            rssi_dbm: _rssi_dbm,
-            snr_db: 0,
-        };
-        ret
-    }
-
-    fn fake_wpa1_ie_body() -> Vec<u8> {
-        vec![
-            0x01, 0x00, // WPA version
-            0x00, 0x50, 0xf2, 0x02, // multicast cipher: AKM
-            0x01, 0x00, 0x00, 0x50, 0xf2, 0x02, // 1 unicast cipher: TKIP
-            0x01, 0x00, 0x00, 0x50, 0xf2, 0x02, // 1 AKM: PSK
-        ]
-    }
-
-    fn fake_wpa1_ie() -> Vec<u8> {
-        let mut ie = vec![
-            0xdd, 0x16, 0x00, 0x50, 0xf2, // IE header
-            0x01, // MSFT specific IE type (WPA)
-        ];
-        ie.append(&mut fake_wpa1_ie_body());
-        ie
-    }
-
-    fn fake_wpa2_legacy_rsne() -> Vec<u8> {
-        vec![
-            48, 18, // Element header
-            1, 0, // Version
-            0x00, 0x0F, 0xAC, 2, // Group Cipher: TKIP
-            1, 0, 0x00, 0x0F, 0xAC, 2, // 1 Pairwise Cipher: TKIP
-            1, 0, 0x00, 0x0F, 0xAC, 2, // 1 AKM: PSK
-        ]
-    }
-
-    fn fake_wpa2_rsne() -> Vec<u8> {
-        vec![
-            48, 18, // Element header
-            1, 0, // Version
-            0x00, 0x0F, 0xAC, 4, // Group Cipher: CCMP-128
-            1, 0, 0x00, 0x0F, 0xAC, 4, // 1 Pairwise Cipher: CCMP-128
-            1, 0, 0x00, 0x0F, 0xAC, 2, // 1 AKM: PSK
-        ]
-    }
-
-    fn fake_wpa3_rsne() -> Vec<u8> {
-        vec![
-            48, 18, // Element header
-            1, 0, // Version
-            0x00, 0x0F, 0xAC, 4, // Group Cipher: CCMP-128
-            1, 0, 0x00, 0x0F, 0xAC, 4, // 1 Pairwise Cipher: CCMP-128
-            1, 0, 0x00, 0x0F, 0xAC, 8, // 1 AKM: SAE
-            0xCC, 0x00, // RSN capabilities: MFP capable/required, 16 PTKSA replay counters
-        ]
-    }
-
-    fn fake_wpa2_wpa3_mixed_mode_rsne() -> Vec<u8> {
-        vec![
-            48, 18, // Element header
-            1, 0, // Version
-            0x00, 0x0F, 0xAC, 4, // Group Cipher: CCMP-128
-            1, 0, 0x00, 0x0F, 0xAC, 4, // 1 Pairwise Cipher: CCMP-128
-            2, 0, 0x00, 0x0F, 0xAC, 8, 0x00, 0x0F, 0xAC, 2, // 2 AKM:  SAE, PSK
-            0x8C, 0x00, // RSN capabilities: MFP capable, 16 PTKSA replay counters
-        ]
-    }
-
-    fn fake_eap_rsne() -> Vec<u8> {
-        vec![
-            48, 18, // Element header
-            1, 0, // Version
-            0x00, 0x0F, 0xAC, 4, // Group Cipher: CCMP-128
-            1, 0, 0x00, 0x0F, 0xAC, 4, // 1 Pairwise Cipher: CCMP-128
-            1, 0, 0x00, 0x0F, 0xAC, 1, // 1 AKM:  802.1X
-        ]
-    }
 }
diff --git a/src/connectivity/wlan/lib/sme/src/client/info/stats_collector.rs b/src/connectivity/wlan/lib/sme/src/client/info/stats_collector.rs
index 8a009d2..51f4b12 100644
--- a/src/connectivity/wlan/lib/sme/src/client/info/stats_collector.rs
+++ b/src/connectivity/wlan/lib/sme/src/client/info/stats_collector.rs
@@ -373,14 +373,16 @@
     use {
         super::*,
         crate::client::{
-            test_utils::{fake_bss_with_rates, fake_protected_bss_description, fake_scan_request},
-            EstablishRsnaFailure, EstablishRsnaFailureReason, SelectNetworkFailure,
+            test_utils::fake_scan_request, EstablishRsnaFailure, EstablishRsnaFailureReason,
+            SelectNetworkFailure,
         },
         anyhow::format_err,
-        wlan_common::assert_variant,
+        wlan_common::{assert_variant, fake_bss},
         wlan_rsn::auth,
     };
 
+    const SSID: &[u8; 3] = b"foo";
+
     #[test]
     fn test_discovery_scan_stats_lifecycle() {
         let mut stats_collector = StatsCollector::default();
@@ -388,7 +390,7 @@
         let is_connected = true;
         assert!(stats_collector.report_discovery_scan_started(req, is_connected).is_none());
 
-        let bss_desc = fake_bss_with_rates(b"foo".to_vec(), vec![12]);
+        let bss_desc = fake_bss!(Open, ssid: SSID.to_vec(), rates: vec![12]);
         let stats =
             stats_collector.report_discovery_scan_ended(ScanResult::Success, Some(&vec![bss_desc]));
         assert_variant!(stats, Ok(scan_stats) => {
@@ -418,7 +420,7 @@
             assert!(stats.assoc_time().is_some());
             assert!(stats.rsna_time().is_some());
             assert_eq!(stats.result, ConnectResult::Success);
-            let bss_desc = fake_protected_bss_description(b"foo".to_vec());
+            let bss_desc = fake_bss!(Wpa2, ssid: SSID.to_vec());
             assert_eq!(stats.candidate_network, Some(bss_desc));
         });
     }
@@ -431,7 +433,7 @@
         let scan_req = fake_scan_request();
         assert!(stats_collector.report_join_scan_started(scan_req, false).is_ok());
         assert!(stats_collector.report_join_scan_ended(ScanResult::Success, 1).is_ok());
-        let bss_desc = fake_protected_bss_description(b"foo".to_vec());
+        let bss_desc = fake_bss!(Wpa2, ssid: SSID.to_vec());
         assert!(stats_collector.report_candidate_network(bss_desc).is_ok());
         assert!(stats_collector.report_auth_started().is_ok());
         let result = ConnectResult::Failed(ConnectFailure::AuthenticationFailure(
@@ -605,7 +607,7 @@
     #[test]
     fn test_no_pending_discovery_scan_stats() {
         let mut stats_collector = StatsCollector::default();
-        let bss_desc = fake_protected_bss_description(b"foo".to_vec());
+        let bss_desc = fake_bss!(Wpa2, ssid: SSID.to_vec());
         let stats =
             stats_collector.report_discovery_scan_ended(ScanResult::Success, Some(&vec![bss_desc]));
         assert_variant!(stats, Err(StatsError::NoPendingScan));
@@ -617,7 +619,7 @@
             StatsCollector::default().report_join_scan_ended(ScanResult::Success, 1),
             Err(StatsError::NoPendingConnect)
         );
-        let bss_desc = fake_protected_bss_description(b"foo".to_vec());
+        let bss_desc = fake_bss!(Wpa2, ssid: SSID.to_vec());
         assert_variant!(
             StatsCollector::default().report_candidate_network(bss_desc),
             Err(StatsError::NoPendingConnect)
@@ -651,11 +653,11 @@
     fn simulate_connect_lifecycle(
         stats_collector: &mut StatsCollector,
     ) -> Result<ConnectStats, StatsError> {
-        assert!(stats_collector.report_connect_started(b"foo".to_vec()).is_none());
+        assert!(stats_collector.report_connect_started(SSID.to_vec()).is_none());
         let scan_req = fake_scan_request();
         assert!(stats_collector.report_join_scan_started(scan_req, false).is_ok());
         assert!(stats_collector.report_join_scan_ended(ScanResult::Success, 1).is_ok());
-        let bss_desc = fake_protected_bss_description(b"foo".to_vec());
+        let bss_desc = fake_bss!(Wpa2, ssid: SSID.to_vec());
         assert!(stats_collector.report_candidate_network(bss_desc).is_ok());
         assert!(stats_collector.report_auth_started().is_ok());
         assert!(stats_collector.report_assoc_started().is_ok());
diff --git a/src/connectivity/wlan/lib/sme/src/client/mod.rs b/src/connectivity/wlan/lib/sme/src/client/mod.rs
index 0a233be..e3b1d62 100644
--- a/src/connectivity/wlan/lib/sme/src/client/mod.rs
+++ b/src/connectivity/wlan/lib/sme/src/client/mod.rs
@@ -593,13 +593,10 @@
     use crate::Config as SmeConfig;
     use fidl_fuchsia_wlan_mlme as fidl_mlme;
     use fuchsia_inspect as finspect;
-    use wlan_common::{assert_variant, ie::rsn::akm, RadioConfig};
+    use wlan_common::{assert_variant, fake_bss, ie::rsn::akm, RadioConfig};
 
     use super::test_utils::{
         create_assoc_conf, create_auth_conf, create_join_conf, expect_stream_empty,
-        fake_bss_with_bssid, fake_bss_with_rates, fake_protected_bss_description,
-        fake_unprotected_bss_description, fake_wep_bss_description, fake_wpa3_bss_description,
-        fake_wpa3_mixed_bss_description,
     };
 
     use crate::test_utils;
@@ -624,31 +621,31 @@
 
         // Open network without credentials:
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
-        let bss = fake_unprotected_bss_description(b"unprotected".to_vec());
+        let bss = fake_bss!(Open);
         let protection = get_protection(&dev_info, &client_config, &credential, &bss);
         assert_variant!(protection, Ok(Protection::Open));
 
         // Open network with credentials:
         let credential = fidl_sme::Credential::Password(b"somepass".to_vec());
-        let bss = fake_unprotected_bss_description(b"unprotected".to_vec());
+        let bss = fake_bss!(Open);
         get_protection(&dev_info, &client_config, &credential, &bss)
             .expect_err("unprotected network cannot use password");
 
         // RSN with user entered password:
         let credential = fidl_sme::Credential::Password(b"somepass".to_vec());
-        let bss = fake_protected_bss_description(b"rsn".to_vec());
+        let bss = fake_bss!(Wpa2);
         let protection = get_protection(&dev_info, &client_config, &credential, &bss);
         assert_variant!(protection, Ok(Protection::Rsna(_)));
 
         // RSN with user entered PSK:
         let credential = fidl_sme::Credential::Psk(vec![0xAC; 32]);
-        let bss = fake_protected_bss_description(b"rsn".to_vec());
+        let bss = fake_bss!(Wpa2);
         let protection = get_protection(&dev_info, &client_config, &credential, &bss);
         assert_variant!(protection, Ok(Protection::Rsna(_)));
 
         // RSN without credentials:
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
-        let bss = fake_protected_bss_description(b"rsn".to_vec());
+        let bss = fake_bss!(Wpa2);
         get_protection(&dev_info, &client_config, &credential, &bss)
             .expect_err("protected network requires password");
     }
@@ -660,25 +657,25 @@
 
         // WEP-40 with credentials:
         let credential = fidl_sme::Credential::Password(b"wep40".to_vec());
-        let bss = fake_wep_bss_description(b"wep40".to_vec());
+        let bss = fake_bss!(Wep);
         let protection = get_protection(&dev_info, &client_config, &credential, &bss);
         assert_variant!(protection, Ok(Protection::Wep(_)));
 
         // WEP-104 with credentials:
         let credential = fidl_sme::Credential::Password(b"superinsecure".to_vec());
-        let bss = fake_wep_bss_description(b"wep104".to_vec());
+        let bss = fake_bss!(Wep);
         let protection = get_protection(&dev_info, &client_config, &credential, &bss);
         assert_variant!(protection, Ok(Protection::Wep(_)));
 
         // WEP without credentials:
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
-        let bss = fake_wep_bss_description(b"wep".to_vec());
+        let bss = fake_bss!(Wep);
         get_protection(&dev_info, &client_config, &credential, &bss)
             .expect_err("WEP network not supported");
 
         // WEP with invalid credentials:
         let credential = fidl_sme::Credential::Password(b"wep".to_vec());
-        let bss = fake_wep_bss_description(b"wep".to_vec());
+        let bss = fake_bss!(Wep);
         get_protection(&dev_info, &client_config, &credential, &bss)
             .expect_err("expected error for invalid WEP credentials");
     }
@@ -690,7 +687,7 @@
 
         // WPA3, supported
         let credential = fidl_sme::Credential::Password(b"somepass".to_vec());
-        let bss = fake_wpa3_bss_description(b"rsn".to_vec());
+        let bss = fake_bss!(Wpa3);
         let protection = get_protection(&dev_info, &client_config, &credential, &bss);
         assert_variant!(protection, Ok(Protection::Rsna(rsna)) => {
             assert_eq!(rsna.negotiated_protection.akm.suite_type, akm::SAE)
@@ -698,7 +695,7 @@
 
         // WPA2/3, supported
         let credential = fidl_sme::Credential::Password(b"somepass".to_vec());
-        let bss = fake_wpa3_mixed_bss_description(b"rsn".to_vec());
+        let bss = fake_bss!(Wpa2Wpa3);
         let protection = get_protection(&dev_info, &client_config, &credential, &bss);
         assert_variant!(protection, Ok(Protection::Rsna(rsna)) => {
             assert_eq!(rsna.negotiated_protection.akm.suite_type, akm::SAE)
@@ -708,13 +705,13 @@
 
         // WPA3, unsupported
         let credential = fidl_sme::Credential::Password(b"somepass".to_vec());
-        let bss = fake_wpa3_bss_description(b"rsn".to_vec());
+        let bss = fake_bss!(Wpa3);
         let protection = get_protection(&dev_info, &client_config, &credential, &bss);
         assert_variant!(protection, Err(_));
 
         // WPA2/3, WPA3 unsupported, downgrade to WPA2
         let credential = fidl_sme::Credential::Password(b"somepass".to_vec());
-        let bss = fake_wpa3_mixed_bss_description(b"rsn".to_vec());
+        let bss = fake_bss!(Wpa2Wpa3);
         let protection = get_protection(&dev_info, &client_config, &credential, &bss);
         assert_variant!(protection, Ok(Protection::Rsna(rsna)) => {
             assert_eq!(rsna.negotiated_protection.akm.suite_type, akm::PSK)
@@ -739,7 +736,7 @@
 
         // Push a fake scan result into SME. We should still be connecting to "foo",
         // but the status should now come from the state machine and not from the scanner.
-        report_fake_scan_result(&mut sme, fake_unprotected_bss_description(b"foo".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Open, ssid: b"foo".to_vec()));
         assert_eq!(Some(b"foo".to_vec()), sme.state.as_ref().unwrap().status().connecting_to);
         assert_eq!(
             Status { connected_to: None, connecting_to: Some(b"foo".to_vec()) },
@@ -783,7 +780,7 @@
 
         // Simulate scan end and verify that underlying state machine's status is changed,
         // and a join request is sent to MLME.
-        report_fake_scan_result(&mut sme, fake_wep_bss_description(b"foo".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Wep, ssid: b"foo".to_vec()));
         assert_eq!(Some(b"foo".to_vec()), sme.state.as_ref().unwrap().status().connecting_to);
         assert_eq!(
             Status { connected_to: None, connecting_to: Some(b"foo".to_vec()) },
@@ -812,7 +809,7 @@
         assert_variant!(mlme_stream.try_next(), Ok(Some(MlmeRequest::Scan(..))));
 
         // Simulate scan end and verify that underlying state machine's status is not changed,
-        report_fake_scan_result(&mut sme, fake_wep_bss_description(b"foo".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Wep, ssid: b"foo".to_vec()));
         assert_eq!(None, sme.state.as_ref().unwrap().status().connecting_to);
         assert_connect_result_failed(&mut connect_fut);
     }
@@ -837,7 +834,7 @@
 
         // Simulate scan end and verify that underlying state machine's status is changed,
         // and a join request is sent to MLME.
-        report_fake_scan_result(&mut sme, fake_protected_bss_description(b"foo".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Wpa2, ssid: b"foo".to_vec()));
         assert_eq!(Some(b"foo".to_vec()), sme.state.as_ref().unwrap().status().connecting_to);
         assert_eq!(
             Status { connected_to: None, connecting_to: Some(b"foo".to_vec()) },
@@ -877,7 +874,7 @@
 
         // Simulate scan end and verify that underlying state machine's status is changed,
         // and a join request is sent to MLME.
-        report_fake_scan_result(&mut sme, fake_protected_bss_description(b"IEEE".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Wpa2, ssid: b"IEEE".to_vec()));
         assert_eq!(Some(b"IEEE".to_vec()), sme.state.as_ref().unwrap().status().connecting_to);
         assert_eq!(
             Status { connected_to: None, connecting_to: Some(b"IEEE".to_vec()) },
@@ -905,7 +902,7 @@
         // because a password was supplied for unprotected network. So both the
         // SME client and underlying state machine should report not connecting
         // anymore.
-        report_fake_scan_result(&mut sme, fake_unprotected_bss_description(b"foo".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Open, ssid: b"foo".to_vec()));
         assert_eq!(None, sme.state.as_ref().unwrap().status().connecting_to);
         assert_eq!(Status { connected_to: None, connecting_to: None }, sme.status());
 
@@ -957,7 +954,7 @@
         // because a password was supplied for unprotected network. So both the
         // SME client and underlying state machine should report not connecting
         // anymore.
-        report_fake_scan_result(&mut sme, fake_unprotected_bss_description(b"foo".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Open, ssid: b"foo".to_vec()));
         assert_eq!(None, sme.state.as_ref().unwrap().status().connecting_to);
         assert_eq!(Status { connected_to: None, connecting_to: None }, sme.status());
 
@@ -1007,7 +1004,7 @@
 
         // Push a fake scan result into SME. We should not attempt to connect
         // because no password was supplied for a protected network.
-        report_fake_scan_result(&mut sme, fake_protected_bss_description(b"foo".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Wpa2, ssid: b"foo".to_vec()));
         assert_eq!(None, sme.state.as_ref().unwrap().status().connecting_to);
         assert_eq!(Status { connected_to: None, connecting_to: None }, sme.status());
 
@@ -1047,7 +1044,7 @@
 
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
         let mut connect_fut = sme.on_connect_command(connect_req(b"foo".to_vec(), credential));
-        let bss_desc = fake_unprotected_bss_description(b"bar".to_vec());
+        let bss_desc = fake_bss!(Open, ssid: b"bar".to_vec());
         report_fake_scan_result(&mut sme, bss_desc);
 
         assert_variant!(connect_fut.try_recv(), Ok(Some(failure)) => {
@@ -1061,9 +1058,11 @@
 
         let credential = fidl_sme::Credential::Password(b"password".to_vec());
         let mut connect_fut = sme.on_connect_command(connect_req(b"foo".to_vec(), credential));
-        let mut bss_desc = fake_protected_bss_description(b"foo".to_vec());
+        let bss_desc = fidl_mlme::BssDescription {
+            cap: wlan_common::mac::CapabilityInfo(0).with_privacy(false).0,
+            ..fake_bss!(Wpa2, ssid: b"foo".to_vec())
+        };
         // Make our check flag this BSS as incompatible
-        bss_desc.cap = wlan_common::mac::CapabilityInfo(bss_desc.cap).with_privacy(false).0;
         report_fake_scan_result(&mut sme, bss_desc);
 
         assert_variant!(connect_fut.try_recv(), Ok(Some(failure)) => {
@@ -1098,7 +1097,7 @@
         assert_connect_result(&mut connect_fut1, ConnectResult::Canceled);
         // Report scan result to transition second connection attempt past scan. This is to verify
         // that connection attempt will be canceled even in the middle of joining the network
-        report_fake_scan_result(&mut sme, fake_unprotected_bss_description(b"foo".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Open, ssid: b"foo".to_vec()));
 
         let req3 = connect_req(b"foo".to_vec(), fidl_sme::Credential::None(fidl_sme::Empty));
         let mut _connect_fut3 = sme.on_connect_command(req3);
@@ -1114,7 +1113,7 @@
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
         let _recv = sme.on_connect_command(connect_req(b"foo".to_vec(), credential));
 
-        let bss_desc = fake_unprotected_bss_description(b"foo".to_vec());
+        let bss_desc = fake_bss!(Open, ssid: b"foo".to_vec());
         let bssid = bss_desc.bssid;
         report_fake_scan_result(&mut sme, bss_desc);
 
@@ -1146,7 +1145,7 @@
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
         let _recv = sme.on_connect_command(connect_req(b"foo".to_vec(), credential));
 
-        let bss_desc = fake_unprotected_bss_description(b"foo".to_vec());
+        let bss_desc = fake_bss!(Open, ssid: b"foo".to_vec());
         let bssid = bss_desc.bssid;
         report_fake_scan_result(&mut sme, bss_desc);
 
@@ -1191,7 +1190,7 @@
         });
 
         // Old scan finishes. However, no join scan stats is sent
-        report_fake_scan_result(&mut sme, fake_unprotected_bss_description(b"foo".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Open, ssid: b"foo".to_vec()));
         assert_variant!(info_stream.try_next(), Err(_));
     }
 
@@ -1202,7 +1201,7 @@
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
         let _recv = sme.on_connect_command(connect_req(b"foo".to_vec(), credential));
 
-        report_fake_scan_result(&mut sme, fake_unprotected_bss_description(b"foo".to_vec()));
+        report_fake_scan_result(&mut sme, fake_bss!(Open, ssid: b"foo".to_vec()));
 
         // Send another connect request, which should cancel first one
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
@@ -1222,16 +1221,16 @@
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
         let _recv = sme.on_connect_command(connect_req(b"foo".to_vec(), credential));
 
-        let bss = fake_unprotected_bss_description(b"foo".to_vec());
+        let bss = fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [1; 6]);
         sme.on_mlme_event(MlmeEvent::OnScanResult {
             result: fidl_mlme::ScanResult { txn_id: 1, bss },
         });
-        let bss = fake_bss_with_bssid(b"foo".to_vec(), [3; 6]);
+        let bss = fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [3; 6]);
         sme.on_mlme_event(MlmeEvent::OnScanResult {
             result: fidl_mlme::ScanResult { txn_id: 1, bss },
         });
         // This scan result should not be counted since it's not the SSID we request
-        let bss = fake_unprotected_bss_description(b"bar".to_vec());
+        let bss = fake_bss!(Open, ssid: b"bar".to_vec());
         sme.on_mlme_event(MlmeEvent::OnScanResult {
             result: fidl_mlme::ScanResult { txn_id: 1, bss },
         });
@@ -1254,11 +1253,11 @@
         let mut recv =
             sme.on_scan_command(fidl_sme::ScanRequest::Passive(fidl_sme::PassiveScanRequest {}));
 
-        let bss = fake_bss_with_bssid(b"foo".to_vec(), [3; 6]);
+        let bss = fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [3; 6]);
         sme.on_mlme_event(MlmeEvent::OnScanResult {
             result: fidl_mlme::ScanResult { txn_id: 1, bss },
         });
-        let bss = fake_bss_with_bssid(b"foo".to_vec(), [4; 6]);
+        let bss = fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [4; 6]);
         sme.on_mlme_event(MlmeEvent::OnScanResult {
             result: fidl_mlme::ScanResult { txn_id: 1, bss },
         });
@@ -1284,7 +1283,7 @@
                 channels: vec![],
             }));
 
-        report_fake_scan_result(&mut sme, fake_bss_with_rates(b"foo".to_vec(), vec![12]));
+        report_fake_scan_result(&mut sme, fake_bss!(Open, rates: vec![12]));
 
         assert_variant!(info_stream.try_next(), Ok(Some(InfoEvent::DiscoveryScanStats(scan_stats))) => {
             assert!(!scan_stats.scan_start_while_connected);
diff --git a/src/connectivity/wlan/lib/sme/src/client/rsn.rs b/src/connectivity/wlan/lib/sme/src/client/rsn.rs
index 097f0dc..896f594 100644
--- a/src/connectivity/wlan/lib/sme/src/client/rsn.rs
+++ b/src/connectivity/wlan/lib/sme/src/client/rsn.rs
@@ -182,20 +182,14 @@
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::{
-        client::test_utils::{
-            fake_protected_bss_description, fake_unprotected_bss_description,
-            fake_wpa3_bss_description,
-        },
-        test_utils::fake_device_info,
-    };
-    use wlan_common::assert_variant;
+    use crate::test_utils::fake_device_info;
+    use wlan_common::{assert_variant, fake_bss};
 
     const CLIENT_ADDR: [u8; 6] = [0x7A, 0xE7, 0x76, 0xD9, 0xF2, 0x67];
 
     #[test]
     fn test_get_rsna_password_for_unprotected_network() {
-        let bss = fake_unprotected_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Open);
         let credential = fidl_sme::Credential::Password("somepass".as_bytes().to_vec());
         let rsna = get_wpa2_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss);
         assert!(rsna.is_err(), "expect error when password is supplied for unprotected network")
@@ -203,7 +197,7 @@
 
     #[test]
     fn test_get_rsna_no_password_for_protected_network() {
-        let bss = fake_protected_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa2);
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
         let rsna = get_wpa2_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss);
         assert!(rsna.is_err(), "expect error when no password is supplied for protected network")
@@ -211,7 +205,7 @@
 
     #[test]
     fn test_get_rsna_psk() {
-        let bss = fake_protected_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa2);
         let credential = fidl_sme::Credential::Psk(vec![0xAA; 32]);
         get_wpa2_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect("expected successful RSNA with valid PSK");
@@ -219,7 +213,7 @@
 
     #[test]
     fn test_wpa2_get_auth_method() {
-        let bss = fake_protected_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa2);
         let credential = fidl_sme::Credential::Psk(vec![0xAA; 32]);
         let protection = get_wpa2_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect("expected successful RSNA with valid PSK");
@@ -230,7 +224,7 @@
 
     #[test]
     fn test_wpa2_get_auth_config() {
-        let bss = fake_protected_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa2);
         let credential = fidl_sme::Credential::Psk(vec![0xAA; 32]);
         let protection = get_wpa2_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect("expected successful RSNA with valid PSK");
@@ -241,7 +235,7 @@
 
     #[test]
     fn test_get_rsna_invalid_psk() {
-        let bss = fake_protected_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa2);
         // PSK too short
         let credential = fidl_sme::Credential::Psk(vec![0xAA; 31]);
         get_wpa2_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss)
@@ -250,7 +244,7 @@
 
     #[test]
     fn test_get_rsna_wpa3() {
-        let bss = fake_wpa3_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa3);
         let credential = fidl_sme::Credential::Password(vec![0xBB; 8]);
         get_wpa3_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect("expected successful SAE RSNA with valid credential");
@@ -258,7 +252,7 @@
 
     #[test]
     fn test_wpa3_get_auth_method() {
-        let bss = fake_wpa3_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa3);
         let credential = fidl_sme::Credential::Password(vec![0xBB; 8]);
         let protection = get_wpa3_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect("expected successful SAE RSNA with valid credential");
@@ -269,7 +263,7 @@
 
     #[test]
     fn test_wpa3_get_auth_config() {
-        let bss = fake_wpa3_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa3);
         let credential = fidl_sme::Credential::Password(vec![0xBB; 8]);
         let protection = get_wpa3_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect("expected successful SAE RSNA with valid credential");
@@ -280,7 +274,7 @@
 
     #[test]
     fn test_get_rsna_wpa3_psk_fails() {
-        let bss = fake_wpa3_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa3);
         let credential = fidl_sme::Credential::Psk(vec![0xAA; 32]);
         get_wpa3_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect_err("expected WPA3 RSNA failure with PSK");
diff --git a/src/connectivity/wlan/lib/sme/src/client/scan.rs b/src/connectivity/wlan/lib/sme/src/client/scan.rs
index e571d0e..314fe42 100644
--- a/src/connectivity/wlan/lib/sme/src/client/scan.rs
+++ b/src/connectivity/wlan/lib/sme/src/client/scan.rs
@@ -425,12 +425,9 @@
 mod tests {
     use super::*;
 
-    use crate::client::test_utils::{
-        fake_bss_with_bssid, fake_bss_with_vendor_ies, fake_unprotected_bss_description,
-    };
     use crate::clone_utils::clone_bss_desc;
     use crate::test_utils;
-    use wlan_common::assert_variant;
+    use wlan_common::{assert_variant, fake_bss};
 
     const CLIENT_ADDR: [u8; 6] = [0x7A, 0xE7, 0x76, 0xD9, 0xF2, 0x67];
 
@@ -447,15 +444,15 @@
         let txn_id = req.txn_id;
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_unprotected_bss_description(b"foo".to_vec()),
+            bss: fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [1; 6]),
         });
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id: txn_id + 100, // mismatching transaction id
-            bss: fake_unprotected_bss_description(b"bar".to_vec()),
+            bss: fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [2; 6]),
         });
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_bss_with_bssid(b"qux".to_vec(), [3; 6]),
+            bss: fake_bss!(Open, ssid: b"qux".to_vec(), bssid: [3; 6]),
         });
         let (result, req) = sched.on_mlme_scan_end(fidl_mlme::ScanEnd {
             txn_id,
@@ -485,12 +482,12 @@
         let txn_id = req.txn_id;
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_unprotected_bss_description(b"bar".to_vec()),
+            bss: fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [1; 6]),
         });
         // A new scan result with the same BSSID replaces the previous result.
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_unprotected_bss_description(b"baz".to_vec()),
+            bss: fake_bss!(Open, ssid: b"baz".to_vec(), bssid: [1; 6]),
         });
         let (result, req) = sched.on_mlme_scan_end(fidl_mlme::ScanEnd {
             txn_id,
@@ -575,7 +572,7 @@
         // Report a scan result
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_unprotected_bss_description(b"foo".to_vec()),
+            bss: fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [1; 6]),
         });
 
         // Post another command. It should not issue another request to the MLME since
@@ -585,7 +582,7 @@
         // Report another scan result and the end of the scan transaction
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_bss_with_bssid(b"bar".to_vec(), [3; 6]),
+            bss: fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [2; 6]),
         });
         let (result, req) = sched.on_mlme_scan_end(fidl_mlme::ScanEnd {
             txn_id,
@@ -637,7 +634,7 @@
         // Report scan result and scan end
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_unprotected_bss_description(b"foo".to_vec()),
+            bss: fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [1; 6]),
         });
         let (result, mlme_req) = sched.on_mlme_scan_end(fidl_mlme::ScanEnd {
             txn_id,
@@ -656,7 +653,7 @@
         // Report scan result and scan end
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_unprotected_bss_description(b"bar".to_vec()),
+            bss: fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [2; 6]),
         });
         let (result, mlme_req) = sched.on_mlme_scan_end(fidl_mlme::ScanEnd {
             txn_id,
@@ -698,19 +695,19 @@
         let txn_id = req.expect("expected a ScanRequest").txn_id;
 
         // Matching BSS
-        let bss1 = fake_bss_with_bssid(b"foo".to_vec(), [1, 1, 1, 1, 1, 1]);
+        let bss1 = fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [1; 6]);
         sched.on_mlme_scan_result(fidl_mlme::ScanResult { txn_id, bss: clone_bss_desc(&bss1) });
 
         // Mismatching transaction ID
-        let bss2 = fake_bss_with_bssid(b"foo".to_vec(), [2, 2, 2, 2, 2, 2]);
+        let bss2 = fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [2; 6]);
         sched.on_mlme_scan_result(fidl_mlme::ScanResult { txn_id: txn_id + 100, bss: bss2 });
 
         // Mismatching SSID
-        let bss3 = fake_bss_with_bssid(b"bar".to_vec(), [3, 3, 3, 3, 3, 3]);
+        let bss3 = fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [3; 6]);
         sched.on_mlme_scan_result(fidl_mlme::ScanResult { txn_id, bss: bss3 });
 
         // Matching BSS
-        let bss4 = fake_bss_with_bssid(b"foo".to_vec(), [4, 4, 4, 4, 4, 4]);
+        let bss4 = fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [4; 6]);
         sched.on_mlme_scan_result(fidl_mlme::ScanResult { txn_id, bss: clone_bss_desc(&bss4) });
 
         let (result, req) = sched.on_mlme_scan_end(fidl_mlme::ScanEnd {
@@ -897,15 +894,15 @@
         let txn_id = req.txn_id;
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_unprotected_bss_description(b"foo".to_vec()),
+            bss: fake_bss!(Open, ssid: b"foo".to_vec()),
         });
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_bss_with_vendor_ies(b"foo".to_vec(), probe_resp_wsc_ie()),
+            bss: fake_bss!(Open, ssid: b"foo".to_vec(), vendor_ies: Some(probe_resp_wsc_ie())),
         });
         sched.on_mlme_scan_result(fidl_mlme::ScanResult {
             txn_id,
-            bss: fake_unprotected_bss_description(b"foo".to_vec()),
+            bss: fake_bss!(Open, ssid: b"foo".to_vec()),
         });
         let (result, _req) = sched.on_mlme_scan_end(fidl_mlme::ScanEnd {
             txn_id,
diff --git a/src/connectivity/wlan/lib/sme/src/client/state/mod.rs b/src/connectivity/wlan/lib/sme/src/client/state/mod.rs
index 7b70f3f..f8a0119 100644
--- a/src/connectivity/wlan/lib/sme/src/client/state/mod.rs
+++ b/src/connectivity/wlan/lib/sme/src/client/state/mod.rs
@@ -1201,11 +1201,12 @@
 mod tests {
     use super::*;
     use anyhow::format_err;
+    use fidl_fuchsia_wlan_common as fidl_common;
     use fuchsia_inspect::Inspector;
     use futures::channel::{mpsc, oneshot};
     use link_state::{EstablishingRsna, LinkUp};
     use std::sync::Arc;
-    use wlan_common::{assert_variant, ie::rsn::rsne::Rsne, RadioConfig};
+    use wlan_common::{assert_variant, fake_bss, ie::rsn::rsne::Rsne, RadioConfig};
     use wlan_rsn::{key::exchange::Key, rsna::SecAssocStatus};
     use wlan_rsn::{
         rsna::{SecAssocUpdate, UpdateSink},
@@ -1214,14 +1215,13 @@
 
     use crate::client::test_utils::{
         create_assoc_conf, create_auth_conf, create_join_conf, expect_stream_empty,
-        fake_negotiated_channel_and_capabilities, fake_protected_bss_description,
-        fake_unprotected_bss_description, fake_wep_bss_description, fake_wmm_param,
-        fake_wpa1_bss_description, mock_psk_supplicant, MockSupplicant, MockSupplicantController,
+        fake_negotiated_channel_and_capabilities, fake_wmm_param, mock_psk_supplicant,
+        MockSupplicant, MockSupplicantController,
     };
     use crate::client::{info::InfoReporter, inspect, rsn::Rsna, InfoEvent, InfoSink, TimeStream};
     use crate::test_utils::make_wpa1_ie;
 
-    use crate::{test_utils, timer, InfoStream, MlmeStream, Ssid};
+    use crate::{test_utils, timer, InfoStream, MlmeStream};
 
     #[test]
     fn associate_happy_path_unprotected() {
@@ -1928,7 +1928,7 @@
     #[test]
     fn increment_att_id_on_disassociate_ind() {
         let mut h = TestHelper::new();
-        let state = link_up_state(Box::new(unprotected_bss(b"bar".to_vec(), [8, 8, 8, 8, 8, 8])));
+        let state = link_up_state(Box::new(fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [8; 6])));
         assert_eq!(h.context.att_id, 0);
 
         let disassociate_ind = MlmeEvent::DisassociateInd {
@@ -1940,7 +1940,7 @@
         };
 
         let state = state.on_mlme_event(disassociate_ind, &mut h.context);
-        assert_associating(state, &unprotected_bss(b"bar".to_vec(), [8, 8, 8, 8, 8, 8]));
+        assert_associating(state, &fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [8; 6]));
         assert_eq!(h.context.att_id, 1);
     }
 
@@ -1991,7 +1991,7 @@
     #[test]
     fn disconnect_reported_on_deauth_ind() {
         let mut h = TestHelper::new();
-        let state = link_up_state(Box::new(unprotected_bss(b"bar".to_vec(), [8, 8, 8, 8, 8, 8])));
+        let state = link_up_state(Box::new(fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [8; 6])));
 
         let deauth_ind = MlmeEvent::DeauthenticateInd {
             ind: fidl_mlme::DeauthenticateIndication {
@@ -2015,7 +2015,7 @@
     #[test]
     fn disconnect_reported_on_disassoc_ind() {
         let mut h = TestHelper::new();
-        let state = link_up_state(Box::new(unprotected_bss(b"bar".to_vec(), [8, 8, 8, 8, 8, 8])));
+        let state = link_up_state(Box::new(fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [8; 6])));
 
         let deauth_ind = MlmeEvent::DisassociateInd {
             ind: fidl_mlme::DisassociateIndication {
@@ -2039,7 +2039,7 @@
     #[test]
     fn disconnect_reported_on_manual_disconnect() {
         let mut h = TestHelper::new();
-        let state = link_up_state(Box::new(unprotected_bss(b"bar".to_vec(), [8, 8, 8, 8, 8, 8])));
+        let state = link_up_state(Box::new(fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [8; 6])));
 
         let _state = state.disconnect(&mut h.context);
         assert_variant!(h.info_stream.try_next(), Ok(Some(InfoEvent::DisconnectInfo(info))) => {
@@ -2055,7 +2055,15 @@
     #[test]
     fn bss_channel_switch_ind() {
         let mut h = TestHelper::new();
-        let state = link_up_state(Box::new(unprotected_bss(b"bar".to_vec(), [8, 8, 8, 8, 8, 8])));
+        let state = link_up_state(Box::new(fake_bss!(Open,
+                                                     ssid: b"bar".to_vec(),
+                                                     bssid: [8; 6],
+                                                     chan: fidl_common::WlanChan {
+                                                         primary: 1,
+                                                         secondary80: 0,
+                                                         cbw: fidl_common::Cbw::Cbw20
+                                                     }
+        )));
 
         let switch_ind =
             MlmeEvent::OnChannelSwitched { info: fidl_mlme::ChannelSwitchInfo { new_channel: 36 } };
@@ -2186,7 +2194,8 @@
     fn status_returns_last_rssi_snr() {
         let mut h = TestHelper::new();
 
-        let state = link_up_state(Box::new(unprotected_bss(b"RSSI".to_vec(), [42; 6])));
+        let state =
+            link_up_state(Box::new(fake_bss!(Open, ssid: b"RSSI".to_vec(), bssid: [42; 6])));
         let state = state.on_mlme_event(signal_report_with_rssi_snr(-42, 20), &mut h.context);
         assert_eq!(state.status().connected_to.unwrap().rx_dbm, -42);
         assert_eq!(state.status().connected_to.unwrap().snr_db, 20);
@@ -2311,9 +2320,9 @@
         mlme_stream: &mut MlmeStream,
         chan_and_cap: (Channel, ClientCapabilities),
     ) {
-        let (chan, join_cap) = chan_and_cap;
+        let (chan, client_cap) = chan_and_cap;
         assert_variant!(mlme_stream.try_next(), Ok(Some(MlmeRequest::FinalizeAssociation(cap))) => {
-            assert_eq!(cap, join_cap.0.to_fidl_negotiated_capabilities(&chan));
+            assert_eq!(cap, client_cap.0.to_fidl_negotiated_capabilities(&chan));
         });
     }
 
@@ -2405,7 +2414,7 @@
     fn connect_command_one() -> (ConnectCommand, oneshot::Receiver<ConnectResult>) {
         let (responder, receiver) = Responder::new();
         let cmd = ConnectCommand {
-            bss: Box::new(unprotected_bss(b"foo".to_vec(), [7, 7, 7, 7, 7, 7])),
+            bss: Box::new(fake_bss!(Open, ssid: b"foo".to_vec(), bssid: [7, 7, 7, 7, 7, 7])),
             responder: Some(responder),
             protection: Protection::Open,
             radio_cfg: RadioConfig::default(),
@@ -2416,7 +2425,7 @@
     fn connect_command_two() -> (ConnectCommand, oneshot::Receiver<ConnectResult>) {
         let (responder, receiver) = Responder::new();
         let cmd = ConnectCommand {
-            bss: Box::new(unprotected_bss(b"bar".to_vec(), [8, 8, 8, 8, 8, 8])),
+            bss: Box::new(fake_bss!(Open, ssid: b"bar".to_vec(), bssid: [8, 8, 8, 8, 8, 8])),
             responder: Some(responder),
             protection: Protection::Open,
             radio_cfg: RadioConfig::default(),
@@ -2427,7 +2436,7 @@
     fn connect_command_wep() -> (ConnectCommand, oneshot::Receiver<ConnectResult>) {
         let (responder, receiver) = Responder::new();
         let cmd = ConnectCommand {
-            bss: Box::new(fake_wep_bss_description(b"wep".to_vec())),
+            bss: Box::new(fake_bss!(Wep, ssid: b"wep".to_vec())),
             responder: Some(responder),
             protection: Protection::Wep(wep_deprecated::Key::Bits40([3; 5])),
             radio_cfg: RadioConfig::default(),
@@ -2441,7 +2450,7 @@
         let (responder, receiver) = Responder::new();
         let wpa_ie = make_wpa1_ie();
         let cmd = ConnectCommand {
-            bss: Box::new(fake_wpa1_bss_description(b"wpa1".to_vec())),
+            bss: Box::new(fake_bss!(Wpa1, ssid: b"wpa1".to_vec())),
             responder: Some(responder),
             protection: Protection::LegacyWpa(Rsna {
                 negotiated_protection: NegotiatedProtection::from_legacy_wpa(&wpa_ie)
@@ -2457,7 +2466,7 @@
         supplicant: MockSupplicant,
     ) -> (ConnectCommand, oneshot::Receiver<ConnectResult>) {
         let (responder, receiver) = Responder::new();
-        let bss = protected_bss(b"foo".to_vec(), [7, 7, 7, 7, 7, 7]);
+        let bss = fake_bss!(Wpa2, ssid: b"wpa2".to_vec());
         let rsne = Rsne::wpa2_psk_ccmp_rsne();
         let cmd = ConnectCommand {
             bss: Box::new(bss),
@@ -2575,7 +2584,7 @@
     }
 
     fn link_up_state_protected(supplicant: MockSupplicant, bssid: [u8; 6]) -> ClientState {
-        let bss = protected_bss(b"foo".to_vec(), bssid);
+        let bss = fidl_mlme::BssDescription { ssid: b"foo".to_vec(), bssid, ..fake_bss!(Wpa2) };
         let rsne = Rsne::wpa2_psk_ccmp_rsne();
         let rsna = Rsna {
             negotiated_protection: NegotiatedProtection::from_rsne(&rsne)
@@ -2604,14 +2613,6 @@
         .into()
     }
 
-    fn protected_bss(ssid: Ssid, bssid: [u8; 6]) -> fidl_mlme::BssDescription {
-        fidl_mlme::BssDescription { bssid, ..fake_protected_bss_description(ssid) }
-    }
-
-    fn unprotected_bss(ssid: Ssid, bssid: [u8; 6]) -> fidl_mlme::BssDescription {
-        fidl_mlme::BssDescription { bssid, ..fake_unprotected_bss_description(ssid) }
-    }
-
     fn fake_device_info() -> fidl_mlme::DeviceInfo {
         test_utils::fake_device_info([0, 1, 2, 3, 4, 5])
     }
diff --git a/src/connectivity/wlan/lib/sme/src/client/test_utils.rs b/src/connectivity/wlan/lib/sme/src/client/test_utils.rs
index abdf8df..3b93ab9 100644
--- a/src/connectivity/wlan/lib/sme/src/client/test_utils.rs
+++ b/src/connectivity/wlan/lib/sme/src/client/test_utils.rs
@@ -6,150 +6,42 @@
     crate::{
         capabilities::{ClientCapabilities, StaCapabilities},
         client::{bss::BssInfo, rsn::Supplicant},
-        test_utils::*,
         Ssid,
     },
-    fidl_fuchsia_wlan_common as fidl_common, fidl_fuchsia_wlan_mlme as fidl_mlme,
+    fidl_fuchsia_wlan_mlme as fidl_mlme,
     futures::channel::mpsc,
-    std::{
-        convert::TryInto,
-        sync::{
-            atomic::{AtomicBool, Ordering},
-            Arc, Mutex,
-        },
+    std::sync::{
+        atomic::{AtomicBool, Ordering},
+        Arc, Mutex,
     },
     wlan_common::{
         assert_variant,
         bss::Protection,
         channel,
-        ie::{rsn::rsne::Rsne, write_wpa1_ie, *},
-        mac,
+        ie::{
+            fake_ies::{fake_ht_cap_bytes, fake_vht_cap_bytes},
+            *,
+        },
     },
     wlan_rsn::{auth, format_rsn_err, rsna::UpdateSink, Error},
-    zerocopy::AsBytes,
 };
 
-fn fake_bss_description(ssid: Ssid, rsne: Option<Vec<u8>>) -> fidl_mlme::BssDescription {
-    fidl_mlme::BssDescription {
-        bssid: [7, 1, 2, 77, 53, 8],
-        ssid,
-        bss_type: fidl_mlme::BssTypes::Infrastructure,
-        beacon_period: 100,
-        dtim_period: 100,
-        timestamp: 0,
-        local_time: 0,
-        cap: mac::CapabilityInfo(0).with_privacy(rsne.is_some()).0,
-        rates: vec![0x82, 0x84, 0x8b, 0x96, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6c],
-        country: None,
-        rsne,
-        vendor_ies: None,
-
-        rcpi_dbmh: 0,
-        rsni_dbh: 0,
-
-        ht_cap: Some(Box::new(fidl_mlme::HtCapabilities { bytes: fake_ht_cap_bytes() })),
-        ht_op: Some(Box::new(fidl_mlme::HtOperation { bytes: fake_ht_op_bytes() })),
-        vht_cap: Some(Box::new(fidl_mlme::VhtCapabilities { bytes: fake_vht_cap_bytes() })),
-        vht_op: Some(Box::new(fidl_mlme::VhtOperation { bytes: fake_vht_op_bytes() })),
-        chan: fidl_common::WlanChan { primary: 1, secondary80: 0, cbw: fidl_common::Cbw::Cbw40 },
-        rssi_dbm: 0,
-        snr_db: 0,
-    }
-}
-
-pub fn fake_bss_with_bssid(ssid: Ssid, bssid: [u8; 6]) -> fidl_mlme::BssDescription {
-    fidl_mlme::BssDescription { bssid, ..fake_unprotected_bss_description(ssid) }
-}
-
-pub fn fake_bss_with_rates(ssid: Ssid, rates: Vec<u8>) -> fidl_mlme::BssDescription {
-    fidl_mlme::BssDescription { rates, ..fake_unprotected_bss_description(ssid) }
-}
-
-pub fn fake_bss_with_vendor_ies(ssid: Ssid, vendor_ies: Vec<u8>) -> fidl_mlme::BssDescription {
-    fidl_mlme::BssDescription {
-        vendor_ies: Some(vendor_ies),
-        ..fake_unprotected_bss_description(ssid)
-    }
-}
-
-pub fn fake_unprotected_bss_description(ssid: Ssid) -> fidl_mlme::BssDescription {
-    fake_bss_description(ssid, None)
-}
-
-pub fn fake_wep_bss_description(ssid: Ssid) -> fidl_mlme::BssDescription {
-    let mut bss = fake_bss_description(ssid, None);
-    bss.cap = mac::CapabilityInfo(bss.cap).with_privacy(true).0;
-    bss
-}
-
-pub fn fake_wpa1_bss_description(ssid: Ssid) -> fidl_mlme::BssDescription {
-    let mut bss = fake_bss_description(ssid, None);
-    bss.cap = mac::CapabilityInfo(bss.cap).with_privacy(true).0;
-    let mut vendor_ies = vec![];
-    write_wpa1_ie(&mut vendor_ies, &make_wpa1_ie()).expect("failed to create wpa1 bss description");
-    bss.vendor_ies = Some(vendor_ies);
-    bss
-}
-
-pub fn fake_protected_bss_description(ssid: Ssid) -> fidl_mlme::BssDescription {
-    let a_rsne = Rsne::wpa2_psk_ccmp_rsne();
-    fake_bss_description(ssid, Some(a_rsne.into_bytes()))
-}
-
-pub fn fake_wpa3_mixed_bss_description(ssid: Ssid) -> fidl_mlme::BssDescription {
-    let a_rsne = Rsne::wpa3_mixed_psk_ccmp_rsne();
-    fake_bss_description(ssid, Some(a_rsne.into_bytes()))
-}
-
-pub fn fake_wpa3_bss_description(ssid: Ssid) -> fidl_mlme::BssDescription {
-    let a_rsne = Rsne::wpa3_ccmp_rsne();
-    fake_bss_description(ssid, Some(a_rsne.into_bytes()))
-}
-
-pub fn fake_vht_bss_description() -> fidl_mlme::BssDescription {
-    let bss = fake_bss_description(vec![], None);
-    fidl_mlme::BssDescription {
-        chan: fake_chan(36),
-        ht_cap: Some(Box::new(fidl_mlme::HtCapabilities {
-            bytes: fake_ht_capabilities().as_bytes().try_into().unwrap(),
-        })),
-        ht_op: Some(Box::new(fidl_mlme::HtOperation {
-            bytes: fake_ht_operation().as_bytes().try_into().unwrap(),
-        })),
-        vht_cap: Some(Box::new(fidl_mlme::VhtCapabilities {
-            bytes: fake_vht_capabilities().as_bytes().try_into().unwrap(),
-        })),
-        vht_op: Some(Box::new(fidl_mlme::VhtOperation {
-            bytes: fake_vht_operation().as_bytes().try_into().unwrap(),
-        })),
-        ..bss
-    }
-}
-
 pub fn fake_bss_info() -> BssInfo {
     BssInfo {
         bssid: [55, 11, 22, 3, 9, 70],
-        ssid: b"foo".to_vec(),
+        ssid: Ssid::from(b"foo".clone()),
         rx_dbm: 0,
         snr_db: 0,
         channel: channel::Channel { primary: 1, cbw: channel::Cbw::Cbw20 },
         protection: Protection::Wpa2Personal,
         compatible: true,
-        ht_cap: Some(fidl_mlme::HtCapabilities {
-            bytes: fake_ht_capabilities().as_bytes().try_into().unwrap(),
-        }),
-        vht_cap: Some(fidl_mlme::VhtCapabilities {
-            bytes: fake_vht_capabilities().as_bytes().try_into().unwrap(),
-        }),
+        ht_cap: Some(fidl_mlme::HtCapabilities { bytes: fake_ht_cap_bytes() }),
+        vht_cap: Some(fidl_mlme::VhtCapabilities { bytes: fake_vht_cap_bytes() }),
         probe_resp_wsc: None,
         wmm_param: None,
     }
 }
 
-pub fn fake_chan(primary: u8) -> fidl_common::WlanChan {
-    fidl_common::WlanChan { primary, cbw: fidl_common::Cbw::Cbw20, secondary80: 0 }
-}
-
 pub fn fake_scan_request() -> fidl_mlme::ScanRequest {
     fidl_mlme::ScanRequest {
         txn_id: 1,
@@ -203,7 +95,7 @@
     // Fuchsia does not support tx_stbc yet.
     ht_cap.ht_cap_info = ht_cap.ht_cap_info.with_tx_stbc(false);
     (
-        channel::Channel { primary: 1, cbw: channel::Cbw::Cbw40 },
+        channel::Channel { primary: 3, cbw: channel::Cbw::Cbw40 },
         ClientCapabilities(StaCapabilities {
             cap_info: crate::test_utils::fake_capability_info(),
             rates: [0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6c]
diff --git a/src/connectivity/wlan/lib/sme/src/client/wpa.rs b/src/connectivity/wlan/lib/sme/src/client/wpa.rs
index 0a0479c..cd3b6a2 100644
--- a/src/connectivity/wlan/lib/sme/src/client/wpa.rs
+++ b/src/connectivity/wlan/lib/sme/src/client/wpa.rs
@@ -82,13 +82,8 @@
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::{
-        client::test_utils::{
-            fake_protected_bss_description, fake_unprotected_bss_description,
-            fake_wpa1_bss_description,
-        },
-        test_utils::{fake_device_info, make_wpa1_ie},
-    };
+    use crate::test_utils::{fake_device_info, make_wpa1_ie};
+    use wlan_common::fake_bss;
 
     const CLIENT_ADDR: [u8; 6] = [0x7A, 0xE7, 0x76, 0xD9, 0xF2, 0x67];
 
@@ -156,7 +151,7 @@
 
     #[test]
     fn test_get_wpa_password_for_unprotected_network() {
-        let bss = fake_unprotected_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Open);
         let credential = fidl_sme::Credential::Password("somepass".as_bytes().to_vec());
         get_legacy_wpa_association(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect_err("expect error when password is supplied for unprotected network");
@@ -164,7 +159,7 @@
 
     #[test]
     fn test_get_wpa_no_password_for_protected_network() {
-        let bss = fake_wpa1_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa1);
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
         get_legacy_wpa_association(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect_err("expect error when no password is supplied for protected network");
@@ -172,7 +167,7 @@
 
     #[test]
     fn test_get_wpa_for_rsna_protected_network() {
-        let bss = fake_protected_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa1);
         let credential = fidl_sme::Credential::None(fidl_sme::Empty);
         get_legacy_wpa_association(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect_err("expect error when treating RSNA as WPA association");
@@ -180,7 +175,7 @@
 
     #[test]
     fn test_get_wpa_psk() {
-        let bss = fake_wpa1_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa1);
         let credential = fidl_sme::Credential::Psk(vec![0xAA; 32]);
         get_legacy_wpa_association(&fake_device_info(CLIENT_ADDR), &credential, &bss)
             .expect("expected successful RSNA with valid PSK");
@@ -188,7 +183,7 @@
 
     #[test]
     fn test_get_wpa_invalid_psk() {
-        let bss = fake_wpa1_bss_description(b"foo_bss".to_vec());
+        let bss = fake_bss!(Wpa1);
         // PSK too short
         let credential = fidl_sme::Credential::Psk(vec![0xAA; 31]);
         get_legacy_wpa_association(&fake_device_info(CLIENT_ADDR), &credential, &bss)
diff --git a/src/connectivity/wlan/lib/sme/src/phy_selection.rs b/src/connectivity/wlan/lib/sme/src/phy_selection.rs
index 6db612f..c3d112b 100644
--- a/src/connectivity/wlan/lib/sme/src/phy_selection.rs
+++ b/src/connectivity/wlan/lib/sme/src/phy_selection.rs
@@ -214,10 +214,10 @@
 mod tests {
     use {
         super::*,
-        crate::{client::test_utils::fake_vht_bss_description, test_utils::*},
+        crate::test_utils::*,
         wlan_common::{
             channel::{Cbw, Channel, Phy},
-            RadioConfig,
+            fake_bss, RadioConfig,
         },
     };
 
@@ -343,7 +343,11 @@
         {
             let want = (fidl_common::Phy::Vht, fidl_common::Cbw::Cbw80);
             let got = derive_phy_cbw(
-                &fake_vht_bss_description(),
+                &fake_bss!(Open, chan: fidl_common::WlanChan {
+                    primary: 123,
+                    cbw: fidl_common::Cbw::Cbw80P80,
+                    secondary80: 42,
+                }),
                 &fake_device_info_vht(ChanWidthSet::TWENTY_FORTY),
                 &RadioConfig::default(),
             );
@@ -352,7 +356,11 @@
         {
             let want = (fidl_common::Phy::Ht, fidl_common::Cbw::Cbw40);
             let got = derive_phy_cbw(
-                &fake_vht_bss_description(),
+                &fake_bss!(Open, chan: fidl_common::WlanChan {
+                    primary: 123,
+                    cbw: fidl_common::Cbw::Cbw80P80,
+                    secondary80: 42,
+                }),
                 &fake_device_info_vht(ChanWidthSet::TWENTY_FORTY),
                 &fake_overrider(fidl_common::Phy::Ht, fidl_common::Cbw::Cbw80),
             );
@@ -361,7 +369,11 @@
         {
             let want = (fidl_common::Phy::Ht, fidl_common::Cbw::Cbw20);
             let got = derive_phy_cbw(
-                &fake_vht_bss_description(),
+                &fake_bss!(Open, chan: fidl_common::WlanChan {
+                    primary: 123,
+                    cbw: fidl_common::Cbw::Cbw80P80,
+                    secondary80: 42,
+                }),
                 &fake_device_info_ht(ChanWidthSet::TWENTY_ONLY),
                 &fake_overrider(fidl_common::Phy::Vht, fidl_common::Cbw::Cbw80),
             );
diff --git a/src/connectivity/wlan/wlanstack/src/telemetry/mod.rs b/src/connectivity/wlan/wlanstack/src/telemetry/mod.rs
index 6c87bf0..b1ed39d 100644
--- a/src/connectivity/wlan/wlanstack/src/telemetry/mod.rs
+++ b/src/connectivity/wlan/wlanstack/src/telemetry/mod.rs
@@ -692,7 +692,6 @@
         },
         fidl::endpoints::create_proxy,
         fidl_fuchsia_cobalt::{CobaltEvent, EventPayload},
-        fidl_fuchsia_wlan_common as fidl_common,
         fidl_fuchsia_wlan_mlme::{self as fidl_mlme, MlmeMarker},
         fidl_fuchsia_wlan_stats::{Counter, DispatcherStats, IfaceStats, PacketCounter},
         fuchsia_inspect::{assert_inspect_tree, testing::AnyProperty, Inspector},
@@ -705,6 +704,7 @@
             assert_variant,
             bss::Protection as BssProtection,
             channel::{Cbw, Channel},
+            fake_bss,
         },
         wlan_sme::client::{
             info::{
@@ -1175,49 +1175,17 @@
             }),
             num_rsna_key_frame_exchange_timeout: 0,
             result: ConnectResult::Success,
-            candidate_network: Some(fake_bss_description()),
+            candidate_network: Some(fake_bss!(Open)),
             attempts: 1,
             last_ten_failures: vec![],
             previous_disconnect_info: Some(PreviousDisconnectInfo {
-                ssid: fake_bss_description().ssid,
+                ssid: fake_bss!(Open).ssid,
                 disconnect_source: DisconnectSource::User,
                 disconnect_at: now - DURATION_SINCE_LAST_DISCONNECT,
             }),
         }
     }
 
-    fn fake_bss_description() -> fidl_mlme::BssDescription {
-        fidl_mlme::BssDescription {
-            bssid: [7, 1, 2, 77, 53, 8],
-            ssid: b"foo".to_vec(),
-            bss_type: fidl_mlme::BssTypes::Infrastructure,
-            beacon_period: 100,
-            dtim_period: 100,
-            timestamp: 0,
-            local_time: 0,
-            cap: wlan_common::mac::CapabilityInfo(0).0,
-            rates: vec![],
-            country: None,
-            rsne: None,
-            vendor_ies: None,
-
-            rcpi_dbmh: 0,
-            rsni_dbh: 0,
-
-            ht_cap: None,
-            ht_op: None,
-            vht_cap: None,
-            vht_op: None,
-            chan: fidl_common::WlanChan {
-                primary: 1,
-                secondary80: 0,
-                cbw: fidl_common::Cbw::Cbw20,
-            },
-            rssi_dbm: 0,
-            snr_db: 0,
-        }
-    }
-
     fn fake_iface_stats(nth_req: u64) -> IfaceStats {
         IfaceStats {
             dispatcher_stats: DispatcherStats {