From 80f9c2a258c848437ca66ddf6a0f6be638478fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Sun, 2 Jan 2022 16:54:49 +0100 Subject: [PATCH] Remove memory size unit tests These tests are obsolete once the guest memory minimum is enforced. Replacing these tests is tracked in https://github.com/hermitcore/uhyve/issues/265. --- .github/workflows/ci.yml | 10 ++----- src/vm.rs | 64 ---------------------------------------- 2 files changed, 2 insertions(+), 72 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3875cfb6..51f8c423 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@v2 - name: Test run: | - cargo test --lib -- --skip test_vm + cargo test --lib cargo test --bins --examples cargo test --doc @@ -55,11 +55,8 @@ jobs: sudo apt-get update sudo apt-get install -y --no-install-recommends gdb - uses: actions/checkout@v2 - with: - lfs: true - - run: git lfs checkout benches_data/hello_world - name: Integration Tests - run: cargo test --lib --test '*' + run: cargo test --test '*' rusty_demo: name: rusty_demo @@ -133,9 +130,6 @@ jobs: sudo apt-get update sudo apt-get install -y --no-install-recommends gdb - uses: actions/checkout@v2 - with: - lfs: true - - run: git lfs checkout benches_data/hello_world - name: Install cargo-llvm-cov run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin - name: Generate code coverage diff --git a/src/vm.rs b/src/vm.rs index e97d29e5..9f5e02da 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -579,67 +579,3 @@ pub trait Vm { Ok(()) } } - -#[cfg(test)] -mod tests { - #[cfg(target_os = "linux")] - use crate::vm::Vm; - - #[cfg(target_os = "linux")] - #[test] - fn test_vm_load_min_size_1024() { - let path = [env!("CARGO_MANIFEST_DIR"), "benches_data/hello_world"] - .iter() - .collect(); - let res = crate::Uhyve::new( - path, - &crate::vm::Parameter { - mem_size: 1024, - num_cpus: 1, - verbose: false, - hugepage: true, - mergeable: false, - ip: None, - gateway: None, - mask: None, - nic: None, - gdbport: None, - }, - ); - // EINVAL 22 Invalid argument - assert_eq!(kvm_ioctls::Error::new(22), res.unwrap_err()); - } - - #[cfg(target_os = "linux")] - #[test] - fn test_vm_load_min_size_102400() { - let path = [env!("CARGO_MANIFEST_DIR"), "benches_data/hello_world"] - .iter() - .collect(); - let mut vm = crate::Uhyve::new( - path, - &crate::vm::Parameter { - mem_size: 102400, - num_cpus: 1, - verbose: false, - hugepage: true, - mergeable: false, - ip: None, - gateway: None, - mask: None, - nic: None, - gdbport: None, - }, - ) - .expect("Unable to create VM"); - let res = unsafe { vm.load_kernel() }; - match res.unwrap_err() { - crate::vm::LoadKernelError::InsufficientMemory => {} - err => panic!( - "Expected {:?}, got {:?}", - crate::vm::LoadKernelError::InsufficientMemory, - err - ), - } - } -}