19
19
# parse_proc_cpuinfo
21
cat <<EOF > "$TMPDIR/expected"
21
cat <<EOF > "$PT_TMPDIR/expected"
22
22
Processors | physical = 1, cores = 2, virtual = 2, hyperthreading = no
23
23
Speeds | 2x1300.000
24
24
Models | 2xGenuine Intel(R) CPU U7300 @ 1.30GHz
28
parse_proc_cpuinfo "$samples/proc_cpuinfo001.txt" > "$TMPDIR/got"
29
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_proc_cpuinfo, proc_cpuinfo001.txt"
28
parse_proc_cpuinfo "$samples/proc_cpuinfo001.txt" > "$PT_TMPDIR/got"
29
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "parse_proc_cpuinfo, proc_cpuinfo001.txt"
31
cat <<EOF > "$TMPDIR/expected"
31
cat <<EOF > "$PT_TMPDIR/expected"
32
32
Processors | physical = 1, cores = 1, virtual = 2, hyperthreading = yes
33
33
Speeds | 2x1000.000
34
34
Models | 2xIntel(R) Atom(TM) CPU N455 @ 1.66GHz
38
parse_proc_cpuinfo "$samples/proc_cpuinfo002.txt" > "$TMPDIR/got"
39
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_proc_cpuinfo, proc_cpuinfo002.txt"
38
parse_proc_cpuinfo "$samples/proc_cpuinfo002.txt" > "$PT_TMPDIR/got"
39
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "parse_proc_cpuinfo, proc_cpuinfo002.txt"
42
cat <<EOF > "$TMPDIR/in"
42
cat <<EOF > "$PT_TMPDIR/in"
44
44
Supported ports: [ TP MII ]
45
45
Supported link modes: 10baseT/Half 10baseT/Full
65
cat <<EOF > "$TMPDIR/expected"
65
cat <<EOF > "$PT_TMPDIR/expected"
66
66
Device Speed Duplex
67
67
========= ========= =========
71
parse_ethtool "$TMPDIR/in" > "$TMPDIR/got"
71
parse_ethtool "$PT_TMPDIR/in" > "$PT_TMPDIR/got"
73
"$PT_TMPDIR/expected" \
75
75
"parse_ethtool works"
77
cat <<EOF > "$TMPDIR/in"
77
cat <<EOF > "$PT_TMPDIR/in"
79
79
Supported ports: [ TP MII ]
80
80
Supported link modes: 10baseT/Half 10baseT/Full
117
117
Link detected: no
120
cat <<EOF > "$TMPDIR/expected"
120
cat <<EOF > "$PT_TMPDIR/expected"
121
121
Device Speed Duplex
122
122
========= ========= =========
124
124
eth4 100Mb/s Full
127
parse_ethtool "$TMPDIR/in" > "$TMPDIR/got"
127
parse_ethtool "$PT_TMPDIR/in" > "$PT_TMPDIR/got"
129
"$PT_TMPDIR/expected" \
131
131
"parse_ethtool works if there are multiple devices"
135
cat <<EOF > $TMPDIR/expected
135
cat <<EOF > $PT_TMPDIR/expected
136
136
Connections from remote IP addresses
147
parse_netstat "$samples/netstat-001.txt" > "$TMPDIR/got"
148
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_netstat, netstat-001.txt"
147
parse_netstat "$samples/netstat-001.txt" > "$PT_TMPDIR/got"
148
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "parse_netstat, netstat-001.txt"
150
cat <<EOF > "$TMPDIR/expected"
150
cat <<EOF > "$PT_TMPDIR/expected"
151
151
Connections from remote IP addresses
184
parse_netstat "$samples/netstat-002.txt" > "$TMPDIR/got"
185
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_netstat, netstat-002.txt"
184
parse_netstat "$samples/netstat-002.txt" > "$PT_TMPDIR/got"
185
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "parse_netstat, netstat-002.txt"
187
cat <<EOF > "$TMPDIR/expected"
187
cat <<EOF > "$PT_TMPDIR/expected"
188
188
Connections from remote IP addresses
213
parse_netstat "$samples/netstat-003.txt" > "$TMPDIR/got"
214
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_netstat, netstat-003.txt"
213
parse_netstat "$samples/netstat-003.txt" > "$PT_TMPDIR/got"
214
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "parse_netstat, netstat-003.txt"
216
216
# parse_lsi_megaraid
218
cat <<EOF > "$TMPDIR/expected"
218
cat <<EOF > "$PT_TMPDIR/expected"
219
219
BBU | 100% Charged, Temperature 18C, isSOHGood=Yes
222
cat <<EOF > "$TMPDIR/in"
222
cat <<EOF > "$PT_TMPDIR/in"
223
223
BBU status for Adapter: 0
253
parse_lsi_megaraid_bbu_status "$TMPDIR/in" > "$TMPDIR/got"
254
no_diff "$TMPDIR/got" "$TMPDIR/expected"
253
parse_lsi_megaraid_bbu_status "$PT_TMPDIR/in" > "$PT_TMPDIR/got"
254
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected"
256
256
# ############################################################################
257
cat <<EOF > "$TMPDIR/expected"
257
cat <<EOF > "$PT_TMPDIR/expected"
259
259
PhysiclDev Type State Errors Vendor Model Size
260
260
========== ==== ======= ====== ======= ============ ===========
354
parse_lsi_megaraid_devices "$TMPDIR/in" > "$TMPDIR/got"
355
no_diff "$TMPDIR/got" "$TMPDIR/expected"
354
parse_lsi_megaraid_devices "$PT_TMPDIR/in" > "$PT_TMPDIR/got"
355
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected"
358
358
# ############################################################################
359
cat <<EOF > "$TMPDIR/expected"
359
cat <<EOF > "$PT_TMPDIR/expected"
361
361
PhysiclDev Type State Errors Vendor Model Size
362
362
========== ==== ======= ====== ======= ============ ===========
490
parse_lsi_megaraid_devices "$TMPDIR/in" > "$TMPDIR/got"
491
no_diff "$TMPDIR/got" "$TMPDIR/expected"
490
parse_lsi_megaraid_devices "$PT_TMPDIR/in" > "$PT_TMPDIR/got"
491
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected"
493
493
# ############################################################################
494
cat <<EOF > "$TMPDIR/expected"
494
cat <<EOF > "$PT_TMPDIR/expected"
496
496
VirtualDev Size RAID Level Disks SpnDpth Stripe Status Cache
497
497
========== ========= ========== ===== ======= ====== ======= =========
623
parse_lsi_megaraid_virtual_devices "$TMPDIR/in" > "$TMPDIR/got"
624
no_diff "$TMPDIR/got" "$TMPDIR/expected"
623
parse_lsi_megaraid_virtual_devices "$PT_TMPDIR/in" > "$PT_TMPDIR/got"
624
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected"
626
626
# ############################################################################
627
cat <<EOF > "$TMPDIR/expected"
627
cat <<EOF > "$PT_TMPDIR/expected"
629
629
VirtualDev Size RAID Level Disks SpnDpth Stripe Status Cache
630
630
========== ========= ========== ===== ======= ====== ======= =========
667
parse_lsi_megaraid_virtual_devices "$TMPDIR/in" > "$TMPDIR/got"
668
no_diff "$TMPDIR/got" "$TMPDIR/expected"
667
parse_lsi_megaraid_virtual_devices "$PT_TMPDIR/in" > "$PT_TMPDIR/got"
668
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected"
671
671
# ############################################################################
672
cat <<EOF > "$TMPDIR/expected"
672
cat <<EOF > "$PT_TMPDIR/expected"
673
673
Model | PERC 6/i Integrated, PCIE interface, 8 ports
674
674
Cache | 256MB Memory, BBU Present
677
parse_lsi_megaraid_adapter_info "$samples/MegaCli64_AdpAllInfo_aALL001.txt" > "$TMPDIR/got"
678
no_diff "$TMPDIR/got" "$TMPDIR/expected"
677
parse_lsi_megaraid_adapter_info "$samples/MegaCli64_AdpAllInfo_aALL001.txt" > "$PT_TMPDIR/got"
678
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected"
680
680
# Launchpad 886223
681
cat <<EOF > "$TMPDIR/expected"
681
cat <<EOF > "$PT_TMPDIR/expected"
683
683
VirtualDev Size RAID Level Disks SpnDpth Stripe Status Cache
684
684
========== ========= ========== ===== ======= ====== ======= =========
685
685
0(no name) 135.5 GB 0 (:-1-0) 2 Depth-2 64 KB Optimal WB, no RA
687
parse_lsi_megaraid_virtual_devices "$PERCONA_TOOLKIT_BRANCH/t/pt-summary/samples/MegaCli64_LdPdInfo_aALL_886223" > "$TMPDIR/got"
688
no_diff "$TMPDIR/got" "$TMPDIR/expected" "Bug 886223"
687
parse_lsi_megaraid_virtual_devices "$PERCONA_TOOLKIT_BRANCH/t/pt-summary/samples/MegaCli64_LdPdInfo_aALL_886223" > "$PT_TMPDIR/got"
688
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "Bug 886223"
692
cat <<EOF > "$TMPDIR/expected"
692
cat <<EOF > "$PT_TMPDIR/expected"
693
693
logicaldrive 1 (136.7 GB, RAID 1, OK)
694
694
physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK)
695
695
physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, OK)
698
cat <<EOF > "$TMPDIR/in"
698
cat <<EOF > "$PT_TMPDIR/in"
700
700
Smart Array P400i in Slot 0 (Embedded) (sn: PH73MU7325 )
708
708
physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, OK)
711
parse_hpacucli "$TMPDIR/in" > "$TMPDIR/got"
712
no_diff "$TMPDIR/got" "$TMPDIR/expected"
711
parse_hpacucli "$PT_TMPDIR/in" > "$PT_TMPDIR/got"
712
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected"
714
parse_hpacucli "$samples/hpaculi-003.txt" > "$TMPDIR/got"
714
parse_hpacucli "$samples/hpaculi-003.txt" > "$PT_TMPDIR/got"
716
"$(cat "$TMPDIR/got")" \
716
"$(cat "$PT_TMPDIR/got")" \
718
718
"parse_hpacucli, hpaculi-003.txt"
720
720
# parse_fusionmpt_lsiutil
722
cat <<EOF > "$TMPDIR/expected"
722
cat <<EOF > "$PT_TMPDIR/expected"
724
724
/proc/mpt/ioc0 LSI Logic SAS1068E B3 MPT 105 Firmware 00192f00 IOC 0
725
725
B___T___L Type Vendor Product Rev SASAddress PhyNum
733
733
0 3 PhysDisk 2 SEAGATE ST3146855SS S52A 5000c500130fcaed 3
734
734
0 10 PhysDisk 3 SEAGATE ST3146855SS S52A 5000c500131093f5 2
736
parse_fusionmpt_lsiutil "$samples/lsiutil-001.txt" > "$TMPDIR/got"
737
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lsiutil-001.txt"
736
parse_fusionmpt_lsiutil "$samples/lsiutil-001.txt" > "$PT_TMPDIR/got"
737
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "lsiutil-001.txt"
739
cat <<EOF > "$TMPDIR/expected"
739
cat <<EOF > "$PT_TMPDIR/expected"
741
741
/proc/mpt/ioc0 LSI Logic SAS1064E B3 MPT 105 Firmware 011e0000 IOC 0
742
742
B___T___L Type Vendor Product Rev SASAddress PhyNum
746
746
0 2 PhysDisk 0 IBM-ESXS ST9300603SS F B536 5000c5001d784329 1
747
747
0 3 PhysDisk 1 IBM-ESXS MBD2300RC SB17 500000e113c17152 0
749
parse_fusionmpt_lsiutil "$samples/lsiutil-002.txt" > "$TMPDIR/got"
750
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lsiutil-002.txt"
749
parse_fusionmpt_lsiutil "$samples/lsiutil-002.txt" > "$PT_TMPDIR/got"
750
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "lsiutil-002.txt"
752
cat <<EOF > "$TMPDIR/expected"
752
cat <<EOF > "$PT_TMPDIR/expected"
754
754
/proc/mpt/ioc0 LSI Logic SAS1064E B3 MPT 105 Firmware 011e0000 IOC 0
755
755
B___T___L Type Vendor Product Rev SASAddress PhyNum
759
759
0 2 PhysDisk 0 IBM-ESXS MBD2300RC SB17 500000e113c00ed2 1
760
760
0 3 PhysDisk 1 IBM-ESXS MBD2300RC SB17 500000e113c17ee2 0
762
parse_fusionmpt_lsiutil "$samples/lsiutil-003.txt" > "$TMPDIR/got"
763
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lsiutil-003.txt"
762
parse_fusionmpt_lsiutil "$samples/lsiutil-003.txt" > "$PT_TMPDIR/got"
763
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "lsiutil-003.txt"
765
765
# parse_free_minus_b
767
cat <<EOF > "$TMPDIR/expected"
767
cat <<EOF > "$PT_TMPDIR/expected"
770
770
Used | physical = 2.5G, swap allocated = 4.9G, swap used = 0.0, virtual = 2.5G
824
824
DirectMap4k: 10232 kB
825
825
DirectMap2M: 897024 kB
827
parse_free_minus_b "$TMPDIR/in" > "$TMPDIR/got"
828
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_free_minus_b"
827
parse_free_minus_b "$PT_TMPDIR/in" > "$PT_TMPDIR/got"
828
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "parse_free_minus_b"
830
830
# Bug 993436: Memory: Total reports M when it should say G
831
cat <<EOF > "$TMPDIR/expected"
831
cat <<EOF > "$PT_TMPDIR/expected"
834
834
Used | physical = 226.1M, swap allocated = 2.0G, swap used = 0.0, virtual = 226.1M
839
parse_free_minus_b "$T_DIR/pt-summary/samples/Linux/002/memory" > "$TMPDIR/got"
840
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_free_minus_b (bug 993436)"
839
parse_free_minus_b "$T_DIR/pt-summary/samples/Linux/002/memory" > "$PT_TMPDIR/got"
840
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "parse_free_minus_b (bug 993436)"
842
842
# parse_filesystems
844
cat <<EOF > $TMPDIR/expected
844
cat <<EOF > $PT_TMPDIR/expected
845
845
Filesystem Size Used Type Opts Mountpoint
846
846
/dev/sda1 99M 13% ext3 rw /boot
847
847
/dev/sda2 540G 89% ext3 rw /
848
848
tmpfs 48G 0% tmpfs rw /dev/shm
850
parse_filesystems "$samples/df-mount-003.txt" "Linux" > "$TMPDIR/got"
851
no_diff "$TMPDIR/got" "$TMPDIR/expected" "df-mount-003.txt Linux"
850
parse_filesystems "$samples/df-mount-003.txt" "Linux" > "$PT_TMPDIR/got"
851
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "df-mount-003.txt Linux"
853
cat <<EOF > $TMPDIR/expected
853
cat <<EOF > $PT_TMPDIR/expected
854
854
Filesystem Size Used Type Opts Mountpoint
855
855
/dev/sda1 9.9G 34% ext3 rw /
856
856
/dev/sdb 414G 1% ext3 rw /mnt
860
860
none 7.6G 0% proc rw /dev/shm
861
861
none 7.6G 0% sysfs rw /dev/shm
863
parse_filesystems "$samples/df-mount-004.txt" "Linux" > "$TMPDIR/got"
864
no_diff "$TMPDIR/got" "$TMPDIR/expected" "df-mount-004.txt Linux"
863
parse_filesystems "$samples/df-mount-004.txt" "Linux" > "$PT_TMPDIR/got"
864
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "df-mount-004.txt Linux"
866
cat <<EOF > $TMPDIR/expected
866
cat <<EOF > $PT_TMPDIR/expected
867
867
Filesystem Size Used Type Opts Mountpoint
868
868
/dev/cciss/c0d0p1 99M 24% ext3 rw /boot
869
869
/dev/mapper/VolGroup00-LogVol00 194G 58% ext3 rw /
871
871
/dev/mapper/VolGroup01-mysql_data 1008G 44% ext3 rw,noatime /data/mysql-data
872
872
tmpfs 48G 0% tmpfs rw /dev/shm
874
parse_filesystems "$samples/df-mount-005.txt" "Linux" > "$TMPDIR/got"
875
no_diff "$TMPDIR/got" "$TMPDIR/expected" "df-mount-005.txt Linux"
874
parse_filesystems "$samples/df-mount-005.txt" "Linux" > "$PT_TMPDIR/got"
875
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "df-mount-005.txt Linux"
877
cat <<EOF > $TMPDIR/expected
877
cat <<EOF > $PT_TMPDIR/expected
878
878
Filesystem Size Used Type Opts Mountpoint
879
879
/dev/ad0s1a 496M 32% ufs local /
880
880
/dev/ad0s1d 1.1G 1% ufs local, soft-updates /var
882
882
/dev/ad0s1f 17G 9% ufs local, soft-updates /usr
883
883
devfs 1.0K 100% devfs local /dev
885
parse_filesystems "$samples/df-mount-006.txt" "FreeBSD" > "$TMPDIR/got"
886
no_diff "$TMPDIR/got" "$TMPDIR/expected" "df-mount-006.txt FreeBSD"
885
parse_filesystems "$samples/df-mount-006.txt" "FreeBSD" > "$PT_TMPDIR/got"
886
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "df-mount-006.txt FreeBSD"
888
888
# parse_ip_s_link
890
cat <<EOF > "$TMPDIR/expected"
890
cat <<EOF > "$PT_TMPDIR/expected"
891
891
interface rx_bytes rx_packets rx_errors tx_bytes tx_packets tx_errors
892
892
========= ========= ========== ========== ========== ========== ==========
893
893
lo 3000000 25000 0 3000000 25000 0
895
895
wlan0 50000000 80000 0 20000000 90000 0
896
896
vboxnet0 0 0 0 0 0 0
898
parse_ip_s_link "$samples/ip-s-link-001.txt" > $TMPDIR/got
899
no_diff "$TMPDIR/got" "$TMPDIR/expected" "ip-s-link-001.txt"
898
parse_ip_s_link "$samples/ip-s-link-001.txt" > $PT_TMPDIR/got
899
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "ip-s-link-001.txt"
901
cat <<EOF > "$TMPDIR/expected"
901
cat <<EOF > "$PT_TMPDIR/expected"
902
902
interface rx_bytes rx_packets rx_errors tx_bytes tx_packets tx_errors
903
903
========= ========= ========== ========== ========== ========== ==========
904
904
lo 3500000000 350000000 0 3500000000 350000000 0
906
906
eth1 1250000000 60000000 0 900000000 50000000 0
909
parse_ip_s_link "$samples/ip-s-link-002.txt" > "$TMPDIR/got"
910
no_diff "$TMPDIR/got" "$TMPDIR/expected" "ip-s-link-002.txt"
909
parse_ip_s_link "$samples/ip-s-link-002.txt" > "$PT_TMPDIR/got"
910
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "ip-s-link-002.txt"
912
cat <<EOF > "$TMPDIR/expected"
912
cat <<EOF > "$PT_TMPDIR/expected"
913
913
interface rx_bytes rx_packets rx_errors tx_bytes tx_packets tx_errors
914
914
========= ========= ========== ========== ========== ========== ==========
915
915
lo 25000000 300000 0 25000000 300000 0
917
917
wlan0 0 0 0 0 0 0
918
918
virbr0 0 0 0 0 0 0
920
parse_ip_s_link "$samples/ip-s-link-003.txt" > "$TMPDIR/got"
921
no_diff "$TMPDIR/got" "$TMPDIR/expected" "ip-s-link-003.txt"
920
parse_ip_s_link "$samples/ip-s-link-003.txt" > "$PT_TMPDIR/got"
921
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "ip-s-link-003.txt"
925
cat <<EOF > "$TMPDIR/expected"
925
cat <<EOF > "$PT_TMPDIR/expected"
926
926
Device Type Start End Size
927
927
============ ==== ========== ========== ==================
928
928
/dev/dm-0 Disk 494609104896
931
931
/dev/sda1 Part 1 26 205632000
932
932
/dev/sda2 Part 26 60801 499891392000
934
parse_fdisk "$samples/fdisk-01.txt" > "$TMPDIR/got"
935
no_diff "$TMPDIR/got" "$TMPDIR/expected" "parse_fdisk"
934
parse_fdisk "$samples/fdisk-01.txt" > "$PT_TMPDIR/got"
935
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "parse_fdisk"
937
937
# parse_ethernet_controller_lspci
939
cat <<EOF > $TMPDIR/expected
939
cat <<EOF > $PT_TMPDIR/expected
940
940
Controller | Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12)
941
941
Controller | Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12)
943
parse_ethernet_controller_lspci "$samples/lspci-001.txt" > "$TMPDIR/got"
944
no_diff "$TMPDIR/got" "$TMPDIR/expected"
943
parse_ethernet_controller_lspci "$samples/lspci-001.txt" > "$PT_TMPDIR/got"
944
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected"
946
946
# parse_dmidecode_mem_devices
948
cat <<EOF > $TMPDIR/expected
948
cat <<EOF > $PT_TMPDIR/expected
949
949
Locator Size Speed Form Factor Type Type Detail
950
950
========= ======== ================= ============= ============= ===========
951
951
SODIMM0 2048 MB 800 MHz SODIMM Other Synchronous
952
952
SODIMM1 2048 MB 800 MHz SODIMM Other Synchronous
954
parse_dmidecode_mem_devices "$samples/dmidecode-001.txt" > $TMPDIR/got
955
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmidecode-001.tx"
954
parse_dmidecode_mem_devices "$samples/dmidecode-001.txt" > $PT_TMPDIR/got
955
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmidecode-001.tx"
957
cat <<EOF > "$TMPDIR/expected"
957
cat <<EOF > "$PT_TMPDIR/expected"
958
958
Locator Size Speed Form Factor Type Type Detail
959
959
========= ======== ================= ============= ============= ===========
960
960
DIMM1 2048 MB 667 MHz (1.5 ns) {OUT OF SPEC} {OUT OF SPEC} Synchronous
966
966
DIMM7 2048 MB 667 MHz (1.5 ns) {OUT OF SPEC} {OUT OF SPEC} Synchronous
967
967
DIMM8 2048 MB 667 MHz (1.5 ns) {OUT OF SPEC} {OUT OF SPEC} Synchronous
969
parse_dmidecode_mem_devices "$samples/dmidecode-002.txt" > "$TMPDIR/got"
970
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmidecode-002.tx"
969
parse_dmidecode_mem_devices "$samples/dmidecode-002.txt" > "$PT_TMPDIR/got"
970
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmidecode-002.tx"
972
cat <<EOF > "$TMPDIR/expected"
972
cat <<EOF > "$PT_TMPDIR/expected"
973
973
Locator Size Speed Form Factor Type Type Detail
974
974
========= ======== ================= ============= ============= ===========
975
975
1024 kB 33 MHz Other Flash Non-Volatile
992
992
D7 {EMPTY} 1333 MHz DIMM Other Other
993
993
D8 {EMPTY} 1333 MHz DIMM Other Other
995
parse_dmidecode_mem_devices "$samples/dmidecode-003.txt" > "$TMPDIR/got"
996
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmidecode-003.txt"
995
parse_dmidecode_mem_devices "$samples/dmidecode-003.txt" > "$PT_TMPDIR/got"
996
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmidecode-003.txt"
998
cat <<EOF > "$TMPDIR/expected"
998
cat <<EOF > "$PT_TMPDIR/expected"
999
999
Locator Size Speed Form Factor Type Type Detail
1000
1000
========= ======== ================= ============= ============= ===========
1001
1001
DIMM_A2 4096 MB 1066 MHz (0.9 ns) DIMM {OUT OF SPEC} Synchronous
1011
1011
DIMM_B1 {EMPTY} Unknown DIMM {OUT OF SPEC} Synchronous
1012
1012
DIMM_B4 {EMPTY} Unknown DIMM {OUT OF SPEC} Synchronous
1014
parse_dmidecode_mem_devices "$samples/dmidecode-004.txt" > "$TMPDIR/got"
1015
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmidecode-004.txt"
1014
parse_dmidecode_mem_devices "$samples/dmidecode-004.txt" > "$PT_TMPDIR/got"
1015
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmidecode-004.txt"
1017
cat <<EOF > "$TMPDIR/expected"
1017
cat <<EOF > "$PT_TMPDIR/expected"
1018
1018
Locator Size Speed Form Factor Type Type Detail
1019
1019
========= ======== ================= ============= ============= ===========
1020
1020
P1-DIMM1A 16384 MB 1066 MHz (0.9 ns) DIMM {OUT OF SPEC} Other
1037
1037
P2-DIMM3B {EMPTY} Unknown DIMM {OUT OF SPEC} Other
1038
1038
P2-DIMM3C {EMPTY} Unknown DIMM {OUT OF SPEC} Other
1040
parse_dmidecode_mem_devices "$samples/dmidecode-005.txt" > "$TMPDIR/got"
1041
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmidecode-005.txt"
1040
parse_dmidecode_mem_devices "$samples/dmidecode-005.txt" > "$PT_TMPDIR/got"
1041
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmidecode-005.txt"
1043
1043
# parse_arcconf
1045
cat <<EOF > "$TMPDIR/expected"
1045
cat <<EOF > "$PT_TMPDIR/expected"
1046
1046
Specs | Adaptec 3405, SAS/SATA, 128 MB cache, Optimal
1047
1047
Battery | 99%, 3d1h11m remaining, Optimal
1193
1193
Command completed successfully.
1196
parse_arcconf "$TMPDIR/in" > "$TMPDIR/got"
1197
no_diff "$TMPDIR/got" "$TMPDIR/expected"
1196
parse_arcconf "$PT_TMPDIR/in" > "$PT_TMPDIR/got"
1197
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected"
1199
cat <<EOF > "$TMPDIR/expected"
1199
cat <<EOF > "$PT_TMPDIR/expected"
1200
1200
Specs | Adaptec 3405, SAS/SATA, 128 MB cache, Optimal
1201
1201
Battery | 99%, 3d1h11m remaining, Optimal
1211
1211
Hard drive Online SAS 3.0 Gb/s SEAGATE ST3300655SS 286102 MB On (WB)
1212
1212
Hard drive Online SAS 3.0 Gb/s SEAGATE ST3300655SS 286102 MB On (WB)
1214
parse_arcconf "$samples/arcconf-002.txt" > "$TMPDIR/got"
1215
no_diff "$TMPDIR/got" "$TMPDIR/expected" "arcconf-002.txt"
1214
parse_arcconf "$samples/arcconf-002.txt" > "$PT_TMPDIR/got"
1215
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "arcconf-002.txt"
1217
1217
# Launchpad 917781, parse_arcconf doesn't work with ZMM
1218
1218
# https://bugs.launchpad.net/percona-toolkit/+bug/917781
1219
cat <<EOF > "$TMPDIR/expected"
1219
cat <<EOF > "$PT_TMPDIR/expected"
1220
1220
Specs | Adaptec 5405Z, SAS/SATA, 512 MB cache, Optimal
1221
1221
Battery | ZMM Optimal
1232
1232
Hard drive Full rpm,Powered off SATA 3.0 Gb/s WDC WD3000HLFS-0 286168 MB On (WB)
1235
parse_arcconf "$samples/arcconf-004_917781.txt" > "$TMPDIR/got"
1236
no_diff "$TMPDIR/got" "$TMPDIR/expected" "Bug 917781"
1235
parse_arcconf "$samples/arcconf-004_917781.txt" > "$PT_TMPDIR/got"
1236
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "Bug 917781"
1238
1238
# Launchpad 900285, ${var/ /} doesn't work in sh
1239
1239
# https://bugs.launchpad.net/percona-toolkit/+bug/900285
1240
cat <<EOF > "$TMPDIR/expected"
1240
cat <<EOF > "$PT_TMPDIR/expected"
1241
1241
Specs | Adaptec 5805Z, SAS/SATA, 512 MB cache, Optimal
1242
1242
Battery | ZMM Optimal
1255
1255
Hard drive Full rpm,Powered off SAS 3.0 Gb/s SEAGATE ST3300657SS 286102 MB On (WB)
1256
1256
Hard drive Full rpm,Powered off SAS 3.0 Gb/s SEAGATE ST3300657SS 286102 MB On (WB)
1258
parse_arcconf "$samples/arcconf-003_900285.txt" > "$TMPDIR/got"
1259
no_diff "$TMPDIR/got" "$TMPDIR/expected" "Bug 900285"
1258
parse_arcconf "$samples/arcconf-003_900285.txt" > "$PT_TMPDIR/got"
1259
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "Bug 900285"
1263
cat <<EOF > "$TMPDIR/in"
1263
cat <<EOF > "$PT_TMPDIR/in"
1264
1264
15:10:14 up 1 day, 15:08, 11 users, load average: 0.18, 0.09, 0.08
1267
"$( parse_uptime "$TMPDIR/in" )" \
1267
"$( parse_uptime "$PT_TMPDIR/in" )" \
1268
1268
"1 day, 15:08, 11 users, load average: 0.18, 0.09, 0.08" \
1269
1269
"parse_uptime works with Ubuntu's uptime"
1271
cat <<EOF > "$TMPDIR/in"
1271
cat <<EOF > "$PT_TMPDIR/in"
1272
1272
some weird format etc 1 day, 15:08, 11 users, load average: 0.18, 0.09, 0.08
1275
"$( parse_uptime "$TMPDIR/in" )" \
1275
"$( parse_uptime "$PT_TMPDIR/in" )" \
1276
1276
" some weird format etc 1 day, 15:08, 11 users, load average: 0.18, 0.09, 0.08" \
1277
1277
"parse_uptime returns uptime as-if if it doesn't contain an 'up'"
1284
1284
"format_lvs has a meaningful error message if all goes wrong"
1287
echo "Pretending to be an lvs dump" > "$TMPDIR/in"
1287
echo "Pretending to be an lvs dump" > "$PT_TMPDIR/in"
1289
"$(format_lvs "$TMPDIR/in" "")" \
1289
"$(format_lvs "$PT_TMPDIR/in" "")" \
1290
1290
"Pretending to be an lvs dump" \
1291
1291
"format_lvs dumps the file passed in"
1293
1293
# report_system_summary
1294
1294
parse_options "$BIN_DIR/pt-summary"
1296
cat <<EOF > "$TMPDIR/expected"
1296
cat <<EOF > "$PT_TMPDIR/expected"
1298
1298
Uptime | 57 mins, 1 user, load averages: 0.16, 0.03, 0.07
1299
1299
Platform | FreeBSD
1345
1345
0 0 0 58164 339792 0 0 0 0 0 0 0 0 231 115 229 0 5 95
1346
1346
# The End ####################################################
1348
report_system_summary "$samples/BSD/freebsd_001" | tail -n +3 > "$TMPDIR/got"
1349
no_diff "$TMPDIR/got" "$TMPDIR/expected" "report_system_summary works with samples from a FreeBSD box"
1348
report_system_summary "$samples/BSD/freebsd_001" | tail -n +3 > "$PT_TMPDIR/got"
1349
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "report_system_summary works with samples from a FreeBSD box"
1351
cat <<EOF > "$TMPDIR/expected"
1351
cat <<EOF > "$PT_TMPDIR/expected"
1353
1353
Uptime | 43 mins, 2 users, load averages: 0.00, 0.00, 0.00
1354
1354
Platform | NetBSD
1399
1399
0 0 0 78564 21364 0 0 0 0 0 0 0 0 101 11 10 0 0 100
1400
1400
# The End ####################################################
1402
report_system_summary "$samples/BSD/netbsd_001" | tail -n +3 > "$TMPDIR/got"
1403
no_diff "$TMPDIR/got" "$TMPDIR/expected" "netbsd_001"
1402
report_system_summary "$samples/BSD/netbsd_001" | tail -n +3 > "$PT_TMPDIR/got"
1403
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "netbsd_001"
1405
cat <<EOF > "$TMPDIR/expected"
1405
cat <<EOF > "$PT_TMPDIR/expected"
1406
1406
Hostname | openbsd.my.domain
1407
1407
Uptime | 1:14, 1 user, load averages: 0.44, 0.20, 0.16
1408
1408
Platform | OpenBSD
1451
1451
0 0 0 7496 191456 11 0 0 0 0 0 0 0 230 23 12 0 0 100
1452
1452
# The End ####################################################
1454
report_system_summary "$samples/BSD/openbsd_001" | tail -n +3 > "$TMPDIR/got"
1455
no_diff "$TMPDIR/got" "$TMPDIR/expected" "openbsd_001"
1454
report_system_summary "$samples/BSD/openbsd_001" | tail -n +3 > "$PT_TMPDIR/got"
1455
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "openbsd_001"
1457
cat <<EOF > "$TMPDIR/expected"
1457
cat <<EOF > "$PT_TMPDIR/expected"
1458
1458
Hostname | hugmeir
1459
1459
Uptime | 1 day, 15:14, 5 users, load average: 0.00, 0.06, 0.07
1460
1460
System | Quanta; UW3; vTBD (Other)
1570
1570
# The End ####################################################
1573
report_system_summary "$samples/Linux/001" | tail -n +3 > "$TMPDIR/got"
1574
no_diff "$TMPDIR/got" "$TMPDIR/expected" "Linux/001 (Ubuntu)"
1576
report_system_summary "$samples/Linux/002" | tail -n +3 > "$TMPDIR/got"
1577
no_diff "$TMPDIR/got" "$samples/Linux/output_002.txt" "Linux/002 (CentOS 5.7, as root)"
1579
report_system_summary "$samples/Linux/003" | tail -n +3 > "$TMPDIR/got"
1580
no_diff "$TMPDIR/got" "$samples/Linux/output_003.txt" "Linux/003 (CentOS 5.7, as non-root)"
1573
report_system_summary "$samples/Linux/001" | tail -n +3 > "$PT_TMPDIR/got"
1574
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "Linux/001 (Ubuntu)"
1576
report_system_summary "$samples/Linux/002" | tail -n +3 > "$PT_TMPDIR/got"
1577
no_diff "$PT_TMPDIR/got" "$samples/Linux/output_002.txt" "Linux/002 (CentOS 5.7, as root)"
1579
report_system_summary "$samples/Linux/003" | tail -n +3 > "$PT_TMPDIR/got"
1580
no_diff "$PT_TMPDIR/got" "$samples/Linux/output_003.txt" "Linux/003 (CentOS 5.7, as non-root)"