aboutsummaryrefslogtreecommitdiffstats
path: root/sys/decl_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-01-05 14:33:44 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-01-09 20:20:48 +0100
commite8ddc2ae566d258db10a700b9e3a2e9548126d69 (patch)
tree6082046e106867f70bb22818b55addaae6a079fb /sys/decl_test.go
parent9ba75ee1d71c41ca08dd45eaafacd2bd94303c00 (diff)
sys: don't add clock_gettime always
Currently we always enable clock_gettime in config. This is required since the call is needed for generation of timespec/timeval structs. The negative side effect is that one gets clock_gettime even if he wants to fuzz a small set of unrelated syscalls. Don't enable clock_gettime by default. Instead handle timeval/timespec as other resources.
Diffstat (limited to 'sys/decl_test.go')
-rw-r--r--sys/decl_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/decl_test.go b/sys/decl_test.go
index a5c1d7be4..7c64f28fe 100644
--- a/sys/decl_test.go
+++ b/sys/decl_test.go
@@ -33,3 +33,16 @@ func TestTransitivelyEnabledCalls(t *testing.T) {
t.Fatalf("epoll fd is not disabled")
}
}
+
+func TestClockGettime(t *testing.T) {
+ calls := make(map[*Call]bool)
+ for _, c := range Calls {
+ calls[c] = true
+ }
+ // Removal of clock_gettime should disable all calls that accept timespec/timeval.
+ delete(calls, CallMap["clock_gettime"])
+ trans := TransitivelyEnabledCalls(calls)
+ if len(trans)+10 > len(calls) {
+ t.Fatalf("clock_gettime did not disable enough calls: before %v, after %v", len(calls), len(trans))
+ }
+}