Commit 7c4492ac authored by Philippe Gerum's avatar Philippe Gerum

testsuite/smokey: fail if out of quota

parent 983e58e5
......@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <limits.h>
#include <unistd.h>
#include <math.h>
#include <pthread.h>
#include <semaphore.h>
#include <sched.h>
......@@ -328,5 +329,11 @@ static int run_sched_quota(struct smokey_test *t, int argc, char *const argv[])
smokey_trace("%d thread%s: cap=%d%%, effective=%.1f%%",
nrthreads, nrthreads > 1 ? "s": "", quota, effective);
if (fabs(effective - (double)quota) > 0.5) {
smokey_warning("out of quota: %.1f%%",
effective - (double)quota);
return -EPROTO;
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment