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

Remove MOUNT_SECURE bool #595

Merged
merged 1 commit into from
Jun 2, 2023
Merged

Conversation

Koncpa
Copy link
Contributor

@Koncpa Koncpa commented May 25, 2023

Remove MOUNT_SECURE bool and conditional
related with bool.Update secure mount
unit test to mount temp dir.

@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #595 (a21ce09) into master (662f7f4) will increase coverage by 0.28%.
The diff coverage is n/a.

❗ Current head a21ce09 differs from pull request most recent head 03b662a. Consider uploading reports for the commit 03b662a to get more accurate results

Additional details and impacted files
Flag Coverage Δ
e2e-testsuite 58.99% <ø> (+0.08%) ⬆️
upstream-unit-tests 58.92% <ø> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
keylime-agent/src/common.rs 70.18% <ø> (-0.44%) ⬇️
keylime-agent/src/secure_mount.rs 50.00% <ø> (+12.50%) ⬆️

Copy link
Contributor

@ansasaki ansasaki left a comment

Choose a reason for hiding this comment

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

Could you please also remove the MOUNT_SECURE from common.rs?

let path = "/var/lib/keylime";
let work_dir = Path::new(&path);
let secure_dir_path = Path::new(work_dir).join("secure");
let temp_workdir = tempfile::tempdir().unwrap(); //#[allow_ci]
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest you keep the "secure" to force mount() to create the directory. It will increase the coverage. Something like:

Suggested change
let temp_workdir = tempfile::tempdir().unwrap(); //#[allow_ci]
let temp_workdir = tempfile::tempdir().unwrap(); //#[allow_ci]
let secure_dir_path = Path::new(temp_workdir).join("secure");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it seems that this decreased code coverage a lot from point of secure mount.

@Koncpa Koncpa force-pushed the pk_secure_mount branch 5 times, most recently from 5716832 to a21ce09 Compare May 30, 2023 10:37
Remove MOUNT_SECURE bool and conditional
related with bool.Update secure mount
unit test to mount temp dir.

Signed-off-by: Patrik Koncity <[email protected]>
Copy link
Contributor

@ansasaki ansasaki left a comment

Choose a reason for hiding this comment

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

LGTM!

@ansasaki ansasaki merged commit 3c9d17c into keylime:master Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants