diff options
author | Robert Sesek <rsesek@google.com> | 2016-12-15 18:42:59 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-12-15 18:42:59 +0000 |
commit | 5c0fa34c7fb0aa3fb10b0fb256ec3f2b52b2283c (patch) | |
tree | bcff7bd37773ce46cd4195aae450cc9ebf4fc80c | |
parent | a4fe6644f5bb2bea7d572f2e33aba865b60bc741 (diff) | |
parent | 25efbc9e3570ceb1e16b5c91d3faa6ad0fd83b69 (diff) | |
download | seccomp-tests-5c0fa34c7fb0aa3fb10b0fb256ec3f2b52b2283c.tar.gz |
Apply local modifications to permit running the test suite in CTS. am: d8b24ac2e1
am: 25efbc9e35
Change-Id: Ib0b1e79f9196a2a7ae4aa951a7f0a85f413f69d9
-rw-r--r-- | README.google | 5 | ||||
-rw-r--r-- | linux/seccomp_bpf.c | 8 | ||||
-rw-r--r-- | linux/test_harness.h | 8 |
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); \ } |