Implement mock mode for early end-to-end testing (Issue #23) #54
+186
−247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements Issue #23 - Mock Mode for Early End-to-End Testing, enabling RATSD to serve pre-defined evidence without requiring real attesters or hardware.
Features Implemented
CLI Mock Mode Interface
Mock Evidence File Format
{ "attesters": { "attester-name": { "content_type": "application/vnd.veraison.content-type", "evidence": "base64-encoded-evidence-data" } } }Files Added/Modified
New Files
api/server_mock_test.go- Comprehensive test suiteexamples/mock/simple-mock-tsm.json- Single TSM attester exampleexamples/mock/multi-attester-evidence.json- Multiple attesters exampleexamples/mock/arm-cca-evidence.json- ARM CCA exampleexamples/mock/simple-evidence.json- Basic evidence exampleModified Files
cmd/main.go- Added mock mode CLI parsing and server initializationapi/server.go- Implemented NewMockServer() and mock evidence handlersREADME.md- Complete documentation with examples and usagego.mod/go.sum- Updated dependenciesTesting