-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
br: add option to test encryption for all br int tests #56434
Conversation
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Hi @Tristan1900. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/hold |
/ok-to-test |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #56434 +/- ##
=================================================
- Coverage 73.3650% 57.7578% -15.6072%
=================================================
Files 1624 1777 +153
Lines 448069 647600 +199531
=================================================
+ Hits 328726 374040 +45314
- Misses 99206 248479 +149273
- Partials 20137 25081 +4944
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
/retest |
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm
br/tests/utils.go
Outdated
) | ||
|
||
func main() { | ||
if len(os.Args) < 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may use cobra.Command
instead of manually parse the command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha
br/tests/utils.go
Outdated
storagePath := "" | ||
|
||
for i, arg := range args { | ||
if arg == "backup" || arg == "restore" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps verifying backup is enough? As restore in fact contributes nothing to the files to be checked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should add a comment for the code here.
For the full backup we can check the storage encryption status once the command is complete since it's a blocking call, but for log backup I believe we need some extra logic to wait for it to generate some files. So my approach is to verify log backup files before doing restore, making sure the files are actually encrypted. Let me know what you think!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
br/tests/utils.go
Outdated
if arg == "backup" || arg == "restore" { | ||
hasBackupOrRestore = true | ||
} | ||
if arg == "-s" && i+1 < len(args) && strings.HasPrefix(args[i+1], "local://") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also handle --storage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah good call, all the tests are using -s so I thought that's the command.
tests/_utils/run_br
Outdated
@@ -20,4 +20,4 @@ br.test -test.coverprofile="$COV_DIR/cov.$TEST_NAME.$$.out.log" DEVEL "$@" \ | |||
-L "info" \ | |||
--ca "$TEST_DIR/certs/ca.pem" \ | |||
--cert "$TEST_DIR/certs/br.pem" \ | |||
--key "$TEST_DIR/certs/br.key" | |||
--key "$TEST_DIR/certs/br.key" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe keep the empty line at the end of file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I added logic and later removed, need to revert it
ENCRYPTION_ARGS="--crypter.method aes128-ctr --crypter.key 0123456789abcdef0123456789abcdef --master-key-crypter-method AES256-CTR --master-key $MASTER_KEY_PATH" | ||
|
||
# plaintext data key | ||
#ENCRYPTION_ARGS="--crypter.method aes128-ctr --crypter.key 0123456789abcdef0123456789abcdef --log.crypter.method AES256-CTR --log.crypter.key 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove this if it isn't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is sort of a placeholder if we want to test the plaintext case, we can uncomment it and run the test. The entire tests will be run as needed, not by default for every commit per discussion with Brian, but I don't think it will hurt if we just enable encryption by default, let me know your thoughts.!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add some hints about when and hot to use it(Say, # If you want to specify a plaintext data key, uncomment and modify this as you like.
? Or it looks pretty like temporary code during developing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good!
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Please wait for this PR #51126 to be merged first. |
/retest |
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
/unhold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BornChanger, YuJuncen The full list of commands accepted by this bot can be found here. The pull request process is described here |
[LGTM Timeline notifier]Timeline:
|
/retest |
What problem does this PR solve?
Issue Number: close #56433
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.