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

Function test_update_relay_conf

chirpstack/src/downlink/data.rs:4043–4156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4041
4042 #[tokio::test]
4043 async fn test_update_relay_conf() {
4044 struct Test {
4045 name: String,
4046 device_session: internal::DeviceSession,
4047 device_profile: device_profile::DeviceProfile,
4048 expected_mac_commands: Vec<lrwn::MACCommandSet>,
4049 }
4050
4051 let tests = vec![
4052 Test {
4053 name: "relay in sync".into(),
4054 device_session: internal::DeviceSession {
4055 relay: Some(internal::Relay {
4056 enabled: true,
4057 cad_periodicity: 1,
4058 default_channel_index: 0,
4059 second_channel_freq: 868300000,
4060 second_channel_dr: 3,
4061 second_channel_ack_offset: 2,
4062 ..Default::default()
4063 }),
4064 ..Default::default()
4065 },
4066 device_profile: device_profile::DeviceProfile {
4067 relay_params: Some(fields::RelayParams {
4068 is_relay: true,
4069 relay_enabled: true,
4070 relay_cad_periodicity: 1,
4071 default_channel_index: 0,
4072 second_channel_freq: 868300000,
4073 second_channel_dr: 3,
4074 second_channel_ack_offset: 2,
4075 ..Default::default()
4076 }),
4077 ..Default::default()
4078 },
4079 expected_mac_commands: vec![],
4080 },
4081 Test {
4082 name: "relay out of sync".into(),
4083 device_session: internal::DeviceSession {
4084 relay: Some(internal::Relay {
4085 enabled: true,
4086 cad_periodicity: 1,
4087 default_channel_index: 0,
4088 second_channel_freq: 868300000,
4089 second_channel_dr: 3,
4090 second_channel_ack_offset: 2,
4091 ..Default::default()
4092 }),
4093 ..Default::default()
4094 },
4095 device_profile: device_profile::DeviceProfile {
4096 relay_params: Some(fields::RelayParams {
4097 is_relay: true,
4098 relay_enabled: true,
4099 relay_cad_periodicity: 1,
4100 default_channel_index: 0,

Callers

nothing calls this directly

Calls 6

prepareFunction · 0.85
get_region_networkFunction · 0.85
unwrapMethod · 0.80
_update_relay_confMethod · 0.80
getFunction · 0.50
intoMethod · 0.45

Tested by

no test coverage detected