()
| 205 | |
| 206 | #[tokio::test] |
| 207 | async fn test_downlink_scheduler() { |
| 208 | let _guard = test::prepare().await; |
| 209 | |
| 210 | let t = tenant::create(tenant::Tenant { |
| 211 | name: "tenant".into(), |
| 212 | can_have_gateways: true, |
| 213 | ..Default::default() |
| 214 | }) |
| 215 | .await |
| 216 | .unwrap(); |
| 217 | |
| 218 | let gw = gateway::create(gateway::Gateway { |
| 219 | name: "gateway".into(), |
| 220 | tenant_id: t.id, |
| 221 | gateway_id: EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]), |
| 222 | ..Default::default() |
| 223 | }) |
| 224 | .await |
| 225 | .unwrap(); |
| 226 | |
| 227 | let app = application::create(application::Application { |
| 228 | name: "app".into(), |
| 229 | tenant_id: t.id, |
| 230 | ..Default::default() |
| 231 | }) |
| 232 | .await |
| 233 | .unwrap(); |
| 234 | |
| 235 | let dp = device_profile::create(device_profile::DeviceProfile { |
| 236 | name: "dp".into(), |
| 237 | tenant_id: Some(t.id), |
| 238 | region: lrwn::region::CommonName::EU868, |
| 239 | mac_version: lrwn::region::MacVersion::LORAWAN_1_0_4, |
| 240 | reg_params_revision: lrwn::region::Revision::RP002_1_0_3, |
| 241 | supports_otaa: true, |
| 242 | supports_class_b: true, |
| 243 | ..Default::default() |
| 244 | }) |
| 245 | .await |
| 246 | .unwrap(); |
| 247 | |
| 248 | let dev = device::create(device::Device { |
| 249 | name: "device".into(), |
| 250 | application_id: app.id, |
| 251 | device_profile_id: dp.id, |
| 252 | dev_eui: EUI64::from_be_bytes([2, 2, 3, 4, 5, 6, 7, 8]), |
| 253 | enabled_class: DeviceClass::B, |
| 254 | dev_addr: Some(DevAddr::from_be_bytes([1, 2, 3, 4])), |
| 255 | f_cnt_up: 8, |
| 256 | ..Default::default() |
| 257 | }) |
| 258 | .await |
| 259 | .unwrap(); |
| 260 | |
| 261 | let ds = internal::DeviceSession { |
| 262 | mac_version: common::MacVersion::Lorawan104.into(), |
| 263 | dev_addr: vec![1, 2, 3, 4], |
| 264 | 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