[PATCH 1/4] tests: add sched_rr_get_interval.test

Fei Jie feij.fnst at cn.fujitsu.com
Mon Apr 25 08:18:20 UTC 2016


* tests/sched_rr_get_interval.c: New file.
* tests/sched_rr_get_interval.test: New test.
* tests/.gitignore: Add sched_rr_get_interval.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sched_rr_get_interval.test.
---
 tests/.gitignore                 |  1 +
 tests/Makefile.am                |  2 ++
 tests/sched_rr_get_interval.c    | 26 ++++++++++++++++++++++++++
 tests/sched_rr_get_interval.test |  6 ++++++
 4 files changed, 35 insertions(+)
 create mode 100644 tests/sched_rr_get_interval.c
 create mode 100755 tests/sched_rr_get_interval.test

diff --git a/tests/.gitignore b/tests/.gitignore
index 5b3cb43..df8b12f 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -152,6 +152,7 @@ rt_sigsuspend
 rt_sigtimedwait
 rt_tgsigqueueinfo
 sched_get_priority_mxx
+sched_rr_get_interval
 sched_xetaffinity
 sched_xetattr
 sched_xetparam
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e16b327..9dcbbb6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -203,6 +203,7 @@ check_PROGRAMS = \
 	rt_sigtimedwait \
 	rt_tgsigqueueinfo \
 	sched_get_priority_mxx \
+	sched_rr_get_interval \
 	sched_xetaffinity \
 	sched_xetattr \
 	sched_xetparam \
@@ -450,6 +451,7 @@ DECODER_TESTS = \
 	rt_sigtimedwait.test \
 	rt_tgsigqueueinfo.test \
 	sched_get_priority_mxx.test \
+	sched_rr_get_interval.test \
 	sched_xetaffinity.test \
 	sched_xetattr.test \
 	sched_xetparam.test \
diff --git a/tests/sched_rr_get_interval.c b/tests/sched_rr_get_interval.c
new file mode 100644
index 0000000..dd069e2
--- /dev/null
+++ b/tests/sched_rr_get_interval.c
@@ -0,0 +1,26 @@
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_sched_rr_get_interval
+
+# include <stdio.h>
+# include <sched.h>
+# include <unistd.h>
+
+int
+main(void)
+{
+	struct timespec *const tp = tail_alloc(sizeof(struct timespec));
+	long rc = syscall(__NR_sched_rr_get_interval, -1, tp);
+	printf("sched_rr_get_interval(-1, %p) = %ld %s (%m)\n",
+	       tp, rc, errno2name());
+
+	puts("+++ exited with 0 +++");
+	return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_sched_rr_get_interval")
+
+#endif
diff --git a/tests/sched_rr_get_interval.test b/tests/sched_rr_get_interval.test
new file mode 100755
index 0000000..828ba5d
--- /dev/null
+++ b/tests/sched_rr_get_interval.test
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check sched_rr_get_interval syscall decoding.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a31
-- 
1.8.3.1







More information about the Strace-devel mailing list