File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,17 @@ def msr_reader_bin(test_fc_session_root_path):
274274 yield msr_reader_bin_path
275275
276276
277+ @pytest .fixture (scope = "session" )
278+ def jailer_time_bin (test_fc_session_root_path ):
279+ """Build a binary that fakes fc"""
280+ jailer_time_bin_path = os .path .join (test_fc_session_root_path , "jailer_time" )
281+ build_tools .gcc_compile (
282+ "host_tools/jailer_time.c" ,
283+ jailer_time_bin_path ,
284+ )
285+ yield jailer_time_bin_path
286+
287+
277288@pytest .fixture
278289def bin_seccomp_paths ():
279290 """Build jailers and jailed binaries to test seccomp.
Original file line number Diff line number Diff line change 1+ #include <stdio.h>
2+ #include <time.h>
3+
4+ int main (int argc , char * * argv ) {
5+ // print current time in us
6+ struct timespec now = {0 };
7+ clock_gettime (CLOCK_MONOTONIC , & now );
8+ unsigned long long current_ns = (unsigned long long )now .tv_sec * 1000000000 + (unsigned long long )now .tv_nsec ;
9+ unsigned long long current_us = current_ns / 1000 ;
10+ printf ("%llu\n" , current_us );
11+
12+ // print the --start-time-us value
13+ printf ("%s" , argv [4 ]);
14+ }
You can’t perform that action at this time.
0 commit comments