Skip to content

Commit 3c52bdd

Browse files
author
Neil T. Dantam
committed
Add heavily concurrent stress test
1 parent 7494ced commit 3c52bdd

File tree

5 files changed

+578
-8
lines changed

5 files changed

+578
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,4 @@ modules.order
130130
/clocktest
131131
/holedigger
132132
/doc/man/man3
133+
/achstress

Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ noinst_PROGRAMS += holedigger
104104
holedigger_SOURCES = src/test/holedigger.c
105105
holedigger_LDADD = libach.la libachtest.la
106106

107+
noinst_PROGRAMS += achstress
108+
achstress_SOURCES = src/test/achstress.c
109+
achstress_LDADD = libach.la libachtest.la
110+
107111
robusttest_SOURCES = src/test/robusttest.c
108112
robusttest_LDADD = libach.la
109113

TODO

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
TODO list for Ach
22

33
* TODO Return ACH_MISSED_FRAME from kernel-space
4-
* TODO Test message transmission under heavy concurrency
5-
- Create c channels, p publishers, c subscribers, and i interrupters
6-
- Publishers generate random messages, append a checksum, send to
7-
all channels
8-
- Subscribers get messages from all channels, and check the checksum
9-
- Get messages via ach_get() next/last and poll()
10-
- Interrupters randomly signal publishers and subscribers
11-
- Test user, kernel, and anonymous channels
124
* TODO Test for resource leaks
135
- See kmemleak
146
- open/close seem fine

include/achtest.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,17 @@ void check_ach(const char *thing, ach_status_t r );
7676
exit(EXIT_FAILURE); \
7777
} \
7878
}
79+
80+
#define CHECK_ACH_MASK( thing, allow_mask, exp ) \
81+
{ \
82+
enum ach_status check_ach_result = (exp); \
83+
if( !( allow_mask & ACH_MASK_FROM_STATUS(check_ach_result)) ) \
84+
{ \
85+
fprintf(stderr, \
86+
"FAILURE:\t%s: %s, at %s:%d\n" \
87+
"expression:\t(" #exp ")\n", \
88+
thing, ach_result_to_string(check_ach_result), \
89+
__FILE__, __LINE__ ); \
90+
exit(EXIT_FAILURE); \
91+
} \
92+
}

0 commit comments

Comments
 (0)