Skip to content

Commit c384f5a

Browse files
authored
Fix for SNP code_update_test (#6787)
1 parent 786e2a8 commit c384f5a

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.snpcc_canary

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
/-xXx--//-----x=x--/-xXx--/---x---->>>--/
55
...
66
/\/\d(-_-)b/\/\
7-
----vmpl--
7+
----vmpl---

src/node/rpc/node_frontend.h

+1
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,7 @@ namespace ccf
785785
q.raw = node_info.quote_info.quote;
786786
q.endorsements = node_info.quote_info.endorsements;
787787
q.format = node_info.quote_info.format;
788+
q.uvm_endorsements = node_info.quote_info.uvm_endorsements;
788789

789790
// get_measurement attempts to re-validate the quote to extract
790791
// mrenclave and the Open Enclave is insufficiently flexible to

tests/code_update.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ def test_verify_quotes(network, args):
9696
)
9797

9898
# Quick API validation - confirm that all of these /quotes/self entries match the collection returned from /quotes
99-
assert j in all_quotes
99+
assert (
100+
j in all_quotes
101+
), f"Didn't find {node.node_id}'s quote in collection\n{j}\n{json.dumps(all_quotes)}"
100102

101103
return network
102104

@@ -648,6 +650,7 @@ def format_expected_host_data(entries):
648650

649651

650652
@reqs.description("Adding a new measurement invalidates open proposals")
653+
@reqs.not_snp("Cannot produce alternative measurement on SNP")
651654
def test_proposal_invalidation(network, args):
652655
primary, _ = network.find_nodes()
653656

@@ -724,7 +727,8 @@ def run(args):
724727

725728
# Measurements
726729
test_measurements_tables(network, args)
727-
test_add_node_with_untrusted_measurement(network, args)
730+
if not snp.IS_SNP:
731+
test_add_node_with_untrusted_measurement(network, args)
728732

729733
# Host data/security policy
730734
test_host_data_tables(network, args)
@@ -740,10 +744,10 @@ def run(args):
740744
test_endorsements_tables(network, args)
741745
test_add_node_with_no_uvm_endorsements(network, args)
742746

743-
# NB: Assumes the current nodes are still using args.package, so must run before test_update_all_nodes
744-
test_proposal_invalidation(network, args)
745-
746747
if not snp.IS_SNP:
748+
# NB: Assumes the current nodes are still using args.package, so must run before test_update_all_nodes
749+
test_proposal_invalidation(network, args)
750+
747751
# This is in practice equivalent to either "unknown measurement" or "unknown host data", but is explicitly
748752
# testing that (without artifically removing/corrupting those values) a replacement package differs
749753
# in one of these values

0 commit comments

Comments
 (0)