MCPcopy Create free account
hub / github.com/bootc-dev/bootc / test_loopback_install

Function test_loopback_install

crates/tests-integration/src/hostpriv.rs:18–32  ·  view source on GitHub ↗
(image: &'static str)

Source from the content-addressed store, hash-verified

16}
17
18fn test_loopback_install(image: &'static str) -> Result<()> {
19 let base_args = super::install::BASE_ARGS;
20 let sh = &xshell::Shell::new()?;
21 let size = 10 * 1000 * 1000 * 1000;
22 let mut tmpdisk = tempfile::NamedTempFile::new_in("/var/tmp")?;
23 tmpdisk.as_file_mut().set_len(size)?;
24 let tmpdisk = tmpdisk.into_temp_path();
25 let tmpdisk = tmpdisk.to_str().unwrap();
26 cmd!(
27 sh,
28 "sudo {base_args...} -v {tmpdisk}:/disk {image} bootc install to-disk --via-loopback /disk"
29 )
30 .run()?;
31 Ok(())
32}
33
34/// Tests that require real root (e.g. CAP_SYS_ADMIN) to do things like
35/// create loopback devices, but are *not* destructive. At the current time

Callers

nothing calls this directly

Calls 2

to_strMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected