Skip to content

Commit

Permalink
Define the seccomp tests only for musl
Browse files Browse the repository at this point in the history
Instead of defining the tests functions as musl-specific,
define the whole test module as musl-specific.

Eliminates compile time warning when building tests with glibc.

Signed-off-by: Adrian Catangiu <acatan@amazon.com>
  • Loading branch information
acatangiu authored and andreeaflorescu committed Dec 28, 2018
1 parent 45c91e5 commit 56267c6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions vmm/src/default_syscalls.rs
Expand Up @@ -552,14 +552,14 @@ pub fn default_context() -> Result<SeccompFilterContext, Error> {
}

#[cfg(test)]
#[cfg(target_env = "musl")]
mod tests {
extern crate libc;
extern crate seccomp;

use super::*;

#[test]
#[cfg(target_env = "musl")]
fn test_basic_seccomp() {
let mut rules = ALLOWED_SYSCALLS.to_vec();
rules.extend(vec![
Expand All @@ -573,7 +573,6 @@ mod tests {
}

#[test]
#[cfg(target_env = "musl")]
fn test_advanced_seccomp() {
// Sets up context with additional rules required by the test.
let mut context = default_context().unwrap();
Expand Down

0 comments on commit 56267c6

Please sign in to comment.