Bernhard Reutner-Fischer | 70722ec | 2007-01-07 15:19:34 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Bernhard Reutner-Fischer | 6c4dade | 2008-09-25 12:13:34 +0000 | [diff] [blame] | 2 | # Copyright 2006 Bernhard Reutner-Fischer |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 3 | # Licensed under GPLv2 or later, see file LICENSE in this source tree. |
Bernhard Reutner-Fischer | 70722ec | 2007-01-07 15:19:34 +0000 | [diff] [blame] | 4 | |
Mike Frysinger | caa7940 | 2009-11-04 18:41:22 -0500 | [diff] [blame] | 5 | . ./testing.sh |
Bernhard Reutner-Fischer | 70722ec | 2007-01-07 15:19:34 +0000 | [diff] [blame] | 6 | a="taskset" |
| 7 | |
| 8 | # testing "test name" "opts" "expected result" "file inp" "stdin" |
Denis Vlasenko | 45ecfc2 | 2008-03-22 17:46:16 +0000 | [diff] [blame] | 9 | testing "taskset (get from pid 1)" "$a -p 1 >/dev/null;echo \$?" "0\n" "" "" |
| 10 | testing "taskset (invalid pid)" "$a -p 0 >/dev/null 2>&1;echo \$?" "1\n" "" "" |
Bernhard Reutner-Fischer | 70722ec | 2007-01-07 15:19:34 +0000 | [diff] [blame] | 11 | testing "taskset (set_aff, needs CAP_SYS_NICE)" \ |
Denys Vlasenko | f8e6b6e | 2009-07-18 13:08:49 +0200 | [diff] [blame] | 12 | "$a 0x1 $SHELL -c '$a -p \$\$ | grep \"current affinity mask: 1\" >/dev/null'; echo \$?" \ |
| 13 | "0\n" "" "" |
Bernhard Reutner-Fischer | 70722ec | 2007-01-07 15:19:34 +0000 | [diff] [blame] | 14 | |
| 15 | unset a |
| 16 | exit $FAILCOUNT |