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

Improve E2E testing #253

Merged
merged 1 commit into from
Sep 21, 2020
Merged

Conversation

ionut-arm
Copy link
Member

This commit improves integration testing by adding tests for:

  • cross-checking compatibility for handling key material and other
    buffer encodings
  • fault testing the handling of request header values
  • expand stress testing to cover asymmetric encryption and
    decryption, and ECC sign/verify
  • checking that operations that are not in the supported opcodes
    list are indeed not supported
    Some other improvements:
  • moving testing for ECC signatures from integration testing to E2E
    testing
  • change the export usage flags to false unless explicitly required
    by the test

Signed-off-by: Ionut Mihalcea [email protected]

@ionut-arm ionut-arm added bug Something isn't working enhancement New feature or request labels Sep 18, 2020
@ionut-arm ionut-arm added this to the Parsec production ready milestone Sep 18, 2020
@ionut-arm ionut-arm self-assigned this Sep 18, 2020
@ionut-arm ionut-arm force-pushed the test-update branch 5 times, most recently from 0a79d00 to 6afefe4 Compare September 18, 2020 15:06
This commit improves integration testing by adding tests for:
* cross-checking compatibility for handling key material and other
buffer encodings
* fault testing the handling of request header values
* expand stress testing to cover asymmetric encryption and
decryption, and ECC sign/verify
* checking that operations that are not in the supported opcodes
list are indeed not supported
Some other improvements:
* moving testing for ECC signatures from integration testing to E2E
testing
* change the `export` usage flags to `false` unless explicitly required
by the test

Signed-off-by: Ionut Mihalcea <[email protected]>
@ionut-arm ionut-arm marked this pull request as ready for review September 18, 2020 15:43
Copy link
Member

@hug-dev hug-dev left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your effort! I will update parallaxsecond/parsec-book#65 with these changes

Comment on lines -47 to -52
[dev-dependencies]
ring = "0.16.15"
lazy_static = "1.4.0"
rsa = "0.3.0"
rand = "0.7.3"
sha2 = "0.9.1"
Copy link
Member

Choose a reason for hiding this comment

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

🙏

Comment on lines +54 to +55
SignEcc,
VerifyEcc,
Copy link
Member

Choose a reason for hiding this comment

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

ooh pretty good 💯

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, unfortunately PKCS11 doesn't support it -_- one day!!!

#[test]
fn tpm_sign_cross() {
let key_name = String::from("tpm_sign_cross");
let (mut client, pub_key, signature) = setup_sign(ProviderID::Tpm, key_name.clone()).unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

Small nit and maybe not good for performance but we could put this function in a for provider in [Tpm, MbedCrypto, Pkcs11] loop

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, yeah, I guess! My only concern was with figuring out what failed and where, but I guess we can put a format! in the expect(...)

@@ -5,6 +5,8 @@ use parsec_client::core::interface::operations::list_providers::Uuid;
use parsec_client::core::interface::requests::{AuthType, Opcode, ProviderID, Result};
use std::collections::HashSet;

mod cross;
Copy link
Member

Choose a reason for hiding this comment

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

Is that used?

Copy link
Member

Choose a reason for hiding this comment

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

Oh this might be needed so that test are executed? Even without pub 🤯

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, it's only about the tests being in some module

@ionut-arm ionut-arm merged commit 82718eb into parallaxsecond:master Sep 21, 2020
@ionut-arm ionut-arm deleted the test-update branch September 21, 2020 13:57
@ionut-arm ionut-arm mentioned this pull request Sep 21, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants