Skip to content

Commit 3ecc50a

Browse files
committed
Add a test checking ListKeys provider target
Fix parallaxsecond#310 Signed-off-by: Hugues de Valon <[email protected]>
1 parent c67b25a commit 3ecc50a

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

e2e_tests/tests/all_providers/normal.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
// Copyright 2019 Contributors to the Parsec project.
22
// SPDX-License-Identifier: Apache-2.0
3+
use e2e_tests::RawRequestClient;
34
use e2e_tests::TestClient;
45
use parsec_client::core::interface::operations::list_providers::Uuid;
5-
use parsec_client::core::interface::requests::{AuthType, Opcode, ProviderID, Result};
6+
use parsec_client::core::interface::requests::request::RawHeader;
7+
use parsec_client::core::interface::requests::{
8+
AuthType, Opcode, ProviderID, ResponseStatus, Result,
9+
};
610
use std::collections::HashSet;
711

812
#[test]
@@ -147,3 +151,19 @@ fn list_keys() {
147151
assert!(key_names.contains(&(key2.clone(), ProviderID::Pkcs11)));
148152
assert!(key_names.contains(&(key3.clone(), ProviderID::Tpm)));
149153
}
154+
155+
#[test]
156+
// See #310
157+
fn invalid_provider_list_keys() {
158+
let mut client = RawRequestClient {};
159+
let mut req_hdr = RawHeader::new();
160+
161+
// Always targeting the Mbed Crypto provider
162+
req_hdr.provider = 0x1;
163+
req_hdr.opcode = Opcode::ListKeys as u32;
164+
165+
let resp = client
166+
.send_raw_request(req_hdr, Vec::new())
167+
.expect("Failed to read Response");
168+
assert_eq!(resp.header.status, ResponseStatus::PsaErrorNotSupported);
169+
}

0 commit comments

Comments
 (0)