vmm: fix test_signal_handler
This test fails intermittently when linked against glibc.
Glibc's getpid() caches the result, so it doesn't always do
the syscall. To avoid GNU-related complications, the test
now forces a different syscall (mkdir) - as getpid will be
needed in a later commit.
@@ -88,9 +88,8 @@ mod tests {
use super::*;
use std::mem;
- use std::process;
- use libc::cpu_set_t;
+ use libc::{cpu_set_t, syscall};
use seccomp::{allow_syscall, SeccompAction, SeccompFilter};
@@ -144,8 +143,8 @@ mod tests {
assert!(filter.apply().is_ok());
assert_eq!(METRICS.seccomp.num_faults.count(), 0);
- // Calls the blacklisted SYS_getpid.
- let _pid = process::id();
+ // Call the blacklisted `SYS_mkdir`.
+ unsafe { syscall(libc::SYS_mkdir, "/foo/bar\0") };
assert!(cpu_count() > 0);
