-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
phd: add smoke test for VCR replacement #872
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,10 @@ | |
|
||
use std::time::Duration; | ||
|
||
use phd_framework::{ | ||
disk::{BlockSize, DiskSource}, | ||
test_vm::{DiskBackend, DiskInterface}, | ||
}; | ||
use phd_testcase::*; | ||
use propolis_client::types::InstanceState; | ||
|
||
|
@@ -82,3 +86,36 @@ async fn shutdown_persistence_test(ctx: &Framework) { | |
let lsout = vm.run_shell_command("ls foo.bar 2> /dev/null").await?; | ||
assert_eq!(lsout, "foo.bar"); | ||
} | ||
|
||
#[phd_testcase] | ||
async fn vcr_replace_test(ctx: &Framework) { | ||
let mut config = ctx.vm_config_builder("crucible_vcr_replace_test"); | ||
|
||
// Create a blank data disk on which to perform VCR replacement. This is | ||
// necessary because Crucible doesn't permit VCR replacements for volumes | ||
// whose read-only parents are local files (which is true for artifact-based | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should update that. Crucible does support replacement of read only parents now, so perhaps we need to update the file based backend? Though, testing on a data disk is also needed, so not like this is bad or wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're tracking this with oxidecomputer/crucible#1658. |
||
// Crucible disks). | ||
const DATA_DISK_NAME: &str = "vcr-replacement-target"; | ||
config.data_disk( | ||
DATA_DISK_NAME, | ||
DiskSource::Blank(1024 * 1024 * 1024), | ||
DiskInterface::Nvme, | ||
DiskBackend::Crucible { | ||
min_disk_size_gib: 1, | ||
block_size: BlockSize::Bytes512, | ||
}, | ||
5, | ||
); | ||
|
||
let spec = config.vm_spec(ctx).await?; | ||
let disk_hdl = | ||
spec.get_disk_by_device_name(DATA_DISK_NAME).cloned().unwrap(); | ||
let disk = disk_hdl.as_crucible().unwrap(); | ||
|
||
let mut vm = ctx.spawn_vm_with_spec(spec, None).await?; | ||
vm.launch().await?; | ||
vm.wait_to_boot().await?; | ||
|
||
disk.set_generation(2); | ||
vm.replace_crucible_vcr(disk).await?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I wanted to see!