Skip to content

Commit

Permalink
test: Disable some tests inside stage2
Browse files Browse the repository at this point in the history
These tests can't be run inside the svsm kernel and they can't be run
inside stage2 either.

Signed-off-by: Adam Dunlap <acdunlap@google.com>
  • Loading branch information
AdamCDunlap committed Nov 21, 2023
1 parent 1504201 commit 7b7384e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/fs/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ mod tests {
use crate::mm::alloc::{TestRootMem, DEFAULT_TEST_MEMORY_SIZE};

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
fn create_dir() {
let _test_mem = TestRootMem::setup(DEFAULT_TEST_MEMORY_SIZE);
initialize_fs();
Expand All @@ -510,7 +510,7 @@ mod tests {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
fn create_and_unlink_file() {
let _test_mem = TestRootMem::setup(DEFAULT_TEST_MEMORY_SIZE);
initialize_fs();
Expand Down Expand Up @@ -541,7 +541,7 @@ mod tests {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
fn create_sub_dir() {
let _test_mem = TestRootMem::setup(DEFAULT_TEST_MEMORY_SIZE);
initialize_fs();
Expand Down Expand Up @@ -570,7 +570,7 @@ mod tests {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
fn test_unlink() {
let _test_mem = TestRootMem::setup(DEFAULT_TEST_MEMORY_SIZE);
initialize_fs();
Expand Down Expand Up @@ -600,7 +600,7 @@ mod tests {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
fn test_open_read_write_seek() {
let _test_mem = TestRootMem::setup(DEFAULT_TEST_MEMORY_SIZE);
initialize_fs();
Expand Down Expand Up @@ -652,7 +652,7 @@ mod tests {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
fn test_multiple_file_handles() {
let _test_mem = TestRootMem::setup(DEFAULT_TEST_MEMORY_SIZE);
initialize_fs();
Expand Down
2 changes: 1 addition & 1 deletion src/fs/ramfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ mod tests {
use crate::mm::alloc::{TestRootMem, DEFAULT_TEST_MEMORY_SIZE};

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
fn test_ramfs_file_read_write() {
let _test_mem = TestRootMem::setup(DEFAULT_TEST_MEMORY_SIZE);

Expand Down
18 changes: 9 additions & 9 deletions src/mm/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1313,14 +1313,14 @@ impl Drop for TestRootMem<'_> {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
fn test_root_mem_setup() {
let test_mem_lock = TestRootMem::setup(DEFAULT_TEST_MEMORY_SIZE);
drop(test_mem_lock);
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
// Allocate one page and free it again, verify that memory_info() reflects it.
fn test_page_alloc_one() {
let _test_mem = TestRootMem::setup(DEFAULT_TEST_MEMORY_SIZE);
Expand All @@ -1335,7 +1335,7 @@ fn test_page_alloc_one() {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
// Allocate and free all available compound pages, verify that memory_info()
// reflects it.
fn test_page_alloc_all_compound() {
Expand Down Expand Up @@ -1368,7 +1368,7 @@ fn test_page_alloc_all_compound() {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
// Allocate and free all available 4k pages, verify that memory_info()
// reflects it.
fn test_page_alloc_all_single() {
Expand Down Expand Up @@ -1401,7 +1401,7 @@ fn test_page_alloc_all_single() {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
// Allocate and free all available compound pages, verify that any subsequent
// allocation fails.
fn test_page_alloc_oom() {
Expand Down Expand Up @@ -1439,7 +1439,7 @@ fn test_page_alloc_oom() {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
fn test_page_file() {
let _mem_lock = TestRootMem::setup(DEFAULT_TEST_MEMORY_SIZE);
let mut root_mem = ROOT_MEM.lock();
Expand Down Expand Up @@ -1474,7 +1474,7 @@ fn test_page_file() {
const TEST_SLAB_SIZES: [usize; 7] = [32, 64, 128, 256, 512, 1024, 2048];

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
// Allocate and free a couple of objects for each slab size.
fn test_slab_alloc_free_many() {
extern crate alloc;
Expand Down Expand Up @@ -1514,7 +1514,7 @@ fn test_slab_alloc_free_many() {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
// Allocate enough objects so that the SlabPageSlab will need a SlabPage for
// itself twice.
fn test_slab_page_slab_for_self() {
Expand Down Expand Up @@ -1551,7 +1551,7 @@ fn test_slab_page_slab_for_self() {
}

#[test]
#[cfg_attr(test_in_svsm, ignore = "FIXME")]
#[cfg_attr(any(test_in_svsm, test_in_stage2), ignore = "FIXME")]
// Allocate enough objects to hit an OOM situation and verify null gets
// returned at some point.
fn test_slab_oom() {
Expand Down

0 comments on commit 7b7384e

Please sign in to comment.