Skip to content
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

SecureComms: E2e Test SecureComms without KBS #2089

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidhadas
Copy link
Member

@davidhadas davidhadas commented Oct 6, 2024

Support testing SecureComms without KBS

See

Should be merged after #2065

@davidhadas davidhadas requested a review from a team as a code owner October 6, 2024 19:34
@davidhadas davidhadas force-pushed the secComms_test_no_kbs branch from d7b9676 to 6dcef0f Compare October 6, 2024 19:35
@davidhadas davidhadas changed the title SecureComms: Add support daemonConfig SecureComms: Test SecureComms without KBS Oct 6, 2024
@davidhadas davidhadas changed the title SecureComms: Test SecureComms without KBS SecureComms: E2e Test SecureComms without KBS Oct 7, 2024
@stevenhorsman stevenhorsman added the test_e2e_libvirt Run Libvirt e2e tests label Oct 7, 2024
@davidhadas davidhadas force-pushed the secComms_test_no_kbs branch 25 times, most recently from f08e2d3 to f582a4e Compare October 11, 2024 15:52
@stevenhorsman
Copy link
Member

stevenhorsman commented Nov 28, 2024

So this change is just regression testing to check that the no_trustee version of securecomms doesn't cause any failures. Is there any easy way to validate that this set-up has been used?

@davidhadas davidhadas force-pushed the secComms_test_no_kbs branch 3 times, most recently from 26d3602 to 524869d Compare November 28, 2024 17:09
@davidhadas davidhadas force-pushed the secComms_test_no_kbs branch 3 times, most recently from 9b5b9b4 to 0c3db17 Compare December 12, 2024 10:39
@davidhadas davidhadas force-pushed the secComms_test_no_kbs branch 3 times, most recently from a7cf406 to 2331371 Compare December 12, 2024 15:24
@stevenhorsman stevenhorsman marked this pull request as draft December 12, 2024 17:07
@davidhadas davidhadas force-pushed the secComms_test_no_kbs branch 4 times, most recently from c89bfc7 to be301d2 Compare December 13, 2024 09:15
src/cloud-api-adaptor/libvirt/config_libvirt.sh Outdated Show resolved Hide resolved
src/cloud-api-adaptor/test/e2e/common_suite.go Outdated Show resolved Hide resolved
Comment on lines 39 to 41
if !testCase_secureComms_isActive {
t.Skip("Skip - SecureComms is configured to be inactive - no need to test")
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We typically do the skip in the provider test case, so libvirt_test in this case, so it might be worth following this pattern.

Also our current pattern for whether to skip tests or not is to use environment variables, so can you use TEST_E2E_SECURE_COMMS rather than creating this extra go variable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it really make sense to move the skip to libvirt_test, it needs to be skipped no matter who the provider is...
seems like common_suite is the natural place for it...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand your reasoning, but none of the other providers would call this test, unless you are planning to support testing this elsewhere in future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont see why SecureComms will not be tested with other providers in the future.

Copy link
Member Author

@davidhadas davidhadas Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEST_E2E_SECURE_COMMS is a matrix parameter. It may have multiple values and the mapping is done once in config_libvirt.sh. It results in potentially activating SecureComms. Here we need to identify if secureComms was activated in this matrix option and act accordingly. This is done by checking if props["SECURE_COMMS"] == "true" as shown on e2e/main_test.go.

Therefore we should not be using TEST_E2E_SECURE_COMMS env directly, but have our own env variable indicating is SecureComms is active - I am now using the SECURE_COMMS env variable for that.

Comment on lines 126 to 130
if props["SECURE_COMMS"] == "true" {
testCase_secureComms_isActive = true
log.Info("Do setup secureComms is active")
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code would not be needed if you followed the env var approach

Copy link
Member Author

@davidhadas davidhadas Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

src/cloud-api-adaptor/test/provisioner/provision.go Outdated Show resolved Hide resolved
@davidhadas davidhadas force-pushed the secComms_test_no_kbs branch 7 times, most recently from 551140b to 6bd5e10 Compare December 14, 2024 14:43
Add support for e2e testing SecureComms without KBS

Signed-off-by: David Hadas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test_e2e_libvirt Run Libvirt e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants