Skip to content

Commit

Permalink
Turn blob path into a constant
Browse files Browse the repository at this point in the history
Created using spr 1.3.5
  • Loading branch information
sunshowers committed Dec 7, 2023
1 parent df737fa commit 6e80ef2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions sled-agent/tests/integration_tests/early_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ use omicron_sled_agent::bootstrap::early_networking::{
};
use omicron_test_utils::dev::test_setup_log;

const BLOB_PATH: &str = "tests/data/early_network_blobs.txt";

/// Test that previous and current versions of `EarlyNetworkConfig` blobs
/// deserialize correctly.
#[test]
Expand All @@ -32,9 +34,8 @@ fn early_network_blobs_deserialize() {
);

// Read old blobs as newline-delimited JSON.
let mut known_blobs =
std::fs::read_to_string("tests/data/early_network_blobs.txt")
.expect("error reading early_network_blobs.txt");
let mut known_blobs = std::fs::read_to_string(BLOB_PATH)
.expect("error reading early_network_blobs.txt");
let mut current_blob_is_known = false;
for (blob_idx, line) in known_blobs.lines().enumerate() {
let blob_lineno = blob_idx + 1;
Expand Down Expand Up @@ -96,10 +97,7 @@ fn early_network_blobs_deserialize() {
known_blobs.push('\n');
}

expectorate::assert_contents(
"tests/data/early_network_blobs.txt",
&known_blobs,
);
expectorate::assert_contents(BLOB_PATH, &known_blobs);

logctx.cleanup_successful();
}
Expand Down

0 comments on commit 6e80ef2

Please sign in to comment.