()
| 1484 | |
| 1485 | #[tokio::test] |
| 1486 | async fn test_device_session() { |
| 1487 | let _guard = test::prepare().await; |
| 1488 | |
| 1489 | let t = storage::tenant::create(storage::tenant::Tenant { |
| 1490 | name: "test-tenant".into(), |
| 1491 | ..Default::default() |
| 1492 | }) |
| 1493 | .await |
| 1494 | .unwrap(); |
| 1495 | |
| 1496 | let dp = storage::device_profile::create(storage::device_profile::DeviceProfile { |
| 1497 | name: "test-dp".into(), |
| 1498 | tenant_id: Some(t.id), |
| 1499 | ..Default::default() |
| 1500 | }) |
| 1501 | .await |
| 1502 | .unwrap(); |
| 1503 | |
| 1504 | let app = storage::application::create(storage::application::Application { |
| 1505 | name: "test-app".into(), |
| 1506 | tenant_id: t.id, |
| 1507 | ..Default::default() |
| 1508 | }) |
| 1509 | .await |
| 1510 | .unwrap(); |
| 1511 | |
| 1512 | let mut devices = vec![ |
| 1513 | Device { |
| 1514 | application_id: app.id, |
| 1515 | device_profile_id: dp.id, |
| 1516 | name: "0101010101010101".into(), |
| 1517 | dev_eui: EUI64::from_be_bytes([1, 1, 1, 1, 1, 1, 1, 1]), |
| 1518 | dev_addr: Some(DevAddr::from_be_bytes([1, 2, 3, 4])), |
| 1519 | f_cnt_up: 100, |
| 1520 | device_session: Some( |
| 1521 | internal::DeviceSession { |
| 1522 | region_config_id: "eu868".into(), |
| 1523 | dev_addr: vec![0x01, 0x02, 0x03, 0x04], |
| 1524 | s_nwk_s_int_key: vec![ |
| 1525 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, |
| 1526 | 0x01, 0x01, 0x01, 0x01, |
| 1527 | ], |
| 1528 | f_nwk_s_int_key: vec![ |
| 1529 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, |
| 1530 | 0x01, 0x01, 0x01, 0x01, |
| 1531 | ], |
| 1532 | nwk_s_enc_key: vec![ |
| 1533 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, |
| 1534 | 0x01, 0x01, 0x01, 0x01, |
| 1535 | ], |
| 1536 | skip_f_cnt_check: true, |
| 1537 | ..Default::default() |
| 1538 | } |
| 1539 | .into(), |
| 1540 | ), |
| 1541 | ..Default::default() |
| 1542 | }, |
| 1543 | Device { |
nothing calls this directly
no test coverage detected