Skip to content

Commit

Permalink
Check for affinity support of the platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Barbette committed Sep 19, 2017
1 parent 1907ba1 commit 2d413fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/threads/affinity-01.testie
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
Test affinity parameters

%require
taskset -V
#Click needs multi-threading to support MT affinity...
click-buildtool provides umultithread
#Check the number of CPU is bigger than 1
test "$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | tail -1)" -gt 1
#Check for affinity support (some container environment forbid tasksetting)
taskset -c 1 sleep 0.2 >/dev/null 2>/dev/null &
pid=$!
sleep 0.1
[ $(taskset -p $pid | rev | cut -d' ' -f1) -eq 2 ]

%script
#Affinity to core 0
Expand Down

0 comments on commit 2d413fb

Please sign in to comment.