1let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
2CREATE user backup@localhost;
3
4# backup possible for unprivileges user, with --no-lock
5--disable_result_log
6exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup --no-lock  --target-dir=$targetdir;
7--enable_result_log
8rmdir $targetdir;
9
10# backup fails without --no-lock, because of FTWRL
11--disable_result_log
12error 1;
13exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup --target-dir=$targetdir > $MYSQLTEST_VARDIR/tmp/backup.log;
14--enable_result_log
15
16let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/backup.log;
17--let SEARCH_PATTERN=  missing required privilege RELOAD
18--source include/search_pattern_in_file.inc
19--let SEARCH_PATTERN=  missing required privilege PROCESS
20--source include/search_pattern_in_file.inc
21--let SEARCH_PATTERN= GRANT USAGE ON
22--source include/search_pattern_in_file.inc
23# backup succeeds with RELOAD privilege
24GRANT RELOAD, PROCESS on *.* to backup@localhost;
25--disable_result_log
26exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf  --backup -ubackup --target-dir=$targetdir;
27--enable_result_log
28
29DROP USER backup@localhost;
30# Cleanup
31rmdir $targetdir;
32