Skip to content

Commit

Permalink
tests: simulate RA if SGX_MODE=SW
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
  • Loading branch information
bluele committed Jun 7, 2023
1 parent 96949f1 commit 0e22bce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ test:

.PHONY: integration-test
integration-test: $(Signed_RustEnclave_Name) bin/gaiad
@PATH=${PATH}:$(CURDIR)/bin cargo test $(CARGO_TARGET) --package integration-test
@PATH=${PATH}:$(CURDIR)/bin cargo test $(CARGO_TARGET) --package integration-test $(CARGO_FEATURES)

.PHONY: test-nodes
test-setup-nodes: bin/gaiad
Expand Down
12 changes: 11 additions & 1 deletion tests/integration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod tests {
use anyhow::{anyhow, bail};
use ecall_commands::{
CommitmentProofPair, IASRemoteAttestationInput, InitClientInput, InitEnclaveInput,
UpdateClientInput, VerifyMembershipInput,
SimulateRemoteAttestationInput, UpdateClientInput, VerifyMembershipInput,
};
use enclave_api::{Enclave, EnclaveCommandAPI};
use host_environment::Environment;
Expand Down Expand Up @@ -114,6 +114,16 @@ mod tests {
bail!("IAS Remote Attestation Failed {:?}!", e);
}
};
} else {
let _ = match enclave.simulate_remote_attestation(SimulateRemoteAttestationInput {
advisory_ids: vec![],
isv_enclave_quote_status: "OK".to_string(),
}) {
Ok(res) => res.avr,
Err(e) => {
bail!("Simulate Remote Attestation Failed {:?}!", e);
}
};
}

// XXX use non-latest height here
Expand Down

0 comments on commit 0e22bce

Please sign in to comment.