Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions gateway-messages/src/sp_to_mgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,6 @@ pub enum UpdateError {
ImageMismatch,
SignatureNotValidated,
VersionNotSupported,
InvalidPreferredSlotId,
}

impl fmt::Display for UpdateError {
Expand Down Expand Up @@ -1354,12 +1353,6 @@ impl fmt::Display for UpdateError {
Self::InvalidComponent => {
write!(f, "invalid component for operation")
}
Self::InvalidPreferredSlotId => {
write!(
f,
"updating a bootloader preferred slot is not permitted"
)
}
}
}
}
Expand Down
84 changes: 0 additions & 84 deletions gateway-messages/tests/versioning/v19.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
//! tests can be removed as we will stop supporting $VERSION.

use super::assert_serialized;
use gateway_messages::ImageError;
use gateway_messages::SpStateV3;
use gateway_messages::UpdateError;
use gateway_messages::{HfError, MgsRequest, SpError, SpResponse};

#[test]
Expand Down Expand Up @@ -63,84 +60,3 @@ fn read_host_flash() {
assert_serialized(&[38, i as u8], &request);
}
}

#[test]
fn sp_response() {
let response = SpResponse::SpStateV3(SpStateV3 {
hubris_archive_id: [1, 2, 3, 4, 5, 6, 7, 8],
serial_number: [
9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
],
model: [
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
],
revision: 0xf0f1f2f3,
base_mac_address: [73, 74, 75, 76, 77, 78],
power_state: gateway_messages::PowerState::A0,
});

#[rustfmt::skip]
let expected = vec![
44, // SpStateV3
1, 2, 3, 4, 5, 6, 7, 8, // hubris_archive_id

9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, // serial_number

41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, // model

0xf3, 0xf2, 0xf1, 0xf0, // revision
73, 74, 75, 76, 77, 78, // base_mac_address
0, // power_state
];

assert_serialized(&expected, &response);
}

#[test]
fn host_request() {
let request = MgsRequest::VersionedRotBootInfo { version: 3 };

#[rustfmt::skip]
let expected = vec![
45, // VersionedRotBootInfo
3, // version
];

assert_serialized(&expected, &request);
}

#[test]
fn error_enums() {
let response: [ImageError; 13] = [
ImageError::Unchecked,
ImageError::FirstPageErased,
ImageError::PartiallyProgrammed,
ImageError::InvalidLength,
ImageError::HeaderNotProgrammed,
ImageError::BootloaderTooSmall,
ImageError::BadMagic,
ImageError::HeaderImageSize,
ImageError::UnalignedLength,
ImageError::UnsupportedType,
ImageError::ResetVectorNotThumb2,
ImageError::ResetVector,
ImageError::Signature,
];
let expected = vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
assert_serialized(&expected, &response);

let response: [UpdateError; 4] = [
UpdateError::BlockOutOfOrder,
UpdateError::InvalidComponent,
UpdateError::InvalidSlotIdForOperation,
UpdateError::InvalidPreferredSlotId,
];
let expected = vec![27, 28, 29, 34];
assert_serialized(&expected, &response);
}
2 changes: 0 additions & 2 deletions gateway-sp-comms/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ pub enum UpdateError {
InvalidComponent,
#[error("an image was not found")]
ImageNotFound,
#[error("updating a bootloader preferred slot is not permitted")]
InvalidPreferredSlotId,
}

#[derive(Debug, thiserror::Error, SlogInlineError)]
Expand Down
Loading