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

Function test_lorawan_10_errors

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

Source from the content-addressed store, hash-verified

210
211#[tokio::test]
212async fn test_lorawan_10_errors() {
213 let _guard = test::prepare().await;
214
215 let t = tenant::create(tenant::Tenant {
216 name: "tenant".into(),
217 can_have_gateways: true,
218 ..Default::default()
219 })
220 .await
221 .unwrap();
222
223 let gw = gateway::create(gateway::Gateway {
224 name: "gateway".into(),
225 tenant_id: t.id,
226 gateway_id: EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]),
227 ..Default::default()
228 })
229 .await
230 .unwrap();
231
232 let app = application::create(application::Application {
233 name: "app".into(),
234 tenant_id: t.id,
235 ..Default::default()
236 })
237 .await
238 .unwrap();
239
240 let dp = device_profile::create(device_profile::DeviceProfile {
241 name: "dp".into(),
242 tenant_id: Some(t.id),
243 region: lrwn::region::CommonName::EU868,
244 mac_version: lrwn::region::MacVersion::LORAWAN_1_0_2,
245 reg_params_revision: lrwn::region::Revision::A,
246 supports_otaa: true,
247 ..Default::default()
248 })
249 .await
250 .unwrap();
251
252 let dev = device::create(device::Device {
253 name: "device".into(),
254 application_id: app.id,
255 device_profile_id: dp.id,
256 dev_eui: EUI64::from_be_bytes([2, 2, 3, 4, 5, 6, 7, 8]),
257 enabled_class: DeviceClass::A,
258 dev_addr: Some(DevAddr::from_be_bytes([1, 2, 3, 4])),
259 f_cnt_up: 8,
260 ..Default::default()
261 })
262 .await
263 .unwrap();
264
265 let rx_info = gw::UplinkRxInfo {
266 gateway_id: gw.gateway_id.to_string(),
267 location: Some(Default::default()),
268 ..Default::default()
269 };

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