File: basic-output

package info (click to toggle)
iotop-c 1.31-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 564 kB
  • sloc: ansic: 5,690; makefile: 159; sh: 65
file content (28 lines) | stat: -rw-r--r-- 629 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# Smoke test for iotop-c basic output functionality.
# Verify that iotop-c can run in batch mode and produce usable output.

set -eu

# Remove the known iotop-c warning about task_delayacct being disabled.
# All other stderr output is preserved and should be treated as errors.
filter_stderr() {
	sed '/task_delayacct is 0/d'
}

cleanup() {
	rm -f "$out" "$err" "$filtered_err"
}
trap cleanup EXIT

out=$(mktemp)
err=$(mktemp)
filtered_err=$(mktemp)

iotop-c -b -n 1 >"$out" 2>"$err" || true
filter_stderr <"$err" >"$filtered_err"

[ ! -s "$filtered_err" ]

grep -q "Total DISK READ" "$out"
grep -q "DISK WRITE" "$out"