From 3d19f7c8765440582a0f1d3a047efcf8afe391b1 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sun, 29 Sep 2013 12:19:00 -0700 Subject: [PATCH] test: disable cross process sem tests on non-Linux How to make this portable: - MAP_ANONYMOUS -> MAP_ANON (OSX) - sem_init (anonymous semaphore) needs to be replaced by named semaphores using sem_open/sem_close. Use a memory address of the sem_t variable to hack anonymous semaphore behavior. - sem_getvalue isn't supported on OSX. it is used here to do sem_wait/sem_post to bring a semaphore back to a specific value. to get around this we may need to restructure the test so that the semaphore can be destroyed and re-initialized rather than inspected as its currently being done. Signed-off-by: Noah Watkins --- src/test/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/Makefile.am b/src/test/Makefile.am index 5faf9ac49fd1..9123f1d2ca1d 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -192,6 +192,7 @@ bin_DEBUGPROGRAMS += ceph_erasure_code_benchmark ## System tests +if LINUX libsystest_la_SOURCES = \ test/system/cross_process_sem.cc \ test/system/systest_runnable.cc \ @@ -229,6 +230,7 @@ ceph_test_rados_watch_notify_SOURCES = \ test/system/st_rados_notify.cc ceph_test_rados_watch_notify_LDADD = $(LIBRADOS) libsystest.la $(PTHREAD_LIBS) bin_DEBUGPROGRAMS += ceph_test_rados_watch_notify +endif ceph_bench_log_SOURCES = test/bench_log.cc ceph_bench_log_LDADD = $(CEPH_GLOBAL) -- 2.47.3