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

Function passing_fixture

crates/lib/src/lints.rs:917–937  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

915 }
916
917 fn passing_fixture() -> Result<cap_std_ext::cap_tempfile::TempDir> {
918 // Create a temporary directory fixture that is expected to pass most lints.
919 let root = cap_std_ext::cap_tempfile::tempdir(cap_std::ambient_authority())?;
920 for d in API_DIRS {
921 root.create_dir(d)?;
922 }
923 root.create_dir_all("usr/lib/modules/5.7.2")?;
924 root.write("usr/lib/modules/5.7.2/vmlinuz", "vmlinuz")?;
925
926 root.create_dir("boot")?;
927 root.create_dir("sysroot")?;
928 root.symlink_contents("sysroot/ostree", "ostree")?;
929
930 const PREPAREROOT_PATH: &str = "usr/lib/ostree/prepare-root.conf";
931 const PREPAREROOT: &str =
932 include_str!("../../../baseimage/base/usr/lib/ostree/prepare-root.conf");
933 root.create_dir_all(Utf8Path::new(PREPAREROOT_PATH).parent().unwrap())?;
934 root.atomic_write(PREPAREROOT_PATH, PREPAREROOT)?;
935
936 Ok(root)
937 }
938
939 #[test]
940 fn test_var_run() -> Result<()> {

Callers 6

test_apiFunction · 0.85
test_lint_mainFunction · 0.85
test_lint_innerFunction · 0.85
test_bootFunction · 0.85
test_baseimage_rootFunction · 0.85
test_composefsFunction · 0.85

Calls

no outgoing calls

Tested by 6

test_apiFunction · 0.68
test_lint_mainFunction · 0.68
test_lint_innerFunction · 0.68
test_bootFunction · 0.68
test_baseimage_rootFunction · 0.68
test_composefsFunction · 0.68