From 4d462bbbddfca1038e1861360f7cc1985827a923 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Thu, 2 Feb 2012 10:03:48 -0700 Subject: [PATCH] Fix Bash tests. --- t/pt-diskstats/group_by_all.sh | 1 + t/pt-diskstats/group_by_disk.sh | 1 + t/pt-diskstats/group_by_sample.sh | 1 + t/pt-mysql-summary/find_my_cnf_file.sh | 1 + t/pt-mysql-summary/format_binlog_filters.sh | 1 + t/pt-mysql-summary/format_innodb_status.sh | 1 + t/pt-mysql-summary/format_overall_db_stats.sh | 1 + t/pt-mysql-summary/format_status_variables.sh | 1 + t/pt-mysql-summary/fuzz.sh | 1 + t/pt-mysql-summary/get_mysql_info.sh | 1 + t/pt-mysql-summary/parse_mysqld_instances.sh | 1 + t/pt-mysql-summary/pretty_print_cnf_file.sh | 1 + t/pt-mysql-summary/summarize_binlogs.sh | 1 + t/pt-mysql-summary/summarize_processlist.sh | 1 + t/pt-pmp/aggregate_stacktrace.sh | 1 + t/pt-summary/format_vmstat.sh | 3 +++ t/pt-summary/parse_arcconf.sh | 1 + t/pt-summary/parse_dmidecode_mem_devices.sh | 1 + t/pt-summary/parse_ethernet_controller_lspci.sh | 3 +++ t/pt-summary/parse_fdisk.sh | 3 +++ t/pt-summary/parse_filesystems.sh | 1 + t/pt-summary/parse_free_minus_b.sh | 1 + t/pt-summary/parse_fusionmpt_lsiutil.sh | 1 + t/pt-summary/parse_hpacucli.sh | 3 +++ t/pt-summary/parse_ip_s_link.sh | 1 + t/pt-summary/parse_lsi_megaraid.sh | 1 + t/pt-summary/parse_netstat.sh | 1 + t/pt-summary/parse_proc_cpuinfo.sh | 3 +++ t/pt-summary/parse_raid_controller_dmesg.sh | 1 + t/pt-summary/parse_raid_controller_lspci.sh | 1 + t/pt-summary/parse_virtualization_dmesg.sh | 3 +++ 31 files changed, 43 insertions(+) diff --git a/t/pt-diskstats/group_by_all.sh b/t/pt-diskstats/group_by_all.sh index 56bae254..a0e591e2 100644 --- a/t/pt-diskstats/group_by_all.sh +++ b/t/pt-diskstats/group_by_all.sh @@ -3,6 +3,7 @@ # This test file must be ran by util/test-bash-functions. TESTS=1 +TMPDIR=$TEST_TMPDIR cat < $TMPDIR/expected #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg diff --git a/t/pt-diskstats/group_by_disk.sh b/t/pt-diskstats/group_by_disk.sh index bb201fa2..863fa29a 100644 --- a/t/pt-diskstats/group_by_disk.sh +++ b/t/pt-diskstats/group_by_disk.sh @@ -3,6 +3,7 @@ # This test file must be ran by util/test-bash-functions. TESTS=5 +TMPDIR=$TEST_TMPDIR TEST_NAME="diskstats-001.txt" cat < $TMPDIR/expected diff --git a/t/pt-diskstats/group_by_sample.sh b/t/pt-diskstats/group_by_sample.sh index 326079ce..63356596 100644 --- a/t/pt-diskstats/group_by_sample.sh +++ b/t/pt-diskstats/group_by_sample.sh @@ -3,6 +3,7 @@ # This test file must be ran by util/test-bash-functions. TESTS=4 +TMPDIR=$TEST_TMPDIR TEST_NAME="diskstats-001.txt" cat < $TMPDIR/expected diff --git a/t/pt-mysql-summary/find_my_cnf_file.sh b/t/pt-mysql-summary/find_my_cnf_file.sh index 4b922be3..37712fcb 100644 --- a/t/pt-mysql-summary/find_my_cnf_file.sh +++ b/t/pt-mysql-summary/find_my_cnf_file.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash TESTS=4 +TMPDIR=$TEST_TMPDIR TEST_NAME="ps-mysqld-001.txt" res=$(find_my_cnf_file samples/ps-mysqld-001.txt) diff --git a/t/pt-mysql-summary/format_binlog_filters.sh b/t/pt-mysql-summary/format_binlog_filters.sh index b1891e28..5cfa893c 100644 --- a/t/pt-mysql-summary/format_binlog_filters.sh +++ b/t/pt-mysql-summary/format_binlog_filters.sh @@ -1,6 +1,7 @@ #!/bin/bash TEST=1 +TMPDIR=$TEST_TMPDIR cat < $TMPDIR/expected binlog_do_db | foo diff --git a/t/pt-mysql-summary/format_innodb_status.sh b/t/pt-mysql-summary/format_innodb_status.sh index 6d34909f..24cee4d5 100644 --- a/t/pt-mysql-summary/format_innodb_status.sh +++ b/t/pt-mysql-summary/format_innodb_status.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash TESTS=4 +TMPDIR=$TEST_TMPDIR # ############################################################################ TEST_NAME="innodb-status.001.txt" diff --git a/t/pt-mysql-summary/format_overall_db_stats.sh b/t/pt-mysql-summary/format_overall_db_stats.sh index abee9223..93ea9c40 100644 --- a/t/pt-mysql-summary/format_overall_db_stats.sh +++ b/t/pt-mysql-summary/format_overall_db_stats.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=2 +TMPDIR=$TEST_TMPDIR cat < $TMPDIR/expected diff --git a/t/pt-mysql-summary/format_status_variables.sh b/t/pt-mysql-summary/format_status_variables.sh index 8ddf95bb..5bee86e5 100644 --- a/t/pt-mysql-summary/format_status_variables.sh +++ b/t/pt-mysql-summary/format_status_variables.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=1 +TMPDIR=$TEST_TMPDIR cat < $TMPDIR/expected Variable Per day Per second 5 secs diff --git a/t/pt-mysql-summary/fuzz.sh b/t/pt-mysql-summary/fuzz.sh index 54f9bd43..6c1d2871 100644 --- a/t/pt-mysql-summary/fuzz.sh +++ b/t/pt-mysql-summary/fuzz.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=1 +TMPDIR=$TEST_TMPDIR TEST_NAME="fuzz 49" is $(fuzz 49) "50" diff --git a/t/pt-mysql-summary/get_mysql_info.sh b/t/pt-mysql-summary/get_mysql_info.sh index 78a181c9..26ae00d6 100644 --- a/t/pt-mysql-summary/get_mysql_info.sh +++ b/t/pt-mysql-summary/get_mysql_info.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=3 +TMPDIR=$TEST_TMPDIR TEST_NAME="get_mysql_timezone" cp samples/mysql-variables-001.txt $TMPDIR/percona-toolkit-mysql-variables diff --git a/t/pt-mysql-summary/parse_mysqld_instances.sh b/t/pt-mysql-summary/parse_mysqld_instances.sh index 4e6fbd2f..62b07047 100644 --- a/t/pt-mysql-summary/parse_mysqld_instances.sh +++ b/t/pt-mysql-summary/parse_mysqld_instances.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=4 +TMPDIR=$TEST_TMPDIR TEST_NAME="ps-mysqld-001.txt" cat < $TMPDIR/expected diff --git a/t/pt-mysql-summary/pretty_print_cnf_file.sh b/t/pt-mysql-summary/pretty_print_cnf_file.sh index 5a4bec30..d08fdc2d 100644 --- a/t/pt-mysql-summary/pretty_print_cnf_file.sh +++ b/t/pt-mysql-summary/pretty_print_cnf_file.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=1 +TMPDIR=$TEST_TMPDIR cat < $TMPDIR/expected diff --git a/t/pt-mysql-summary/summarize_binlogs.sh b/t/pt-mysql-summary/summarize_binlogs.sh index e1a48b66..e0f6baee 100644 --- a/t/pt-mysql-summary/summarize_binlogs.sh +++ b/t/pt-mysql-summary/summarize_binlogs.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=1 +TMPDIR=$TEST_TMPDIR cat < $TMPDIR/expected Binlogs | 20 diff --git a/t/pt-mysql-summary/summarize_processlist.sh b/t/pt-mysql-summary/summarize_processlist.sh index abcb8de3..c67798c9 100644 --- a/t/pt-mysql-summary/summarize_processlist.sh +++ b/t/pt-mysql-summary/summarize_processlist.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=1 +TMPDIR=$TEST_TMPDIR cat < $TMPDIR/expected diff --git a/t/pt-pmp/aggregate_stacktrace.sh b/t/pt-pmp/aggregate_stacktrace.sh index b6f40205..80e68bff 100644 --- a/t/pt-pmp/aggregate_stacktrace.sh +++ b/t/pt-pmp/aggregate_stacktrace.sh @@ -3,6 +3,7 @@ # This test file must be ran by util/test-bash-functions. TESTS=6 +TMPDIR=$TEST_TMPDIR # ############################################################################ TEST_NAME="stacktrace-001.txt" diff --git a/t/pt-summary/format_vmstat.sh b/t/pt-summary/format_vmstat.sh index 5b1dd055..7f2f553b 100644 --- a/t/pt-summary/format_vmstat.sh +++ b/t/pt-summary/format_vmstat.sh @@ -1,5 +1,8 @@ #!/bin/bash +TESTS=1 +TMPDIR=$TEST_TMPDIR + cat < $TMPDIR/in procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st diff --git a/t/pt-summary/parse_arcconf.sh b/t/pt-summary/parse_arcconf.sh index 9a775b8f..f7ab3cb0 100644 --- a/t/pt-summary/parse_arcconf.sh +++ b/t/pt-summary/parse_arcconf.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=2 +TMPDIR=$TEST_TMPDIR cat < $TMPDIR/expected Specs | Adaptec 3405, SAS/SATA, 128 MB cache, Optimal diff --git a/t/pt-summary/parse_dmidecode_mem_devices.sh b/t/pt-summary/parse_dmidecode_mem_devices.sh index 95cd2861..c424a10a 100644 --- a/t/pt-summary/parse_dmidecode_mem_devices.sh +++ b/t/pt-summary/parse_dmidecode_mem_devices.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=5 +TMPDIR=$TEST_TMPDIR TEST_NAME="dmidecode-001.txt" cat < $TMPDIR/expected diff --git a/t/pt-summary/parse_ethernet_controller_lspci.sh b/t/pt-summary/parse_ethernet_controller_lspci.sh index 26b08c9c..123c854d 100644 --- a/t/pt-summary/parse_ethernet_controller_lspci.sh +++ b/t/pt-summary/parse_ethernet_controller_lspci.sh @@ -1,5 +1,8 @@ #!/bin/bash +TESTS=1 +TMPDIR=$TEST_TMPDIR + cat < $TMPDIR/expected Controller | Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12) Controller | Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12) diff --git a/t/pt-summary/parse_fdisk.sh b/t/pt-summary/parse_fdisk.sh index cd2e7ad3..5797965a 100644 --- a/t/pt-summary/parse_fdisk.sh +++ b/t/pt-summary/parse_fdisk.sh @@ -1,5 +1,8 @@ #!/bin/bash +TESTS=1 +TMPDIR=$TEST_TMPDIR + cat < $TMPDIR/expected Device Type Start End Size ============ ==== ========== ========== ================== diff --git a/t/pt-summary/parse_filesystems.sh b/t/pt-summary/parse_filesystems.sh index a0145506..7f105d6a 100644 --- a/t/pt-summary/parse_filesystems.sh +++ b/t/pt-summary/parse_filesystems.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=4 +TMPDIR=$TEST_TMPDIR TEST_NAME="df-mount-003.txt Linux" cat < $TMPDIR/expected diff --git a/t/pt-summary/parse_free_minus_b.sh b/t/pt-summary/parse_free_minus_b.sh index af702385..18b02912 100644 --- a/t/pt-summary/parse_free_minus_b.sh +++ b/t/pt-summary/parse_free_minus_b.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=1 +TMPDIR=$TEST_TMPDIR cat < $TMPDIR/expected Total | 3.89G diff --git a/t/pt-summary/parse_fusionmpt_lsiutil.sh b/t/pt-summary/parse_fusionmpt_lsiutil.sh index 71201129..3900cc35 100644 --- a/t/pt-summary/parse_fusionmpt_lsiutil.sh +++ b/t/pt-summary/parse_fusionmpt_lsiutil.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=3 +TMPDIR=$TEST_TMPDIR TEST_NAME="lsiutil-001.txt" cat < $TMPDIR/expected diff --git a/t/pt-summary/parse_hpacucli.sh b/t/pt-summary/parse_hpacucli.sh index 99ceb251..ee4dd078 100644 --- a/t/pt-summary/parse_hpacucli.sh +++ b/t/pt-summary/parse_hpacucli.sh @@ -1,5 +1,8 @@ #!/bin/bash +TESTS=1 +TMPDIR=$TEST_TMPDIR + cat < $TMPDIR/expected logicaldrive 1 (136.7 GB, RAID 1, OK) physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK) diff --git a/t/pt-summary/parse_ip_s_link.sh b/t/pt-summary/parse_ip_s_link.sh index a4154aa5..68b7ad45 100644 --- a/t/pt-summary/parse_ip_s_link.sh +++ b/t/pt-summary/parse_ip_s_link.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=2 +TMPDIR=$TEST_TMPDIR TEST_NAME="ip-s-link-001.txt" cat < $TMPDIR/expected diff --git a/t/pt-summary/parse_lsi_megaraid.sh b/t/pt-summary/parse_lsi_megaraid.sh index f566dde6..14bb299a 100644 --- a/t/pt-summary/parse_lsi_megaraid.sh +++ b/t/pt-summary/parse_lsi_megaraid.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=6 +TMPDIR=$TEST_TMPDIR # ############################################################################ cat < $TMPDIR/expected diff --git a/t/pt-summary/parse_netstat.sh b/t/pt-summary/parse_netstat.sh index cdeeadff..5086d23e 100644 --- a/t/pt-summary/parse_netstat.sh +++ b/t/pt-summary/parse_netstat.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=2 +TMPDIR=$TEST_TMPDIR TEST_NAME="netstat-001.txt" cat < $TMPDIR/expected diff --git a/t/pt-summary/parse_proc_cpuinfo.sh b/t/pt-summary/parse_proc_cpuinfo.sh index 06198aab..cdc800f7 100644 --- a/t/pt-summary/parse_proc_cpuinfo.sh +++ b/t/pt-summary/parse_proc_cpuinfo.sh @@ -1,5 +1,8 @@ #!/bin/bash +TESTS=1 +TMPDIR=$TEST_TMPDIR + cat < $TMPDIR/expected Processors | physical = 1, cores = 2, virtual = 2, hyperthreading = no Speeds | 2x1300.000 diff --git a/t/pt-summary/parse_raid_controller_dmesg.sh b/t/pt-summary/parse_raid_controller_dmesg.sh index 9e59c5f9..7bc90a69 100644 --- a/t/pt-summary/parse_raid_controller_dmesg.sh +++ b/t/pt-summary/parse_raid_controller_dmesg.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=4 +TMPDIR=$TEST_TMPDIR TEST_NAME="dmesg-001.txt" cat < $TMPDIR/expected diff --git a/t/pt-summary/parse_raid_controller_lspci.sh b/t/pt-summary/parse_raid_controller_lspci.sh index 6233edd1..d9b9cf08 100644 --- a/t/pt-summary/parse_raid_controller_lspci.sh +++ b/t/pt-summary/parse_raid_controller_lspci.sh @@ -1,6 +1,7 @@ #!/bin/bash TESTS=5 +TMPDIR=$TEST_TMPDIR TEST_NAME="lspci-001.txt" cat < $TMPDIR/expected diff --git a/t/pt-summary/parse_virtualization_dmesg.sh b/t/pt-summary/parse_virtualization_dmesg.sh index b770eca6..f91ff32a 100644 --- a/t/pt-summary/parse_virtualization_dmesg.sh +++ b/t/pt-summary/parse_virtualization_dmesg.sh @@ -1,5 +1,8 @@ #!/bin/bash +TESTS=1 +TMPDIR=$TEST_TMPDIR + cat < $TMPDIR/expected Xen EOF