From a7d6271cbf63d129045ba4c97333f975bf88e050 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 29 Jan 2017 13:49:23 +0100 Subject: [PATCH] skip innodb.log_corruption test if no unzip executable is found also move *.zip files from t/ to std_data/ --- mysql-test/include/have_unzip.inc | 3 +++ mysql-test/suite.pm | 2 ++ .../innodb/{t => std_data}/log_corruption.zip | Bin .../{t => std_data}/log_corruption0.zip | Bin .../{t => std_data}/log_corruption1.zip | Bin .../{t => std_data}/log_corruption2.zip | Bin .../{t => std_data}/log_corruption3.zip | Bin .../{t => std_data}/log_corruption4.zip | Bin .../{t => std_data}/log_corruption4a.zip | Bin .../{t => std_data}/log_corruption5.zip | Bin .../{t => std_data}/log_corruption6.zip | Bin mysql-test/suite/innodb/t/log_corruption.test | 19 +++++++++--------- 12 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 mysql-test/include/have_unzip.inc rename mysql-test/suite/innodb/{t => std_data}/log_corruption.zip (100%) rename mysql-test/suite/innodb/{t => std_data}/log_corruption0.zip (100%) rename mysql-test/suite/innodb/{t => std_data}/log_corruption1.zip (100%) rename mysql-test/suite/innodb/{t => std_data}/log_corruption2.zip (100%) rename mysql-test/suite/innodb/{t => std_data}/log_corruption3.zip (100%) rename mysql-test/suite/innodb/{t => std_data}/log_corruption4.zip (100%) rename mysql-test/suite/innodb/{t => std_data}/log_corruption4a.zip (100%) rename mysql-test/suite/innodb/{t => std_data}/log_corruption5.zip (100%) rename mysql-test/suite/innodb/{t => std_data}/log_corruption6.zip (100%) diff --git a/mysql-test/include/have_unzip.inc b/mysql-test/include/have_unzip.inc new file mode 100644 index 00000000000..a3308524679 --- /dev/null +++ b/mysql-test/include/have_unzip.inc @@ -0,0 +1,3 @@ +# +# empty. the real check happens in suite.pm +# diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm index f501e610e53..134a0d6d438 100644 --- a/mysql-test/suite.pm +++ b/mysql-test/suite.pm @@ -68,6 +68,8 @@ sub skip_combinations { unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/ and $1 ge "1.0.1d"; + $skip{'include/have_unzip.inc'} = 'no unzip executable' unless `unzip`; + %skip; } diff --git a/mysql-test/suite/innodb/t/log_corruption.zip b/mysql-test/suite/innodb/std_data/log_corruption.zip similarity index 100% rename from mysql-test/suite/innodb/t/log_corruption.zip rename to mysql-test/suite/innodb/std_data/log_corruption.zip diff --git a/mysql-test/suite/innodb/t/log_corruption0.zip b/mysql-test/suite/innodb/std_data/log_corruption0.zip similarity index 100% rename from mysql-test/suite/innodb/t/log_corruption0.zip rename to mysql-test/suite/innodb/std_data/log_corruption0.zip diff --git a/mysql-test/suite/innodb/t/log_corruption1.zip b/mysql-test/suite/innodb/std_data/log_corruption1.zip similarity index 100% rename from mysql-test/suite/innodb/t/log_corruption1.zip rename to mysql-test/suite/innodb/std_data/log_corruption1.zip diff --git a/mysql-test/suite/innodb/t/log_corruption2.zip b/mysql-test/suite/innodb/std_data/log_corruption2.zip similarity index 100% rename from mysql-test/suite/innodb/t/log_corruption2.zip rename to mysql-test/suite/innodb/std_data/log_corruption2.zip diff --git a/mysql-test/suite/innodb/t/log_corruption3.zip b/mysql-test/suite/innodb/std_data/log_corruption3.zip similarity index 100% rename from mysql-test/suite/innodb/t/log_corruption3.zip rename to mysql-test/suite/innodb/std_data/log_corruption3.zip diff --git a/mysql-test/suite/innodb/t/log_corruption4.zip b/mysql-test/suite/innodb/std_data/log_corruption4.zip similarity index 100% rename from mysql-test/suite/innodb/t/log_corruption4.zip rename to mysql-test/suite/innodb/std_data/log_corruption4.zip diff --git a/mysql-test/suite/innodb/t/log_corruption4a.zip b/mysql-test/suite/innodb/std_data/log_corruption4a.zip similarity index 100% rename from mysql-test/suite/innodb/t/log_corruption4a.zip rename to mysql-test/suite/innodb/std_data/log_corruption4a.zip diff --git a/mysql-test/suite/innodb/t/log_corruption5.zip b/mysql-test/suite/innodb/std_data/log_corruption5.zip similarity index 100% rename from mysql-test/suite/innodb/t/log_corruption5.zip rename to mysql-test/suite/innodb/std_data/log_corruption5.zip diff --git a/mysql-test/suite/innodb/t/log_corruption6.zip b/mysql-test/suite/innodb/std_data/log_corruption6.zip similarity index 100% rename from mysql-test/suite/innodb/t/log_corruption6.zip rename to mysql-test/suite/innodb/std_data/log_corruption6.zip diff --git a/mysql-test/suite/innodb/t/log_corruption.test b/mysql-test/suite/innodb/t/log_corruption.test index 725c8db6360..664894f2c41 100644 --- a/mysql-test/suite/innodb/t/log_corruption.test +++ b/mysql-test/suite/innodb/t/log_corruption.test @@ -1,3 +1,4 @@ +--source include/have_unzip.inc --source include/have_innodb.inc --source include/have_innodb_16k.inc @@ -27,7 +28,7 @@ core_file EOF --echo # redo log from before MySQL 5.7.9 ---exec unzip $MYSQL_TEST_DIR/suite/innodb/t/log_corruption.zip -d $bugdir > $SEARCH_FILE +--exec unzip $MTR_SUITE_DIR/std_data/log_corruption.zip -d $bugdir > $SEARCH_FILE --error 1 --exec $MYSQLD $args let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported. This redo log was created before MySQL 5\\.7\\.9\\.; @@ -43,7 +44,7 @@ let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported. This redo log --echo # redo log from before MySQL 5.7.9, with corrupted log block --remove_file $bugdir/ib_logfile0 ---exec unzip $MYSQL_TEST_DIR/suite/innodb/t/log_corruption0.zip -d $bugdir > $SEARCH_FILE +--exec unzip $MTR_SUITE_DIR/std_data/log_corruption0.zip -d $bugdir > $SEARCH_FILE --error 1 --exec $MYSQLD $args let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported. This redo log was created before MySQL 5\\.7\\.9, and it appears corrupted; @@ -51,7 +52,7 @@ let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported. This redo log --echo # redo log from "after" MySQL 5.7.9, but with invalid header checksum --remove_file $bugdir/ib_logfile0 ---exec unzip $MYSQL_TEST_DIR/suite/innodb/t/log_corruption1.zip -d $bugdir > $SEARCH_FILE +--exec unzip $MTR_SUITE_DIR/std_data/log_corruption1.zip -d $bugdir > $SEARCH_FILE --error 1 --exec $MYSQLD $args let SEARCH_PATTERN=InnoDB: Invalid redo log header checksum; @@ -59,7 +60,7 @@ let SEARCH_PATTERN=InnoDB: Invalid redo log header checksum; --echo # distant future redo log format, with valid header checksum --remove_file $bugdir/ib_logfile0 ---exec unzip $MYSQL_TEST_DIR/suite/innodb/t/log_corruption2.zip -d $bugdir > $SEARCH_FILE +--exec unzip $MTR_SUITE_DIR/std_data/log_corruption2.zip -d $bugdir > $SEARCH_FILE --error 1 --exec $MYSQLD $args let SEARCH_PATTERN=InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading-downgrading.html; @@ -67,7 +68,7 @@ let SEARCH_PATTERN=InnoDB: Unsupported redo log format. The redo log was created --echo # valid header, but old-format checkpoint blocks --remove_file $bugdir/ib_logfile0 ---exec unzip $MYSQL_TEST_DIR/suite/innodb/t/log_corruption3.zip -d $bugdir > $SEARCH_FILE +--exec unzip $MTR_SUITE_DIR/std_data/log_corruption3.zip -d $bugdir > $SEARCH_FILE --error 1 --exec $MYSQLD $args let SEARCH_PATTERN=InnoDB: No valid checkpoint found .corrupted redo log; @@ -75,7 +76,7 @@ let SEARCH_PATTERN=InnoDB: No valid checkpoint found .corrupted redo log; --echo # valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block checksum --remove_file $bugdir/ib_logfile0 ---exec unzip $MYSQL_TEST_DIR/suite/innodb/t/log_corruption4.zip -d $bugdir > $SEARCH_FILE +--exec unzip $MTR_SUITE_DIR/std_data/log_corruption4.zip -d $bugdir > $SEARCH_FILE # Anything below innodb_force_recovery=6 must find a valid redo log. # Missing tablespace files are tolerated already with innodb_force_recovery=1. --error 1 @@ -94,7 +95,7 @@ let SEARCH_PATTERN=InnoDB: Cannot create sys_virtual system tables. running in r --echo # valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block number --remove_file $bugdir/ib_logfile0 ---exec unzip $MYSQL_TEST_DIR/suite/innodb/t/log_corruption4a.zip -d $bugdir > $SEARCH_FILE +--exec unzip $MTR_SUITE_DIR/std_data/log_corruption4a.zip -d $bugdir > $SEARCH_FILE # Anything below innodb_force_recovery=6 must find a valid redo log. # Missing tablespace files are tolerated already with innodb_force_recovery=1. --error 1 @@ -112,7 +113,7 @@ let SEARCH_PATTERN=InnoDB: Cannot create sys_virtual system tables. running in r --echo # Test a corrupted MLOG_FILE_NAME record. --echo # valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2 --remove_file $bugdir/ib_logfile0 ---exec unzip $MYSQL_TEST_DIR/suite/innodb/t/log_corruption5.zip -d $bugdir > $SEARCH_FILE +--exec unzip $MTR_SUITE_DIR/std_data/log_corruption5.zip -d $bugdir > $SEARCH_FILE --error 1 --exec $MYSQLD $args let SEARCH_PATTERN=InnoDB: Log scan progressed past the checkpoint lsn 1213964; @@ -129,7 +130,7 @@ let SEARCH_PATTERN=InnoDB: Set innodb_force_recovery to ignore this error; --echo # Test a corrupted MLOG_FILE_NAME record. --echo # valid header, invalid checkpoint 1, valid checkpoint 2 --remove_file $bugdir/ib_logfile0 ---exec unzip $MYSQL_TEST_DIR/suite/innodb/t/log_corruption6.zip -d $bugdir > $SEARCH_FILE +--exec unzip $MTR_SUITE_DIR/std_data/log_corruption6.zip -d $bugdir > $SEARCH_FILE --error 1 --exec $MYSQLD $args let SEARCH_PATTERN=InnoDB: ############### CORRUPT LOG RECORD FOUND ##################;