mirror of
https://github.com/chirpstack/chirpstack.git
synced 2024-12-21 06:03:11 +00:00
Fix tests after streams > stream rename.
This commit is contained in:
parent
8cca9d0677
commit
a4b775e75a
@ -14,7 +14,7 @@ use crate::storage::{
|
|||||||
device::{self, DeviceClass},
|
device::{self, DeviceClass},
|
||||||
device_queue, device_session, downlink_frame, get_redis_conn, redis_key,
|
device_queue, device_session, downlink_frame, get_redis_conn, redis_key,
|
||||||
};
|
};
|
||||||
use chirpstack_api::{gw, integration as integration_pb, internal, streams};
|
use chirpstack_api::{gw, integration as integration_pb, internal, stream};
|
||||||
use lrwn::EUI64;
|
use lrwn::EUI64;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
@ -393,7 +393,7 @@ pub fn enabled_class(dev_eui: EUI64, c: DeviceClass) -> Validator {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn uplink_meta_log(um: streams::UplinkMeta) -> Validator {
|
pub fn uplink_meta_log(um: stream::UplinkMeta) -> Validator {
|
||||||
Box::new(move || {
|
Box::new(move || {
|
||||||
let um = um.clone();
|
let um = um.clone();
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
@ -413,7 +413,7 @@ pub fn uplink_meta_log(um: streams::UplinkMeta) -> Validator {
|
|||||||
for (k, v) in &stream_id.map {
|
for (k, v) in &stream_id.map {
|
||||||
assert_eq!("up", k);
|
assert_eq!("up", k);
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::Data(b) = v {
|
||||||
let pl = streams::UplinkMeta::decode(&mut Cursor::new(b)).unwrap();
|
let pl = stream::UplinkMeta::decode(&mut Cursor::new(b)).unwrap();
|
||||||
assert_eq!(um, pl);
|
assert_eq!(um, pl);
|
||||||
} else {
|
} else {
|
||||||
panic!("Invalid payload");
|
panic!("Invalid payload");
|
||||||
@ -429,7 +429,7 @@ pub fn uplink_meta_log(um: streams::UplinkMeta) -> Validator {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn device_uplink_frame_log(uf: streams::UplinkFrameLog) -> Validator {
|
pub fn device_uplink_frame_log(uf: stream::UplinkFrameLog) -> Validator {
|
||||||
Box::new(move || {
|
Box::new(move || {
|
||||||
let uf = uf.clone();
|
let uf = uf.clone();
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
@ -450,7 +450,7 @@ pub fn device_uplink_frame_log(uf: streams::UplinkFrameLog) -> Validator {
|
|||||||
assert_eq!("up", k);
|
assert_eq!("up", k);
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::Data(b) = v {
|
||||||
let mut pl =
|
let mut pl =
|
||||||
streams::UplinkFrameLog::decode(&mut Cursor::new(b)).unwrap();
|
stream::UplinkFrameLog::decode(&mut Cursor::new(b)).unwrap();
|
||||||
pl.time = None; // we don't have control over this value
|
pl.time = None; // we don't have control over this value
|
||||||
assert_eq!(uf, pl);
|
assert_eq!(uf, pl);
|
||||||
} else {
|
} else {
|
||||||
|
@ -11,7 +11,7 @@ use crate::storage::{
|
|||||||
device_profile, device_queue, device_session, gateway, mac_command, reset_redis, tenant,
|
device_profile, device_queue, device_session, gateway, mac_command, reset_redis, tenant,
|
||||||
};
|
};
|
||||||
use crate::{config, gateway::backend as gateway_backend, integration, region, test, uplink};
|
use crate::{config, gateway::backend as gateway_backend, integration, region, test, uplink};
|
||||||
use chirpstack_api::{common, gw, integration as integration_pb, internal, streams};
|
use chirpstack_api::{common, gw, integration as integration_pb, internal, stream};
|
||||||
use lrwn::{AES128Key, EUI64};
|
use lrwn::{AES128Key, EUI64};
|
||||||
|
|
||||||
type Function = Box<dyn Fn() -> Pin<Box<dyn Future<Output = ()>>>>;
|
type Function = Box<dyn Fn() -> Pin<Box<dyn Future<Output = ()>>>>;
|
||||||
@ -546,7 +546,7 @@ async fn test_lorawan_10_errors() {
|
|||||||
},
|
},
|
||||||
assert: vec![
|
assert: vec![
|
||||||
assert::no_uplink_event(),
|
assert::no_uplink_event(),
|
||||||
assert::device_uplink_frame_log(streams::UplinkFrameLog {
|
assert::device_uplink_frame_log(stream::UplinkFrameLog {
|
||||||
phy_payload: vec![64, 4, 3, 2, 1, 0, 8, 0, 1, 1, 2, 3, 4],
|
phy_payload: vec![64, 4, 3, 2, 1, 0, 8, 0, 1, 1, 2, 3, 4],
|
||||||
tx_info: Some(tx_info.clone()),
|
tx_info: Some(tx_info.clone()),
|
||||||
rx_info: vec![rx_info.clone()],
|
rx_info: vec![rx_info.clone()],
|
||||||
|
@ -11,7 +11,7 @@ use crate::storage::{
|
|||||||
device_keys, device_profile, gateway, reset_redis, tenant,
|
device_keys, device_profile, gateway, reset_redis, tenant,
|
||||||
};
|
};
|
||||||
use crate::{config, gateway::backend as gateway_backend, integration, region, test, uplink};
|
use crate::{config, gateway::backend as gateway_backend, integration, region, test, uplink};
|
||||||
use chirpstack_api::{common, gw, internal, streams};
|
use chirpstack_api::{common, gw, internal, stream};
|
||||||
use lrwn::keys::get_js_int_key;
|
use lrwn::keys::get_js_int_key;
|
||||||
use lrwn::{AES128Key, EUI64};
|
use lrwn::{AES128Key, EUI64};
|
||||||
|
|
||||||
@ -564,7 +564,7 @@ async fn test_lorawan_10() {
|
|||||||
}),
|
}),
|
||||||
assert::enabled_class(dev.dev_eui.clone(), DeviceClass::A),
|
assert::enabled_class(dev.dev_eui.clone(), DeviceClass::A),
|
||||||
assert::device_queue_items(dev.dev_eui.clone(), vec![]),
|
assert::device_queue_items(dev.dev_eui.clone(), vec![]),
|
||||||
assert::uplink_meta_log(streams::UplinkMeta {
|
assert::uplink_meta_log(stream::UplinkMeta {
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tx_info: Some(tx_info.clone()),
|
tx_info: Some(tx_info.clone()),
|
||||||
rx_info: vec![rx_info.clone()],
|
rx_info: vec![rx_info.clone()],
|
||||||
|
Loading…
Reference in New Issue
Block a user