aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Sesek <rsesek@google.com>2016-12-15 18:58:36 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-12-15 18:58:36 +0000
commit5a9bef1d630e6f9886bc77eaccf0457f60a132ab (patch)
treebcff7bd37773ce46cd4195aae450cc9ebf4fc80c
parentfdf9d5a09d52020c69b39eaae58f0ea682d5a857 (diff)
parent7ee435f0a8b6ee8008a2555c86cee95fca0a7441 (diff)
downloadseccomp-tests-5a9bef1d630e6f9886bc77eaccf0457f60a132ab.tar.gz
Apply local modifications to permit running the test suite in CTS. am: d8b24ac2e1 am: 25efbc9e35 am: 5c0fa34c7f
am: 7ee435f0a8 Change-Id: I75270a89a7546dc735887ae0ee2c02a099c4c685
-rw-r--r--README.google5
-rw-r--r--linux/seccomp_bpf.c8
-rw-r--r--linux/test_harness.h8
3 files changed, 17 insertions, 4 deletions
diff --git a/README.google b/README.google
index 134f759..1f0ac50 100644
--- a/README.google
+++ b/README.google
@@ -6,4 +6,7 @@ Description: Mirror of Linux kernel seccomp test suite, run in CTS.
See README.md for information on how to update this repository.
Local Modifications:
-None.
+- Remove usage of pthread_cancel()
+- Use __android_log_print() instead of fprintf()
+- Rename main() to seccomp_test_main()
+- Add get_seccomp_test_list()
diff --git a/linux/seccomp_bpf.c b/linux/seccomp_bpf.c
index c5abe7f..6b3f424 100644
--- a/linux/seccomp_bpf.c
+++ b/linux/seccomp_bpf.c
@@ -1613,7 +1613,7 @@ FIXTURE_TEARDOWN(TSYNC)
if (!s->tid)
continue;
if (pthread_kill(s->tid, 0)) {
- pthread_cancel(s->tid);
+ //pthread_cancel(s->tid); // ANDROID
pthread_join(s->tid, &status);
}
}
@@ -2106,4 +2106,10 @@ TEST(syscall_restart)
* - ...
*/
+// ANDROID:begin
+struct __test_metadata* get_seccomp_test_list() {
+ return __test_list;
+}
+// ANDROID:end
+
TEST_HARNESS_MAIN
diff --git a/linux/test_harness.h b/linux/test_harness.h
index 977a6af..01e534e 100644
--- a/linux/test_harness.h
+++ b/linux/test_harness.h
@@ -49,6 +49,8 @@
#include <sys/wait.h>
#include <unistd.h>
+#include <android/log.h> // ANDROID
+
/* All exported functionality should be declared through this macro. */
#define TEST_API(x) _##x
@@ -206,9 +208,11 @@
} while (0)
/* Unconditional logger for internal use. */
+// ANDROID:begin
#define __TH_LOG(fmt, ...) \
- fprintf(TH_LOG_STREAM, "%s:%d:%s:" fmt "\n", \
+ __android_log_print(ANDROID_LOG_ERROR, "SeccompBpfTest-KernelUnit", "%s:%d:%s:" fmt "\n", \
__FILE__, __LINE__, _metadata->name, ##__VA_ARGS__)
+// ANDROID:end
/* Defines the test function and creates the registration stub. */
#define _TEST(test_name) __TEST_IMPL(test_name, -1)
@@ -301,7 +305,7 @@
if (!__constructor_order) \
__constructor_order = _CONSTRUCTOR_ORDER_BACKWARD; \
} \
- int main(int argc, char **argv) { \
+ int seccomp_test_main(int argc, char **argv) { /* ANDROID */ \
return test_harness_run(argc, argv); \
}