Skip to content

Commit ca24f35

Browse files
vaintroubvuvova
authored andcommitted
MDEV-9566 MariaBackup test suite
1 parent 1991411 commit ca24f35

40 files changed

+809
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--loose-skip-log-bin
416 Bytes
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
secret
2+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CREATE TABLE t(i INT) ENGINE INNODB;
2+
INSERT INTO t VALUES(1);
3+
# xtrabackup backup
4+
INSERT INTO t VALUES(2);
5+
# xtrabackup prepare
6+
# shutdown server
7+
# remove datadir
8+
# xtrabackup move back
9+
# restart server
10+
SELECT * FROM t;
11+
i
12+
1
13+
DROP TABLE t;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
CREATE TABLE t(i INT) ENGINE INNODB;
2+
INSERT INTO t VALUES(1);
3+
echo # xtrabackup backup;
4+
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
5+
6+
--disable_result_log
7+
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
8+
--enable_result_log
9+
10+
INSERT INTO t VALUES(2);
11+
12+
13+
echo # xtrabackup prepare;
14+
--disable_result_log
15+
exec $XTRABACKUP --prepare --target-dir=$targetdir;
16+
exec $XTRABACKUP --defaults-file=$targetdir/backup-my.cnf --stats --datadir=$targetdir;
17+
-- source include/restart_and_restore.inc
18+
--enable_result_log
19+
20+
SELECT * FROM t;
21+
DROP TABLE t;
22+
rmdir $targetdir;
23+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'file_key_management' AND PLUGIN_STATUS='ACTIVE'`)
2+
{
3+
--skip Test requires file_key_management plugin
4+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
let $_server_id= `SELECT @@server_id`;
2+
let $_datadir= `SELECT @@datadir`;
3+
let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect;
4+
exec echo "wait" > $_expect_file_name;
5+
echo # shutdown server;
6+
shutdown_server;
7+
echo # remove datadir;
8+
rmdir $_datadir;
9+
echo # xtrabackup move back;
10+
exec $XTRABACKUP --copy-back --datadir=$_datadir --target-dir=$targetdir --parallel=2;
11+
echo # restart server;
12+
exec echo "restart" > $_expect_file_name;
13+
enable_reconnect;
14+
source include/wait_until_connected_again.inc;
15+
disable_reconnect;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
call mtr.add_suppression("InnoDB: New log files created");
2+
CREATE TABLE t(i INT) ENGINE INNODB;
3+
INSERT INTO t VALUES(1);
4+
# Create full backup , modify table, then create incremental/differential backup
5+
INSERT INTO t VALUES(2);
6+
SELECT * FROM t;
7+
i
8+
1
9+
2
10+
# Prepare full backup, apply incremental one
11+
# Restore and check results
12+
# shutdown server
13+
# remove datadir
14+
# xtrabackup move back
15+
# restart server
16+
SELECT * FROM t;
17+
i
18+
1
19+
2
20+
DROP TABLE t;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
call mtr.add_suppression("InnoDB: New log files created");
2+
3+
4+
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
5+
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
6+
7+
8+
CREATE TABLE t(i INT) ENGINE INNODB;
9+
INSERT INTO t VALUES(1);
10+
11+
echo # Create full backup , modify table, then create incremental/differential backup;
12+
--disable_result_log
13+
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
14+
--enable_result_log
15+
INSERT INTO t VALUES(2);
16+
SELECT * FROM t;
17+
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
18+
19+
--disable_result_log
20+
echo # Prepare full backup, apply incremental one;
21+
exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir;
22+
exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir ;
23+
24+
echo # Restore and check results;
25+
let $targetdir=$basedir;
26+
-- source include/restart_and_restore.inc
27+
--enable_result_log
28+
29+
SELECT * FROM t;
30+
DROP TABLE t;
31+
32+
# Cleanup
33+
rmdir $basedir;
34+
rmdir $incremental_dir;
35+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--innodb-tablespaces-encryption
2+
--plugin-load-add=$DEBUG_KEY_MANAGEMENT_SO
3+
--loose-debug_key_management_version=2

0 commit comments

Comments
 (0)