]> granicus.if.org Git - sysstat/commitdiff
pidstat: Add a new non regression test
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 4 Apr 2020 07:54:07 +0000 (09:54 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 4 Apr 2020 07:54:07 +0000 (09:54 +0200)
This is to test pidstat's option -e.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
tests/05450 [new file with mode: 0644]
tests/05455 [new file with mode: 0644]
tests/TLIST
tests/expected.pidstat-e [new file with mode: 0644]

diff --git a/tests/05450 b/tests/05450
new file mode 100644 (file)
index 0000000..2ed5359
--- /dev/null
@@ -0,0 +1,3 @@
+rm -f tests/root
+ln -s root1 tests/root
+LC_ALL=C TZ=GMT ./pidstat 2 6 -t -e sleep 1 > tests/out.pidstat-e.tmp
diff --git a/tests/05455 b/tests/05455
new file mode 100644 (file)
index 0000000..6eb9997
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.pidstat-e.tmp tests/expected.pidstat-e
index 8b1ce60d3e66a3344f3b0eab94c2e23b929089a6..147aa1e50b1b7b6df2caf0da23ace87c9e97a906 100644 (file)
@@ -589,6 +589,8 @@ NOTES:
 05435  diff -u tests/out.pidstat-Uroot.tmp tests/expected.pidstat-Uroot
 05440  LC_ALL=C TZ=GMT ./pidstat -t -svwu -p 21342,1234,7900,9009 2 6 > tests/out.pidstat-plist.tmp
 05445  diff -u tests/out.pidstat-plist.tmp tests/expected.pidstat-plist
+05450  LC_ALL=C TZ=GMT ./pidstat 2 6 -t -e sleep 1 > tests/out.pidstat-e.tmp
+05455  diff -u tests/out.pidstat-e.tmp tests/expected.pidstat-e
 
 =====  Tests to be done at the very end
 09900  grep -i FIXME *.c *.h *.in && exit 1 || exit 0
diff --git a/tests/expected.pidstat-e b/tests/expected.pidstat-e
new file mode 100644 (file)
index 0000000..2eab598
--- /dev/null
@@ -0,0 +1,45 @@
+Linux 1.2.3-TEST (SYSSTAT.TEST)        01/01/70        _x86_64_        (8 CPU)
+
+00:00:00      UID      TGID       TID    %usr %system  %guest   %wait    %CPU   CPU  Command
+00:00:02     1000      8741         -    0.00    0.00    0.00    0.00    0.00     0  firefox
+00:00:02     1000         -      8741    0.03    0.00    0.00    0.00    0.03     0  |__firefox
+00:00:02     1000         -      8785    0.00    0.00    0.00    0.00    0.00     3  |__JS Helper
+00:00:02     1000         -      8789    0.00    0.00    0.00    0.00    0.00     2  |__Link Monitor
+00:00:02     1000         -      8835    0.00    0.00    0.00    0.00    0.00     0  |__ImgDecoder #1
+00:00:02     1000         -      9109    0.00    0.00    0.00    0.00    0.00     7  |__DOM Worker
+00:00:04     1000      8741         -    0.13    0.03    0.00    0.03    0.16     5  firefox
+00:00:04     1000         -      8741    0.06    0.00    0.00    0.03    0.06     5  |__firefox
+00:00:04     1000         -      8785    0.00    0.00    0.00    0.00    0.00     3  |__JS Helper
+00:00:04     1000         -      8789    0.00    0.00    0.00    0.00    0.00     2  |__Link Monitor
+00:00:04     1000         -      8835    0.00    0.00    0.00    0.00    0.00     0  |__ImgDecoder #1
+00:00:04     1000         -      9109    0.00    0.00    0.00    0.00    0.00     7  |__DOM Worker
+00:00:06     1000      8741         -    0.00    0.00    0.00    0.00    0.00     5  firefox
+00:00:06     1000         -      8741    0.00    0.00    0.00    0.00    0.00     5  |__firefox
+00:00:06     1000         -      8785    0.00 479136209706741632.00    0.00    0.00 479136209706741632.00     5  |__disk_cache:0
+00:00:06     1000         -      8789    0.00    0.00    0.00    0.00    0.00     2  |__Link Monitor
+00:00:06     1000         -      8835    0.00    0.00    0.00    0.00    0.00     0  |__ImgDecoder #1
+00:00:06     1000         -      9109    0.00    0.00    0.00    0.00    0.00     7  |__DOM Worker
+00:00:08     1000      8741         -    0.00    0.00    0.00    0.00    0.00     5  firefox
+00:00:08     1000         -      8741    0.00    0.00    0.00    0.00    0.00     5  |__firefox
+00:00:08     1000         -      8785    0.00    0.00    0.00    0.00    0.00     5  |__disk_cache:0
+00:00:08     1000         -      8789    0.00    0.00    0.00    0.00    0.00     2  |__Link Monitor
+00:00:08     1000         -      8835    0.00    0.00    0.00    0.00    0.00     0  |__ImgDecoder #1
+00:00:08     1000         -      9109    0.00    0.00    0.00    0.00    0.00     7  |__DOM Worker
+00:00:10     1000      8741         -    0.00    0.00    0.00    0.00    0.00     5  firefox
+00:00:10     1000         -      8741    0.00    0.00    0.00    0.00    0.00     5  |__firefox
+00:00:10     1000         -      8785    0.00    0.00    0.00    0.00    0.00     5  |__disk_cache:0
+00:00:10     1000         -      8789    0.00    0.00    0.00    0.00    0.00     2  |__Link Monitor
+00:00:10     1000         -      8835    0.00    0.00    0.00    0.00    0.00     0  |__ImgDecoder #1
+00:00:10     1000         -      9109    0.00    0.00    0.00    0.00    0.00     7  |__DOM Worker
+00:00:12     1000      8741         -    0.00    0.00    0.00    0.00    0.00     5  firefox
+00:00:12     1000         -      8741    0.00    0.00    0.00    0.00    0.00     5  |__firefox
+00:00:12     1000         -      8785    0.00    0.00    0.00    0.00    0.00     5  |__disk_cache:0
+00:00:12     1000         -      8789    0.00    0.00    0.00    0.00    0.00     2  |__Link Monitor
+00:00:12     1000         -      8835    0.00    0.00    0.00    0.00    0.00     0  |__ImgDecoder #1
+00:00:12     1000         -      9109    0.00    0.00    0.00    0.00    0.00     7  |__DOM Worker
+Average:     1000      8741         -    0.13    0.03    0.00    0.03    0.16     -  firefox
+Average:     1000         -      8741    0.10    0.00    0.00    0.03    0.10     -  |__firefox
+Average:     1000         -      8785    0.00 591810846124785152.00    0.00    0.00 591810846124785152.00     -  |__disk_cache:0
+Average:     1000         -      8789    0.00    0.00    0.00    0.00    0.00     -  |__Link Monitor
+Average:     1000         -      8835    0.00    0.00    0.00    0.00    0.00     -  |__ImgDecoder #1
+Average:     1000         -      9109    0.00    0.00    0.00    0.00    0.00     -  |__DOM Worker