MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / test_lorawan_10_device_queue

Function test_lorawan_10_device_queue

chirpstack/src/test/class_a_test.rs:3149–3679  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3147
3148#[tokio::test]
3149async fn test_lorawan_10_device_queue() {
3150 let _guard = test::prepare().await;
3151
3152 let t = tenant::create(tenant::Tenant {
3153 name: "tenant".into(),
3154 can_have_gateways: true,
3155 ..Default::default()
3156 })
3157 .await
3158 .unwrap();
3159
3160 let gw = gateway::create(gateway::Gateway {
3161 name: "gateway".into(),
3162 tenant_id: t.id,
3163 gateway_id: EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]),
3164 ..Default::default()
3165 })
3166 .await
3167 .unwrap();
3168
3169 let app = application::create(application::Application {
3170 name: "app".into(),
3171 tenant_id: t.id,
3172 ..Default::default()
3173 })
3174 .await
3175 .unwrap();
3176
3177 let dp = device_profile::create(device_profile::DeviceProfile {
3178 name: "dp".into(),
3179 tenant_id: Some(t.id),
3180 region: lrwn::region::CommonName::EU868,
3181 mac_version: lrwn::region::MacVersion::LORAWAN_1_0_4,
3182 reg_params_revision: lrwn::region::Revision::RP002_1_0_3,
3183 class_b_params: Some(fields::ClassBParams {
3184 class_b_downlink_only: true,
3185 ..Default::default()
3186 }),
3187 supports_otaa: true,
3188 ..Default::default()
3189 })
3190 .await
3191 .unwrap();
3192
3193 let dev = device::create(device::Device {
3194 name: "device".into(),
3195 application_id: app.id,
3196 device_profile_id: dp.id,
3197 dev_eui: EUI64::from_be_bytes([2, 2, 3, 4, 5, 6, 7, 8]),
3198 enabled_class: DeviceClass::A,
3199 dev_addr: Some(DevAddr::from_be_bytes([1, 2, 3, 4])),
3200 f_cnt_up: 8,
3201 ..Default::default()
3202 })
3203 .await
3204 .unwrap();
3205
3206 let rx_info = gw::UplinkRxInfo {

Callers

nothing calls this directly

Calls 8

prepareFunction · 0.85
set_uplink_modulationFunction · 0.85
unwrapMethod · 0.80
to_stringMethod · 0.80
run_testFunction · 0.70
createFunction · 0.50
partial_updateFunction · 0.50
intoMethod · 0.45

Tested by

no test coverage detected