()
| 25 | |
| 26 | #[tokio::test] |
| 27 | async fn test_downlink_scheduler() { |
| 28 | let _guard = test::prepare().await; |
| 29 | |
| 30 | let t = tenant::create(tenant::Tenant { |
| 31 | name: "tenant".into(), |
| 32 | can_have_gateways: true, |
| 33 | ..Default::default() |
| 34 | }) |
| 35 | .await |
| 36 | .unwrap(); |
| 37 | |
| 38 | let gw = gateway::create(gateway::Gateway { |
| 39 | name: "gateway".into(), |
| 40 | tenant_id: t.id, |
| 41 | gateway_id: EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]), |
| 42 | ..Default::default() |
| 43 | }) |
| 44 | .await |
| 45 | .unwrap(); |
| 46 | |
| 47 | let app = application::create(application::Application { |
| 48 | name: "app".into(), |
| 49 | tenant_id: t.id, |
| 50 | ..Default::default() |
| 51 | }) |
| 52 | .await |
| 53 | .unwrap(); |
| 54 | |
| 55 | let dp = device_profile::create(device_profile::DeviceProfile { |
| 56 | name: "dp".into(), |
| 57 | tenant_id: Some(t.id), |
| 58 | region: lrwn::region::CommonName::EU868, |
| 59 | mac_version: lrwn::region::MacVersion::LORAWAN_1_0_4, |
| 60 | reg_params_revision: lrwn::region::Revision::RP002_1_0_3, |
| 61 | supports_otaa: true, |
| 62 | supports_class_c: true, |
| 63 | ..Default::default() |
| 64 | }) |
| 65 | .await |
| 66 | .unwrap(); |
| 67 | |
| 68 | let dev = device::create(device::Device { |
| 69 | name: "device".into(), |
| 70 | application_id: app.id, |
| 71 | device_profile_id: dp.id, |
| 72 | dev_eui: EUI64::from_be_bytes([2, 2, 3, 4, 5, 6, 7, 8]), |
| 73 | enabled_class: DeviceClass::C, |
| 74 | dev_addr: Some(DevAddr::from_be_bytes([1, 2, 3, 4])), |
| 75 | f_cnt_up: 8, |
| 76 | ..Default::default() |
| 77 | }) |
| 78 | .await |
| 79 | .unwrap(); |
| 80 | |
| 81 | let ds = internal::DeviceSession { |
| 82 | dev_addr: vec![1, 2, 3, 4], |
| 83 | mac_version: common::MacVersion::Lorawan104.into(), |
| 84 | f_nwk_s_int_key: vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], |
nothing calls this directly
no test coverage detected