diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-11-05 12:36:49 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-01-19 11:24:46 +0100 |
commit | 673c7dfc96cfd949b94caa23b944ed3489f4bf5d (patch) | |
tree | fcd6e42dd4247a742a4359d6bece05d035456245 /host/start-vm/tests/vm_command-multiple-disks.rs | |
parent | b1d64acff3fdbe7a0e819ecdd2d3b27620af08b2 (diff) | |
download | spectrum-673c7dfc96cfd949b94caa23b944ed3489f4bf5d.tar spectrum-673c7dfc96cfd949b94caa23b944ed3489f4bf5d.tar.gz spectrum-673c7dfc96cfd949b94caa23b944ed3489f4bf5d.tar.bz2 spectrum-673c7dfc96cfd949b94caa23b944ed3489f4bf5d.tar.lz spectrum-673c7dfc96cfd949b94caa23b944ed3489f4bf5d.tar.xz spectrum-673c7dfc96cfd949b94caa23b944ed3489f4bf5d.tar.zst spectrum-673c7dfc96cfd949b94caa23b944ed3489f4bf5d.zip |
host/start-vm: find config from /run/vm
Having a symlink in the service directory was a nice idea, but since it has to be different for every service, it's not compatible with templated services, and would prevent us switching to them. The only thing that varies between instances of templated services is the name, so we have to introduce a mapping of VM name to config directory. Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'host/start-vm/tests/vm_command-multiple-disks.rs')
-rw-r--r-- | host/start-vm/tests/vm_command-multiple-disks.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/host/start-vm/tests/vm_command-multiple-disks.rs b/host/start-vm/tests/vm_command-multiple-disks.rs index e17d505..cd1e997 100644 --- a/host/start-vm/tests/vm_command-multiple-disks.rs +++ b/host/start-vm/tests/vm_command-multiple-disks.rs @@ -10,10 +10,11 @@ use start_vm::vm_command; use test_helper::TempDir; fn main() -> std::io::Result<()> { - let tmp_dir = TempDir::new()?; + let service_dir_parent = TempDir::new()?; + let service_dir = service_dir_parent.path().join("vm-testvm"); - let service_dir = tmp_dir.path().join("vm-testvm"); - let vm_config = service_dir.join("data/config"); + let vm_dir = TempDir::new()?; + let vm_config = vm_dir.path().join("testvm"); create_dir_all(&vm_config)?; File::create(vm_config.join("vmlinux"))?; @@ -27,7 +28,7 @@ fn main() -> std::io::Result<()> { symlink("/dev/null", image_path)?; } - let command = vm_command(&service_dir, -1).unwrap(); + let command = vm_command(&service_dir, vm_dir.path(), -1).unwrap(); let mut args = command.get_args(); assert!(args.any(|arg| arg == "--disk")); |