summaryrefslogtreecommitdiffstats
path: root/recipes-enea/count-ticks/count-ticks/run-ptest
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-enea/count-ticks/count-ticks/run-ptest')
-rw-r--r--recipes-enea/count-ticks/count-ticks/run-ptest23
1 files changed, 23 insertions, 0 deletions
diff --git a/recipes-enea/count-ticks/count-ticks/run-ptest b/recipes-enea/count-ticks/count-ticks/run-ptest
new file mode 100644
index 0000000..a56e64a
--- /dev/null
+++ b/recipes-enea/count-ticks/count-ticks/run-ptest
@@ -0,0 +1,23 @@
1#!/bin/sh -eu
2
3fail () {
4 printf "%s" "$*"
5 exit
6}
7
8count_ticks --cpu 0 --start || fail "Failed starting tick counting"
9find /usr -name dummy 2>&1 > /dev/null
10
11nr_ticks=$(count_ticks --batch --cpu 0 --end)
12
13if [ $? -ne 0 ]; then
14 echo "FAIL: count_ticks failed execution"
15 exit
16fi
17
18if [ $nr_ticks == 0 ]; then
19 echo "FAIL: count_ticks didn't see any ticks"
20 exit
21fi
22
23echo "PASS: count_ticks"