fix tests
Some checks failed
Rust/sat-rs/pipeline/pr-main There was a failure building this commit

This commit is contained in:
2024-02-16 18:51:05 +01:00
parent 3cb34cef58
commit 7092c8cd41
17 changed files with 295 additions and 126 deletions

View File

@ -1,7 +1,7 @@
use std::sync::mpsc::{self, TryRecvError};
use log::{info, warn};
use satrs::pus::verification::VerificationReporterWithSender;
use satrs::pus::verification::{VerificationReporterWithSender, VerificationReportingProvider};
use satrs::pus::{EcssTmSender, PusTmWrapper};
use satrs::request::TargetAndApidId;
use satrs::spacepackets::ecss::hk::Subservice as HkSubservice;

View File

@ -12,7 +12,7 @@ use satrs::{
DefaultPusMgmtBackendProvider, EventReporter, EventRequest, EventRequestWithToken,
PusEventDispatcher,
},
verification::{TcStateStarted, VerificationReporterWithSender, VerificationToken},
verification::{TcStateStarted, VerificationReporterWithSender, VerificationToken, VerificationReportingProvider},
EcssTmSender,
},
spacepackets::time::cds::{self, TimeProvider},

View File

@ -3,7 +3,7 @@ use satrs::action::ActionRequest;
use satrs::pool::{SharedStaticMemoryPool, StoreAddr};
use satrs::pus::action::{PusActionToRequestConverter, PusService8ActionHandler};
use satrs::pus::verification::{
FailParams, TcStateAccepted, VerificationReporterWithSender, VerificationToken,
FailParams, TcStateAccepted, VerificationReporterWithSender, VerificationToken, VerificationReportingProvider,
};
use satrs::pus::{
EcssTcAndToken, EcssTcInMemConverter, EcssTcInSharedStoreConverter, EcssTcInVecConverter,
@ -33,7 +33,7 @@ impl PusActionToRequestConverter for ExampleActionRequestConverter {
token: VerificationToken<TcStateAccepted>,
tc: &PusTcReader,
time_stamp: &[u8],
verif_reporter: &mut VerificationReporterWithSender,
verif_reporter: &impl VerificationReportingProvider,
) -> Result<(TargetId, ActionRequest), Self::Error> {
let subservice = tc.subservice();
let user_data = tc.user_data();
@ -138,6 +138,7 @@ pub fn create_action_service_dynamic(
pub struct Pus8Wrapper<TcInMemConverter: EcssTcInMemConverter> {
pub(crate) pus_8_handler: PusService8ActionHandler<
TcInMemConverter,
VerificationReporterWithSender,
ExampleActionRequestConverter,
GenericRequestRouter,
GenericRoutingErrorHandler<8>,

View File

@ -76,7 +76,7 @@ pub fn create_event_service_dynamic(
}
pub struct Pus5Wrapper<TcInMemConverter: EcssTcInMemConverter> {
pub pus_5_handler: PusService5EventHandler<TcInMemConverter>,
pub pus_5_handler: PusService5EventHandler<TcInMemConverter, VerificationReporterWithSender>,
}
impl<TcInMemConverter: EcssTcInMemConverter> Pus5Wrapper<TcInMemConverter> {

View File

@ -3,7 +3,7 @@ use satrs::hk::{CollectionIntervalFactor, HkRequest};
use satrs::pool::{SharedStaticMemoryPool, StoreAddr};
use satrs::pus::hk::{PusHkToRequestConverter, PusService3HkHandler};
use satrs::pus::verification::{
FailParams, TcStateAccepted, VerificationReporterWithSender, VerificationToken,
FailParams, TcStateAccepted, VerificationReporterWithSender, VerificationToken, VerificationReportingProvider,
};
use satrs::pus::{
EcssTcAndToken, EcssTcInMemConverter, EcssTcInSharedStoreConverter, EcssTcInVecConverter,
@ -33,7 +33,7 @@ impl PusHkToRequestConverter for ExampleHkRequestConverter {
token: VerificationToken<TcStateAccepted>,
tc: &PusTcReader,
time_stamp: &[u8],
verif_reporter: &mut VerificationReporterWithSender,
verif_reporter: &impl VerificationReportingProvider,
) -> Result<(TargetId, HkRequest), Self::Error> {
let user_data = tc.user_data();
if user_data.is_empty() {
@ -196,6 +196,7 @@ pub fn create_hk_service_dynamic(
pub struct Pus3Wrapper<TcInMemConverter: EcssTcInMemConverter> {
pub(crate) pus_3_handler: PusService3HkHandler<
TcInMemConverter,
VerificationReporterWithSender,
ExampleHkRequestConverter,
GenericRequestRouter,
GenericRoutingErrorHandler<3>,

View File

@ -1,6 +1,6 @@
use crate::tmtc::MpscStoreAndSendError;
use log::warn;
use satrs::pus::verification::{FailParams, StdVerifReporterWithSender};
use satrs::pus::verification::{FailParams, StdVerifReporterWithSender, VerificationReportingProvider};
use satrs::pus::{
EcssTcAndToken, GenericRoutingError, PusPacketHandlerResult, PusRoutingErrorHandler, TcInMemory,
};
@ -169,7 +169,7 @@ impl<const SERVICE_ID: u8> PusRoutingErrorHandler for GenericRoutingErrorHandler
_tc: &PusTcReader,
error: Self::Error,
time_stamp: &[u8],
verif_reporter: &mut satrs::pus::verification::VerificationReporterWithSender,
verif_reporter: &impl VerificationReportingProvider,
) {
warn!("Routing request for service {SERVICE_ID} failed: {error:?}");
match error {

View File

@ -52,7 +52,8 @@ impl TcReleaser for mpsc::Sender<Vec<u8>> {
}
pub struct Pus11Wrapper<TcInMemConverter: EcssTcInMemConverter> {
pub pus_11_handler: PusService11SchedHandler<TcInMemConverter, PusScheduler>,
pub pus_11_handler:
PusService11SchedHandler<TcInMemConverter, VerificationReporterWithSender, PusScheduler>,
pub sched_tc_pool: StaticMemoryPool,
pub releaser_buf: [u8; 4096],
pub tc_releaser: Box<dyn TcReleaser + Send>,

View File

@ -2,7 +2,7 @@ use log::{info, warn};
use satrs::params::Params;
use satrs::pool::{SharedStaticMemoryPool, StoreAddr};
use satrs::pus::test::PusService17TestHandler;
use satrs::pus::verification::{FailParams, VerificationReporterWithSender};
use satrs::pus::verification::{FailParams, VerificationReporterWithSender, VerificationReportingProvider};
use satrs::pus::{
EcssTcAndToken, EcssTcInMemConverter, EcssTcInVecConverter, MpscTcReceiver, MpscTmAsVecSender,
MpscTmInSharedPoolSender, PusPacketHandlerResult, PusServiceHelper,
@ -79,7 +79,7 @@ pub fn create_test_service_dynamic(
}
pub struct Service17CustomWrapper<TcInMemConverter: EcssTcInMemConverter> {
pub pus17_handler: PusService17TestHandler<TcInMemConverter>,
pub pus17_handler: PusService17TestHandler<TcInMemConverter, VerificationReporterWithSender>,
pub test_srv_event_sender: Sender<(EventU32, Option<Params>)>,
}
@ -125,14 +125,12 @@ impl<TcInMemConverter: EcssTcInMemConverter> Service17CustomWrapper<TcInMemConve
.service_helper
.common
.verification_handler
.get_mut()
.start_success(token, Some(&stamp_buf))
.expect("Error sending start success");
self.pus17_handler
.service_helper
.common
.verification_handler
.get_mut()
.completion_success(start_token, Some(&stamp_buf))
.expect("Error sending completion success");
} else {
@ -141,7 +139,6 @@ impl<TcInMemConverter: EcssTcInMemConverter> Service17CustomWrapper<TcInMemConve
.service_helper
.common
.verification_handler
.get_mut()
.start_failure(
token,
FailParams::new(