~sircmpwn/ctools

ref: 0e9f63c42367ef836a3dbe9369cb987558b0d9e3 ctools/test/nice -rwxr-xr-x 344 bytes
0e9f63c4 — Christopher Vittal Add dirname 1 year, 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
. "$HARNESS" cmp

should_set_niceness() {
	if [ "$(uname)" != "Linux" ]
	then
		printf "SKIP(requires Linux) "
		return
	fi
	o="$(cat /proc/self/stat | cut -d ' ' -f19)"
	n="$(nice -n 5 cat /proc/self/stat | cut -d' ' -f19)"
	[ $((n-o)) -eq 5 ]
}

should_handle_ddash nice true

runtests \
	should_handle_ddash \
	should_set_niceness