patches and low-level development discussion
 help / color / mirror / code / Atom feed
e1e71126a8ad23a9a7141b919729d95fabfec1a9 blob 948 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
// SPDX-License-Identifier: EUPL-1.2+
// SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>

use std::fs::{create_dir, create_dir_all, File};
use std::os::unix::fs::symlink;

use start_vm::fs::Root;
use start_vm::vm_command;
use test_helper::TempDir;

fn main() -> std::io::Result<()> {
    let tmp_dir = TempDir::new().unwrap();
    let root = Root::open(tmp_dir.path()).unwrap();

    let service_dir = tmp_dir.path().join("testvm");
    create_dir(&service_dir).unwrap();

    create_dir(tmp_dir.path().join("svc"))?;
    create_dir(tmp_dir.path().join("svc/data"))?;
    symlink("/config-1/testvm", tmp_dir.path().join("svc/data/testvm"))?;

    let vm_config = tmp_dir.path().join("config-1/testvm");
    create_dir_all(&vm_config)?;
    File::create(vm_config.join("vmlinux"))?;
    create_dir(vm_config.join("blk"))?;
    symlink("/dev/null", vm_config.join("blk/root.img"))?;

    vm_command(service_dir, &root).unwrap();
    Ok(())
}
debug log:

solving e1e7112 ...
found e1e7112 in https://spectrum-os.org/lists/archives/spectrum-devel/20221010232909.1953738-16-hi@alyssa.is/

applying [1/1] https://spectrum-os.org/lists/archives/spectrum-devel/20221010232909.1953738-16-hi@alyssa.is/
diff --git a/host/start-vm/tests/vm_command-config-symlink.rs b/host/start-vm/tests/vm_command-config-symlink.rs
new file mode 100644
index 0000000..e1e7112

Checking patch host/start-vm/tests/vm_command-config-symlink.rs...
Applied patch host/start-vm/tests/vm_command-config-symlink.rs cleanly.

index at:
100644 e1e71126a8ad23a9a7141b919729d95fabfec1a9	host/start-vm/tests/vm_command-config-symlink.rs

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).