blob: 3fb5c90d004455782ee8b93660c25893b16cd473 [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
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02003# Licensed under GPLv2 or later, see file LICENSE in this source tree.
Bernhard Reutner-Fischer70722ec2007-01-07 15:19:34 +00004
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