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

Luks blackbox tests #1685

Merged
merged 2 commits into from
Jun 14, 2024
Merged

Luks blackbox tests #1685

merged 2 commits into from
Jun 14, 2024

Conversation

prestist
Copy link
Collaborator

@prestist prestist commented Aug 2, 2023

@prestist prestist force-pushed the luks-blackbox-tests branch 2 times, most recently from 0e5c593 to efb11c6 Compare August 3, 2023 14:50
@prestist prestist added the skip-notes This PR does not need release notes label Aug 3, 2023
@prestist prestist force-pushed the luks-blackbox-tests branch 2 times, most recently from 7e2ffb6 to 5489926 Compare August 4, 2023 20:33
@prestist prestist force-pushed the luks-blackbox-tests branch 4 times, most recently from dfa7816 to 1a9aee7 Compare August 16, 2023 16:21
@prestist prestist marked this pull request as ready for review August 21, 2023 13:40
tests/types/types.go Outdated Show resolved Hide resolved
tests/positive/luks/creation.go Show resolved Hide resolved
tests/validator.go Outdated Show resolved Hide resolved
tests/blackbox_test.go Outdated Show resolved Hide resolved
tests/validator.go Outdated Show resolved Hide resolved
tests/blackbox_test.go Outdated Show resolved Hide resolved
tests/blackbox_test.go Outdated Show resolved Hide resolved
@prestist prestist force-pushed the luks-blackbox-tests branch 2 times, most recently from 71395ca to 0069a26 Compare May 29, 2024 13:45
@prestist
Copy link
Collaborator Author

Added issue for Clevis binding validation; feel free to add more detail. #1877

tests/blackbox_test.go Outdated Show resolved Hide resolved
tests/negative/luks/creation.go Outdated Show resolved Hide resolved
@@ -150,6 +151,7 @@ func outer(t *testing.T, test types.Test, negativeTests bool) error {
if err != nil {
return err
}

Copy link
Member

Choose a reason for hiding this comment

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

Minor: extraneous

tests/blackbox_test.go Outdated Show resolved Hide resolved
tests/blackbox_test.go Outdated Show resolved Hide resolved
tests/blackbox_test.go Outdated Show resolved Hide resolved
tests/types/types.go Outdated Show resolved Hide resolved
register.Register(register.NegativeTest, LuksOnNonExtDevice())
}

func LuksOnNonExtDevice() types.Test {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a docstring above this line explaining what this negative test is checking?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can add more detail if necessary I fixed some naming and I think that does a lot.

tests/negative/luks/creation.go Outdated Show resolved Hide resolved
Comment on lines 39 to 52
"ignition": { "version": "$version" },
"storage": {
"disks": [
{
"device": "$DEVICE",
"partitions": [
{
"label": "luks-device",
"sizeMiB": 0,
"startMiB": 0
}
],
"wipe_table": true
}
],
"luks": [
{
"device": "$DEVICE",
"name": "$UUID",
"keyFile": {
"compression": "",
"source": "data:,REPLACE-THIS-WITH-YOUR-KEY-MATERIAL"
},
"wipe_volume": true
}
]
}
Copy link
Member

Choose a reason for hiding this comment

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

This test is creating a partition on $DEVICE, but then creating a LUKS device on the disk instead of the partition, nuking the freshly created partition table. Is that intended?

Similarly below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah; Some how doing it this way made the tests pass. I am not sure why but I was using 'wipe_volume' which is bu. not ign. and this config got away with it. I noticed that just now and dropped the partitions and switched to the correct .ign field.

tests/positive/luks/creation.go Outdated Show resolved Hide resolved
tests/positive/luks/creation.go Outdated Show resolved Hide resolved
@prestist prestist force-pushed the luks-blackbox-tests branch 2 times, most recently from 0aa6c4c to 61e9cf5 Compare June 10, 2024 21:09
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Just a few nits but looks great!

tests/blackbox_test.go Outdated Show resolved Hide resolved
tests/blackbox_test.go Outdated Show resolved Hide resolved
Until now, the blackbox tests would not correctly cleanup after
running a test with a luks device. Now Luks devices can be tested
using blackbox test framework.
@prestist prestist merged commit f6b5e4b into coreos:main Jun 14, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-notes This PR does not need release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants