summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-02-03 12:54:53 -0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2009-02-03 12:54:53 -0200
commit5b952da909e0aa3752b4f2b22b5b193e71819f80 (patch)
tree102838264030dfcc3bc14f72e33f3ebd6f93f54f
parentf5f34d2c3609c37c690cfbcc4581b7e79a1f6447 (diff)
downloadtuna-5b952da909e0aa3752b4f2b22b5b193e71819f80.tar.gz
testuna: Add test case for --thread globbing
If the machine has at least two processors we: 1. Find out the rtprio for watchdog/0 (usually 99) 2. Decrement it 3. Use tuna to set watchdog/* to $(rtprio - 1) 4. Then using chrt we check if tuna correctly set the new rtprio for all watchdog threads (one per CPU) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-xtestuna13
1 files changed, 13 insertions, 0 deletions
diff --git a/testuna b/testuna
index 6b97e6c..e694fec 100755
--- a/testuna
+++ b/testuna
@@ -199,6 +199,19 @@ if [ $NR_CPU_SOCKETS -ge 2 ]; then
die_if_not_equal $((AFFINITY & CPU1_SIBLINGS)) $CPU1_SIBLINGS "Moving init to CPU socket $CPU1_SOCKET"
fi
+if [ $NR_PROCESSORS -gt 2 ]; then
+ THREAD_PREFIX="watchdog/"
+ PID=$(ps h -C ${THREAD_PREFIX}0 -o pid)
+ RTPRIO=$(get_rtprio $PID)
+ NEW_RTPRIO=$((RTPRIO - 1))
+ tuna -t $THREAD_PREFIX* -p $NEW_RTPRIO
+ for CPU in $(seq 0 $((NR_PROCESSORS - 1))); do
+ PID=$(ps h -C ${THREAD_PREFIX}$CPU -o pid)
+ RTPRIO=$(get_rtprio $PID)
+ die_if_not_equal $RTPRIO $NEW_RTPRIO "Using --thread globbing"
+ done
+fi
+
taskset -p $INITIAL_INIT_AFFINITY 1 > /dev/null
rtctl --file $INITIAL reset