Skip to content

Commit 826e820

Browse files
leftwoAlan Hanson
and
Alan Hanson
authored
More crutest and dsc updates to support Volume layer activities. (#1472)
This adds support for crutest to use a provided dsc endpoint to construct a Volume object. These changes should be a fix for both issues: #1451 and #1457 Moved the existing volume creation steps to a new function, and added another option on how we can create a Volume. The two previous ways of creating a volume are not changed (though I changed a log message and added some warnings). The new code is in taking the dsc provided endpoint and using that to construct a volume. Additional dsc changes were made to help provide Volume info. Renamed things in dsc to better reflect what information they hold. Specifically, update a bunch of region set comments, as dsc just controls crucible-downstairs processes, and does not know which ones are part of what region set. **New dsc commands** * get_ds_uuid: Returns the UUID for the given client ID * all_running: Returns true if all downstairs that dsc knows about are currently in Running state. * get_region_count: Returns the total number of regions that dsc knows about. **New dsc behavior** * dsc will now wait on all downstairs starting before taking any commands. The ability for dsc to answer a request can be used by a test to confirm that all downstairs had started. * Add the ability to supply a dsc endpoint to crutest-cli (fix #1459) **Other changes** `tools/test_replay.sh` transitioned to using the new --dsc option, as that test already required a dsc endpoint and was using a hard coded default value for it. `tools/test_restart_repair.sh` was updated to wait for dsc to report that all downstairs are online after a restart. This avoids a race where we told dsc to start, and then start crutest, but the downstairs are not yet online. All the tests that use dsc will eventually transition to using it to construct a Volume, but I'm pushing that work to another PR. --------- Co-authored-by: Alan Hanson <alan@oxide.computer>
1 parent eedb620 commit 826e820

12 files changed

+511
-165
lines changed

Cargo.lock

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crutest/src/cli.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ pub struct CliAction {
2525
#[allow(clippy::derive_partial_eq_without_eq)]
2626
#[derive(Debug, Parser, PartialEq)]
2727
pub enum DscCommand {
28-
/// Connect to the default DSC server (http://127.0.0.1:9998)
29-
Connect,
28+
/// IP:Port for a dsc server
29+
/// #[clap(long, global = true, default_value = "127.0.0.1:9998", action)]
30+
Connect { server: SocketAddr },
3031
/// Disable random stopping of downstairs
3132
DisableRandomStop,
3233
/// Disable auto restart on the given downstairs client ID
@@ -380,7 +381,7 @@ async fn handle_dsc(
380381
) {
381382
if let Some(dsc_client) = dsc_client {
382383
match dsc_cmd {
383-
DscCommand::Connect => {
384+
DscCommand::Connect { .. } => {
384385
println!("Already connected");
385386
}
386387
DscCommand::DisableRandomStop => {
@@ -444,9 +445,9 @@ async fn handle_dsc(
444445
println!("Got res: {:?}", res);
445446
}
446447
}
447-
} else if dsc_cmd == DscCommand::Connect {
448-
let url = "http://127.0.0.1:9998".to_string();
449-
println!("Connect to {:?}", url);
448+
} else if let DscCommand::Connect { server } = dsc_cmd {
449+
let url = format!("http://{}", server).to_string();
450+
println!("Connecting to {:?}", url);
450451
let rs = Client::new(&url);
451452
*dsc_client = Some(rs);
452453
} else {

0 commit comments

Comments
 (0)