]> granicus.if.org Git - sysstat/commitdiff
simtest: Add tests for sadf "hz=" option
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 25 Apr 2020 07:36:46 +0000 (09:36 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 25 Apr 2020 07:36:46 +0000 (09:36 +0200)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
tests/00602 [new file with mode: 0644]
tests/00608 [new file with mode: 0644]
tests/00609 [new file with mode: 0644]
tests/00660 [new file with mode: 0644]
tests/00662 [new file with mode: 0644]
tests/00664 [new file with mode: 0644]
tests/00665 [new file with mode: 0644]
tests/TLIST
tests/expected.data-9.1.6-hz [new file with mode: 0644]
tests/expected.sadf-H-hz [new file with mode: 0644]
tests/expected.sadf-r-hz [new file with mode: 0644]

diff --git a/tests/00602 b/tests/00602
new file mode 100644 (file)
index 0000000..3e235ba
--- /dev/null
@@ -0,0 +1 @@
+./sadf -c tests/data-9.1.6 -O hz=250 > tests/data-9.1.6-hz.tmp
diff --git a/tests/00608 b/tests/00608
new file mode 100644 (file)
index 0000000..d861ce5
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C TZ=GMT ./sar -f tests/data-9.1.6-hz.tmp > tests/out.data-9.1.6-hz.tmp
diff --git a/tests/00609 b/tests/00609
new file mode 100644 (file)
index 0000000..92da97e
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.data-9.1.6-hz.tmp tests/expected.data-9.1.6-hz
diff --git a/tests/00660 b/tests/00660
new file mode 100644 (file)
index 0000000..a2698c7
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C TZ=GMT ./sadf -H tests/data-9.1.6-hz.tmp > tests/out.sadf-H-hz.tmp
diff --git a/tests/00662 b/tests/00662
new file mode 100644 (file)
index 0000000..9f7853c
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.sadf-H-hz.tmp tests/expected.sadf-H-hz
diff --git a/tests/00664 b/tests/00664
new file mode 100644 (file)
index 0000000..9554051
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C TZ=GMT ./sadf -r -O debug tests/data-9.1.6-hz.tmp > tests/out.sadf-r-hz.tmp
diff --git a/tests/00665 b/tests/00665
new file mode 100644 (file)
index 0000000..ca6766f
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.sadf-r-hz.tmp tests/expected.sadf-r-hz
index ba69adf5168ca5502e3c1030b34fa18304e8de48..6f33e082b1a4450296a59ada11df585d8d9bc80e 100644 (file)
@@ -109,8 +109,11 @@ NOTES:
 
 =====  Checking sadf conversion
 00600  ./sadf -c tests/data-9.1.6 > tests/data-9.1.6.tmp
+00602  ./sadf -c tests/data-9.1.6 -O hz=250 > tests/data-9.1.6-hz.tmp
 00605  LC_ALL=C TZ=GMT ./sar -C -A -f tests/data-9.1.6.tmp > tests/out.data-9.1.6.tmp
 00607  diff -u tests/out.data-9.1.6.tmp tests/expected.data-9.1.6
+00608  LC_ALL=C TZ=GMT ./sar -f tests/data-9.1.6-hz.tmp > tests/out.data-9.1.6-hz.tmp
+00609  diff -u tests/out.data-9.1.6-hz.tmp tests/expected.data-9.1.6-hz
 00610  ./sadf -c tests/data-10.3.1 > tests/data-10.3.1.tmp
 00615  LC_ALL=C TZ=GMT ./sar -C -A -f tests/data-10.3.1.tmp > tests/out.data-10.3.1.tmp
 00617  diff -u tests/out.data-10.3.1.tmp tests/expected.data-10.3.1
@@ -119,6 +122,10 @@ NOTES:
 00627  diff -u tests/out.data-11.6.5.tmp tests/expected.data-11.6.5    
 00650  LC_ALL=C TZ=GMT ./sar -AC -f tests/data-12.0.0 > tests/out.data-12.0.0.tmp
 00655  diff -u tests/out.data-12.0.0.tmp tests/expected.data-12.0.0
+00660  LC_ALL=C TZ=GMT ./sadf -H tests/data-9.1.6-hz.tmp > tests/out.sadf-H-hz.tmp
+00662  diff -u tests/out.sadf-H-hz.tmp tests/expected.sadf-H-hz
+00664  LC_ALL=C TZ=GMT ./sadf -r -O debug tests/data-9.1.6-hz.tmp > tests/out.sadf-r-hz.tmp
+00665  diff -u tests/out.sadf-r-hz.tmp tests/expected.sadf-r-hz
 
 =====  Reading datafile from another architecture
 00700  LC_ALL=C TZ=GMT ./sar -C -A -f tests/data-ppc-11.7.2 > tests/out.data-ppc-11.7.2.tmp
diff --git a/tests/expected.data-9.1.6-hz b/tests/expected.data-9.1.6-hz
new file mode 100644 (file)
index 0000000..d170bcb
--- /dev/null
@@ -0,0 +1,7 @@
+Linux 4.4.14-200.fc22.x86_64 (kluane.home)     01/21/17        _x86_64_        (8 CPU)
+
+08:16:11     LINUX RESTART     (8 CPU)
+
+08:17:01        CPU     %user     %nice   %system   %iowait    %steal     %idle
+08:17:02        all      0.13      0.00      0.13      0.38      0.00     99.37
+Average:        all      0.13      0.00      0.13      0.38      0.00     99.37
diff --git a/tests/expected.sadf-H-hz b/tests/expected.sadf-H-hz
new file mode 100644 (file)
index 0000000..db5e521
--- /dev/null
@@ -0,0 +1,45 @@
+System activity data file: tests/data-9.1.6-hz.tmp (0x2175)
+File created by sar/sadc from sysstat version 9.1.6
+Genuine sa datafile: no (90a)
+Host: Linux 4.4.14-200.fc22.x86_64 (kluane.home)       01/21/17        _x86_64_        (8 CPU)
+File date: 2017-01-21
+File time: 08:16:11 UTC (1484986571)
+Timezone: 
+File composition: (1,1,12),(0,0,9),(2,0,1)
+Size of a long int: 8
+HZ = 250
+Number of activities in file: 32
+Extra structures available: N
+List of activities:
+01: [8b] A_CPU                Y:   9   (10,0,0)
+02: [8b] A_PCSW               N:   1   (1,1,0)
+03: [8b] A_IRQ                Y: 257   (1,0,0)
+04: [8a] A_SWAP               N:   1   (0,2,0)
+05: [8a] A_PAGE               N:   1   (0,8,0)
+06: [8b] A_IO                 N:   1   (7,0,0)
+07: [8b] A_MEMORY             N:   1   (17,0,0)
+08: [8b] A_KTABLES            N:   1   (4,0,0)
+09: [8c] A_QUEUE              N:   1   (3,0,3)
+11: [8c] A_DISK               Y:  20   (3,3,8)
+12: [8d] A_NET_DEV            Y:   7   (7,0,1)
+13: [8c] A_NET_EDEV           Y:   7   (9,0,0)
+14: [8a] A_NET_NFS            N:   1   (0,0,6)
+15: [8a] A_NET_NFSD           N:   1   (0,0,11)
+16: [8a] A_NET_SOCK           N:   1   (0,0,6)
+17: [8c] A_NET_IP             N:   1   (8,0,0)
+18: [8c] A_NET_EIP            N:   1   (8,0,0)
+19: [8a] A_NET_ICMP           N:   1   (0,14,0)
+20: [8a] A_NET_EICMP          N:   1   (0,12,0)
+21: [8a] A_NET_TCP            N:   1   (0,4,0)
+22: [8a] A_NET_ETCP           N:   1   (0,5,0)
+23: [8a] A_NET_UDP            N:   1   (0,4,0)
+24: [8a] A_NET_SOCK6          N:   1   (0,0,4)
+25: [8c] A_NET_IP6            N:   1   (10,0,0)
+26: [8c] A_NET_EIP6           N:   1   (11,0,0)
+27: [8a] A_NET_ICMP6          N:   1   (0,17,0)
+28: [8a] A_NET_EICMP6         N:   1   (0,11,0)
+29: [8a] A_NET_UDP6           N:   1   (0,4,0)
+30: [8a] A_PWR_CPU            Y:   9   (0,1,0)
+31: [8a] A_PWR_FAN            Y:   1   (2,0,0)
+32: [8a] A_PWR_TEMP           Y:   6   (3,0,0)
+34: [8b] A_HUGE               N:   1   (4,0,0)
diff --git a/tests/expected.sadf-r-hz b/tests/expected.sadf-r-hz
new file mode 100644 (file)
index 0000000..f879d51
--- /dev/null
@@ -0,0 +1,7 @@
+# uptime_cs; 0; ust_time; 1484986571; extra_next; 0; record_type; 2; HH:MM:SS; 09:16:11
+08:16:11 UTC; LINUX-RESTART (8 CPU)
+# uptime_cs; 0; ust_time; 1484986616; extra_next; 0; record_type; 4; HH:MM:SS; 09:16:56
+# uptime_cs; 143121; ust_time; 1484986621; extra_next; 0; record_type; 1; HH:MM:SS; 09:17:01
+# uptime_cs; 143161; ust_time; 1484986622; extra_next; 0; record_type; 1; HH:MM:SS; 09:17:02
+# name; A_CPU; nr_curr; 9; nr_alloc; 9; nr_ini; 9
+08:17:02 UTC; CPU; -1; %user; 24019; 24021; %nice; 389; 389; %system; 9942; 9944; %iowait; 18502; 18505; %steal; 0; 0; %idle; 2805605; 2806397;