Skip to content

Add test crate #17

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

Merged
merged 6 commits into from
Mar 25, 2024
Merged

Add test crate #17

merged 6 commits into from
Mar 25, 2024

Conversation

gowthamsk-arm
Copy link
Collaborator

Signed-off-by: Gowtham Suresh Kumar gowtham.sureshkumar@arm.com

@gowthamsk-arm gowthamsk-arm force-pushed the gsk/test_crate branch 2 times, most recently from 5454c12 to c479ce1 Compare March 12, 2024 16:11
@gowthamsk-arm gowthamsk-arm changed the title Add test crate [WIP] Add test crate Mar 12, 2024
@gowthamsk-arm gowthamsk-arm force-pushed the gsk/test_crate branch 2 times, most recently from d81ab70 to 8aeb5a6 Compare March 15, 2024 17:24
@tgonzalezorlandoarm
Copy link
Member

A general comment for our entire CI testing setup, not for this PR in particular:
Should we be testing for MSRV? If so, we would be failing the CI with the current setup and I can open a PR for that

@tgonzalezorlandoarm
Copy link
Member

Should we be testing for MSRV?

We should also probably define it. I think it should be 1.66.0 like parsec


let provider_name = String::from("default");

let mut lib_ctx: LibCtx = LibCtx::new().unwrap();

Choose a reason for hiding this comment

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

I don't think this needs to be mut, right?

@gowthamsk-arm
Copy link
Collaborator Author

Thanks for the comments.:)
This is still a WIP PR. Will be pushing the cleaned-up version today.

@tgonzalezorlandoarm
Copy link
Member

Sure, thanks :)
I hope these help :)

@gowthamsk-arm gowthamsk-arm force-pushed the gsk/test_crate branch 2 times, most recently from 781ff79 to d22a378 Compare March 19, 2024 19:14
@gowthamsk-arm gowthamsk-arm changed the title [WIP] Add test crate Add test crate Mar 19, 2024
@tgonzalezorlandoarm
Copy link
Member

Seeing the CI failures, we should use https://docs.rs/env_logger/0.7.1/env_logger/fn.try_init.html instead of env_logger::init

@tgonzalezorlandoarm
Copy link
Member

Could we please log errors in tests so that we can have more information?

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
"evp.h" and "provider.h" APIs are needed for the test crate so generate
them separately using the build.rs and include them in a test module.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
@gowthamsk-arm gowthamsk-arm force-pushed the gsk/test_crate branch 3 times, most recently from 4005ff2 to c57f462 Compare March 22, 2024 16:49
),
1
);
assert_ne!(parsec_pkey, std::ptr::null_mut());

Choose a reason for hiding this comment

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

This is for the double pointer? Should it maybe be for the content of the pointer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's right. I changed the function arguments to double pointer and forgot to update it here.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Currently the tests are targeted towards the basic provider functions
along with key management. Key loading is added for a dummy RSA key
for the default provider. This needs to be changed after the key
management feature is merged.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Copy link
Member

@tgonzalezorlandoarm tgonzalezorlandoarm left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@tgonzalezorlandoarm tgonzalezorlandoarm merged commit a4131f4 into main Mar 25, 2024
@gowthamsk-arm gowthamsk-arm deleted the gsk/test_crate branch March 25, 2024 15:12
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.

2 participants