Skip to content

Commit

Permalink
test(integration): Disable test for skipping empty update disks
Browse files Browse the repository at this point in the history
As caterpillar is now a long-running service, it never quits.
This means that currently the tests for skipping on "no update found"
can not be run, as they relied on the application exiting at some point.

Signed-off-by: David Runge <[email protected]>
  • Loading branch information
dvzrv committed Sep 28, 2023
1 parent 6752f94 commit 43cd447
Showing 1 changed file with 50 additions and 50 deletions.
100 changes: 50 additions & 50 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,59 +219,59 @@ fn integration_success_override(
Ok(())
}

#[rstest]
#[case(FileSystem::Btrfs)]
#[case(FileSystem::Ext4)]
#[case(FileSystem::Vfat)]
#[file_serial]
fn integration_skip_empty(
cmd_qemu_img: Result<Cmd, which::Error>,
cmd_qemu_system: Result<Cmd, which::Error>,
cmd_guestmount: Result<Cmd, which::Error>,
cmd_guestunmount: Result<Cmd, which::Error>,
input_path_ovmf_code: Result<PathBuf, TestError>,
ab_image: Result<TestImage, TestError>,
ovmf_vars: Result<PathBuf, TestError>,
bundle_disks: Result<Vec<UpdateImage>, TestError>,
rauc_bundles: Result<Vec<RaucBundle>, TestError>,
#[case] filesystem: FileSystem,
) -> TestResult {
let name = "skip_empty";
let disk_type = DiskType::Empty;
// #[rstest]
// #[case(FileSystem::Btrfs)]
// #[case(FileSystem::Ext4)]
// #[case(FileSystem::Vfat)]
// #[file_serial]
// fn integration_skip_empty(
// cmd_qemu_img: Result<Cmd, which::Error>,
// cmd_qemu_system: Result<Cmd, which::Error>,
// cmd_guestmount: Result<Cmd, which::Error>,
// cmd_guestunmount: Result<Cmd, which::Error>,
// input_path_ovmf_code: Result<PathBuf, TestError>,
// ab_image: Result<TestImage, TestError>,
// ovmf_vars: Result<PathBuf, TestError>,
// bundle_disks: Result<Vec<UpdateImage>, TestError>,
// rauc_bundles: Result<Vec<RaucBundle>, TestError>,
// #[case] filesystem: FileSystem,
// ) -> TestResult {
// let name = "skip_empty";
// let disk_type = DiskType::Empty;

let qemu_img = cmd_qemu_img?;
let qemu_system = cmd_qemu_system?;
let guestmount = cmd_guestmount?;
let guestunmount = cmd_guestunmount?;
let ovmf_vars = ovmf_vars?;
let update_bundles = rauc_bundles?;
let bundle_disk = match bundle_disks?
.iter()
.find(|x| x.filesystem().eq(&filesystem) && x.disk_type().eq(&disk_type))
{
Some(bundle) => bundle.clone(),
None => return Err(testresult::TestError::from("foo")),
};
// let qemu_img = cmd_qemu_img?;
// let qemu_system = cmd_qemu_system?;
// let guestmount = cmd_guestmount?;
// let guestunmount = cmd_guestunmount?;
// let ovmf_vars = ovmf_vars?;
// let update_bundles = rauc_bundles?;
// let bundle_disk = match bundle_disks?
// .iter()
// .find(|x| x.filesystem().eq(&filesystem) && x.disk_type().eq(&disk_type))
// {
// Some(bundle) => bundle.clone(),
// None => return Err(testresult::TestError::from("foo")),
// };

let test_image = ab_image?;
println!("Built ab_image: {:?}", &test_image);
test_image.prepare_for_test(&qemu_img, &guestmount, &guestunmount)?;
// let test_image = ab_image?;
// println!("Built ab_image: {:?}", &test_image);
// test_image.prepare_for_test(&qemu_img, &guestmount, &guestunmount)?;

bundle_disk.prepare_test(&qemu_img, &guestmount, &guestunmount, vec![])?;
// bundle_disk.prepare_test(&qemu_img, &guestmount, &guestunmount, vec![])?;

println!("Created OVMF vars: {}", ovmf_vars.display());
println!("Using bundle disk: {:?}", bundle_disk.path().display());
println!("Created RAUC bundles: {:?}", update_bundles);
// println!("Created OVMF vars: {}", ovmf_vars.display());
// println!("Using bundle disk: {:?}", bundle_disk.path().display());
// println!("Created RAUC bundles: {:?}", update_bundles);

run_test(
&qemu_system,
&qemu_img,
input_path_ovmf_code?,
ovmf_vars,
test_image,
bundle_disk,
name,
)?;
// run_test(
// &qemu_system,
// &qemu_img,
// input_path_ovmf_code?,
// ovmf_vars,
// test_image,
// bundle_disk,
// name,
// )?;

Ok(())
}
// Ok(())
// }

0 comments on commit 43cd447

Please sign in to comment.