blob: 1a19285d721f07e7fd7295283228c7d25a7332cb [file] [log] [blame]
Bernhard Reutner-Fischer70722ec2007-01-07 15:19:34 +00001#!/bin/sh
Bernhard Reutner-Fischer6c4dade2008-09-25 12:13:34 +00002# Copyright 2006 Bernhard Reutner-Fischer
Bernhard Reutner-Fischer70722ec2007-01-07 15:19:34 +00003# Licensed under GPL v2 or later, see file LICENSE for details.
4
Mike Frysingercaa79402009-11-04 18:41:22 -05005. ./testing.sh
Bernhard Reutner-Fischer70722ec2007-01-07 15:19:34 +00006a="taskset"
7
8# testing "test name" "opts" "expected result" "file inp" "stdin"
Denis Vlasenko45ecfc22008-03-22 17:46:16 +00009testing "taskset (get from pid 1)" "$a -p 1 >/dev/null;echo \$?" "0\n" "" ""
10testing "taskset (invalid pid)" "$a -p 0 >/dev/null 2>&1;echo \$?" "1\n" "" ""
Bernhard Reutner-Fischer70722ec2007-01-07 15:19:34 +000011testing "taskset (set_aff, needs CAP_SYS_NICE)" \
Denys Vlasenkof8e6b6e2009-07-18 13:08:49 +020012 "$a 0x1 $SHELL -c '$a -p \$\$ | grep \"current affinity mask: 1\" >/dev/null'; echo \$?" \
13 "0\n" "" ""
Bernhard Reutner-Fischer70722ec2007-01-07 15:19:34 +000014
15unset a
16exit $FAILCOUNT