Merge lp:~gl-az/percona-xtrabackup/2.1-bug1197644 into lp:percona-xtrabackup/2.1

Proposed by George Ormond Lorch III
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 627
Proposed branch: lp:~gl-az/percona-xtrabackup/2.1-bug1197644
Merge into: lp:percona-xtrabackup/2.1
Prerequisite: lp:~akopytov/percona-xtrabackup/test-suite-cleanups-2.1
Diff against target: 26 lines (+9/-4)
1 file modified
test/t/xb_encrypt.sh (+9/-4)
To merge this branch: bzr merge lp:~gl-az/percona-xtrabackup/2.1-bug1197644
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+173754@code.launchpad.net

This proposal supersedes a proposal from 2013-07-08.

Description of the change

Fix for bug 1197644 : --encrypt-key-file is not covered by the test suite.

Modified xb_encrypt.sh to test using the --encrypt-key-file option while other tests that use encryption will use --encrypt-key option.

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) wrote : Posted in a previous version of this proposal
Revision history for this message
Alexey Kopytov (akopytov) wrote : Posted in a previous version of this proposal

Using global files (under /tmp) in tests is a bad idea, because 1) there may be a conflict with other concurrently running tests and 2) they won't be removed if the test fails.

If you create them under $TEST_VAR_ROOT they will be unique for each test and will be automatically removed by the test suite if the test does not clean up itself.

review: Needs Fixing
Revision history for this message
George Ormond Lorch III (gl-az) wrote : Posted in a previous version of this proposal

Yeah, I thought about that yesterday after I submitted the MP and
remembered that my original test for this was doing something like that
for the exact same reason. I was hoping that you wouldn't get to the
review until I had a chance to kill that MP and rework it. The problem
is that this is using the xb_local functionality so it means that
instead of just including xb_local I will have to actually change this
to be a full test so that $TEST_VAR_ROOT is properly defined by the time
the script goes to use it. I'll fix this up today.

On 7/8/2013 11:10 PM, Alexey Kopytov wrote:
> Review: Needs Fixing
>
> Using global files (under /tmp) in tests is a bad idea, because 1) there may be a conflict with other concurrently running tests and 2) they won't be removed if the test fails.
>
> If you create them under $TEST_VAR_ROOT they will be unique for each test and will be automatically removed by the test suite if the test does not clean up itself.

--
George O. Lorch III
Software Engineer, Percona
+1-888-401-3401 x542 US/Arizona (GMT -7)
skype: george.ormond.lorch.iii

Revision history for this message
Alexey Kopytov (akopytov) wrote : Posted in a previous version of this proposal

George,

TEST_VAR_ROOT is defined for each test, you don't have to include
anything to have it defined.

Revision history for this message
George Ormond Lorch III (gl-az) wrote : Posted in a previous version of this proposal

Ahh, awesome. I was just looking at some of the exported vars when I
hung it up yesterday while doing the code review for the test suite
cleanup and didn't connect the dots. That will make it quite easy then...
On 7/9/2013 7:28 AM, Alexey Kopytov wrote:
> George,
>
> TEST_VAR_ROOT is defined for each test, you don't have to include
> anything to have it defined.
>

--
George O. Lorch III
Software Engineer, Percona
+1-888-401-3401 x542 US/Arizona (GMT -7)
skype: george.ormond.lorch.iii

Revision history for this message
George Ormond Lorch III (gl-az) wrote :
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test/t/xb_encrypt.sh'
2--- test/t/xb_encrypt.sh 2013-07-09 15:32:43 +0000
3+++ test/t/xb_encrypt.sh 2013-07-09 15:32:43 +0000
4@@ -4,13 +4,18 @@
5
6 encrypt_algo="AES256"
7 encrypt_key="percona_xtrabackup_is_awesome___"
8-
9-innobackupex_options="--encrypt=$encrypt_algo --encrypt-key=$encrypt_key --encrypt-threads=4 --encrypt-chunk-size=8K"
10+encrypt_key_file=${TEST_VAR_ROOT}/xb_encrypt.key
11+
12+echo -n $encrypt_key > $encrypt_key_file
13+
14+innobackupex_options="--encrypt=$encrypt_algo --encrypt-key-file=$encrypt_key_file --encrypt-threads=4 --encrypt-chunk-size=8K"
15 data_decrypt_cmd="for i in *.xbcrypt; do \
16-xbcrypt -d -a $encrypt_algo -k $encrypt_key < \$i > \${i:0:\${#i}-8}; \
17+xbcrypt -d -a $encrypt_algo -f $encrypt_key_file < \$i > \${i:0:\${#i}-8}; \
18 rm -f \$i; done; \
19 for i in ./sakila/*.xbcrypt; do \
20-xbcrypt -d -a $encrypt_algo -k $encrypt_key < \$i > \${i:0:\${#i}-8}; \
21+xbcrypt -d -a $encrypt_algo -f $encrypt_key_file < \$i > \${i:0:\${#i}-8}; \
22 rm -f \$i; done;"
23
24 . inc/xb_local.sh
25+
26+rm -f $encrypt_key_file

Subscribers

People subscribed via source and target branches