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

Function test_fuota

chirpstack/src/api/fuota.rs:693–967  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

691
692 #[tokio::test]
693 async fn test_fuota() {
694 let _guard = test::prepare().await;
695
696 // setup admin user
697 let u = user::User {
698 is_admin: true,
699 is_active: true,
700 email: "admin@admin".into(),
701 email_verified: true,
702 ..Default::default()
703 };
704 let u = user::create(u).await.unwrap();
705
706 // create tenant
707 let t = tenant::create(tenant::Tenant {
708 name: "test-tenant".into(),
709 can_have_gateways: true,
710 ..Default::default()
711 })
712 .await
713 .unwrap();
714
715 // create app
716 let app = application::create(application::Application {
717 tenant_id: t.id,
718 name: "test-app".into(),
719 ..Default::default()
720 })
721 .await
722 .unwrap();
723
724 // create dp
725 let dp = device_profile::create(device_profile::DeviceProfile {
726 tenant_id: Some(t.id),
727 name: "test-dp".into(),
728 ..Default::default()
729 })
730 .await
731 .unwrap();
732
733 // create device
734 let dev = device::create(device::Device {
735 dev_eui: EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]),
736 application_id: app.id,
737 device_profile_id: dp.id,
738 ..Default::default()
739 })
740 .await
741 .unwrap();
742
743 // create gateway
744 let gw = gateway::create(gateway::Gateway {
745 gateway_id: EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]),
746 tenant_id: t.id,
747 name: "test-gw".into(),
748 ..Default::default()
749 })
750 .await

Callers

nothing calls this directly

Calls 15

prepareFunction · 0.85
list_jobsFunction · 0.85
unwrapMethod · 0.80
to_stringMethod · 0.80
create_deploymentMethod · 0.80
get_deploymentMethod · 0.80
update_deploymentMethod · 0.80
list_deploymentsMethod · 0.80
add_devicesMethod · 0.80
remove_devicesMethod · 0.80
add_gatewaysMethod · 0.80
list_gatewaysMethod · 0.80

Tested by

no test coverage detected