Skip to content

Commit

Permalink
e2e test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
r-n-o committed Nov 11, 2024
1 parent 85bb186 commit bb9ac56
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/integration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ pub const LOCAL_HOST: &str = "127.0.0.1";
pub const PCR3: &str = "78fce75db17cd4e0a3fb8dad3ad128ca5e77edbb2b2c7f75329dccd99aa5f6ef4fc1f1a452e315b9e98f9e312e6921e6";
/// QOS dist directory.
pub const QOS_DIST_DIR: &str = "./mock/dist";
/// Mock pcr3 pre-image.
pub const PCR3_PRE_IMAGE_PATH: &str = "./mock/namespaces/pcr3-preimage.txt";

const MSG: &str = "msg";

Expand Down
8 changes: 4 additions & 4 deletions src/integration/tests/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{

use borsh::de::BorshDeserialize;
use integration::{
LOCAL_HOST, PIVOT_OK2_PATH, PIVOT_OK2_SUCCESS_FILE, QOS_DIST_DIR,
LOCAL_HOST, PCR3_PRE_IMAGE_PATH, PIVOT_OK2_PATH, PIVOT_OK2_SUCCESS_FILE, QOS_DIST_DIR
};
use qos_core::protocol::{
services::{
Expand Down Expand Up @@ -81,7 +81,7 @@ async fn standard_boot_e2e() {
"--qos-release-dir",
QOS_DIST_DIR,
"--pcr3-preimage-path",
"./mock/namespaces/pcr3-preimage.txt",
PCR3_PRE_IMAGE_PATH,
"--manifest-path",
&cli_manifest_path,
"--pivot-args",
Expand Down Expand Up @@ -157,7 +157,7 @@ async fn standard_boot_e2e() {
"--manifest-approvals-dir",
&*boot_dir,
"--pcr3-preimage-path",
"./mock/namespaces/pcr3-preimage.txt",
PCR3_PRE_IMAGE_PATH,
"--pivot-hash-path",
PIVOT_HASH_PATH,
"--qos-release-dir",
Expand Down Expand Up @@ -361,7 +361,7 @@ async fn standard_boot_e2e() {
"--manifest-envelope-path",
&manifest_envelope_path,
"--pcr3-preimage-path",
"./mock/namespaces/pcr3-preimage.txt",
PCR3_PRE_IMAGE_PATH,
"--manifest-set-dir",
"./mock/keys/manifest-set",
"--alias",
Expand Down
4 changes: 2 additions & 2 deletions src/integration/tests/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
};

use borsh::de::BorshDeserialize;
use integration::{LOCAL_HOST, QOS_DIST_DIR};
use integration::{LOCAL_HOST, PCR3_PRE_IMAGE_PATH, QOS_DIST_DIR};
use qos_core::protocol::services::genesis::GenesisOutput;
use qos_crypto::{sha_512, shamir::shares_reconstruct};
use qos_nsm::nitro::unsafe_attestation_doc_from_der;
Expand Down Expand Up @@ -153,7 +153,7 @@ async fn genesis_e2e() {
"--qos-release-dir",
QOS_DIST_DIR,
"--pcr3-preimage-path",
"./mock/pcr3-preimage.txt",
PCR3_PRE_IMAGE_PATH,
"--dr-key-path",
DR_KEY_PUBLIC_PATH,
"--unsafe-skip-attestation"
Expand Down
10 changes: 5 additions & 5 deletions src/integration/tests/key.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{fs, process::Command};

use integration::{LOCAL_HOST, PIVOT_LOOP_PATH, QOS_DIST_DIR};
use integration::{LOCAL_HOST, PCR3_PRE_IMAGE_PATH, PIVOT_LOOP_PATH, QOS_DIST_DIR};
use qos_crypto::sha_256;
use qos_p256::{P256Pair, P256Public};
use qos_test_primitives::{ChildWrapper, PathWrapper};
Expand Down Expand Up @@ -158,7 +158,7 @@ fn generate_manifest_envelope() {
"--restart-policy",
"always",
"--pcr3-preimage-path",
"./mock/namespaces/pcr3-preimage.txt",
PCR3_PRE_IMAGE_PATH,
"--pivot-hash-path",
PIVOT_HASH_PATH,
"--qos-release-dir",
Expand Down Expand Up @@ -196,7 +196,7 @@ fn generate_manifest_envelope() {
"--manifest-approvals-dir",
BOOT_DIR,
"--pcr3-preimage-path",
"./mock/namespaces/pcr3-preimage.txt",
PCR3_PRE_IMAGE_PATH,
"--pivot-hash-path",
PIVOT_HASH_PATH,
"--qos-release-dir",
Expand Down Expand Up @@ -293,7 +293,7 @@ fn boot_old_enclave(old_host_port: u16) -> (ChildWrapper, ChildWrapper) {
"--host-ip",
LOCAL_HOST,
"--pcr3-preimage-path",
"./mock/namespaces/pcr3-preimage.txt",
PCR3_PRE_IMAGE_PATH,
"--unsafe-skip-attestation",
])
.spawn()
Expand Down Expand Up @@ -343,7 +343,7 @@ fn boot_old_enclave(old_host_port: u16) -> (ChildWrapper, ChildWrapper) {
"--manifest-envelope-path",
MANIFEST_ENVELOPE_PATH,
"--pcr3-preimage-path",
"./mock/namespaces/pcr3-preimage.txt",
PCR3_PRE_IMAGE_PATH,
"--manifest-set-dir",
"./mock/keys/manifest-set",
"--alias",
Expand Down
4 changes: 2 additions & 2 deletions src/qos_client/src/cli/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1673,12 +1673,12 @@ pub(crate) fn dangerous_dev_boot<P: AsRef<Path>>(
assert!(matches!(
resp1,
ProtocolMsg::ProvisionResponse { reconstructed: false }
));
), "{:?}", resp1);

// Post the second share; expected to reconstruct.
let req2 = ProtocolMsg::ProvisionRequest {
share: eph_pub
.encrypt(&shares[0])
.encrypt(&shares[1])
.expect("Failed to encrypt share to eph key."),
approval,
};
Expand Down

0 comments on commit bb9ac56

Please sign in to comment.