hyperledger-archives / aries-protocol-test-suite

Test Suite for testing protocol compliance of Aries Agents
https://wiki.hyperledger.org/display/aries
Apache License 2.0
25 stars 19 forks source link

Interop profile generation #12

Closed dbluhm closed 5 years ago

dbluhm commented 5 years ago

Added support for creating interop profiles as defined in the test suite RFC. Sample output from the test suite:

...
Received Response (post signature verification):
 {
  "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/response",
  "~thread": {
    "thid": "d333344f-4109-4307-98c1-be8f04024ceb",
    "sender_order": 0
  },
  "@id": "d8f4bc60-1363-4020-819f-a19f52772681",
  "connection": {
    "DID": "AWyQBgdZusu8Y3jGbmH3ma",
    "DIDDoc": {
      "@context": "https://w3id.org/did/v1",
      "id": "AWyQBgdZusu8Y3jGbmH3ma",
      "publicKey": [
        {
          "id": "AWyQBgdZusu8Y3jGbmH3ma#keys-1",
          "type": "Ed25519VerificationKey2018",
          "controller": "AWyQBgdZusu8Y3jGbmH3ma",
          "publicKeyBase58": "6BqwHiKP4sAJRSPF6T8u7PFQYyKWiYQEbFerRVvqCoXz"
        }
      ],
      "service": [
        {
          "id": "AWyQBgdZusu8Y3jGbmH3ma;indy",
          "type": "IndyAgent",
          "recipientKeys": [
            "6BqwHiKP4sAJRSPF6T8u7PFQYyKWiYQEbFerRVvqCoXz"
          ],
          "routingKeys": [],
          "serviceEndpoint": "http://localhost:3001"
        }
      ]
    }
  }
}

protocol_tests/connection/test_manual.py::test_connection_started_by_tested_agent PASSED

==== Interop Profile ====

{
  "@type": "Aries Test Suite Interop Profile v1",
  "suite_version": "0.1.0",
  "under_test_name": "",
  "under_test_version": "",
  "test_time": "2019-11-06T20:36:46",
  "results": [
    {
      "name": "connections,1.0,inviter,can-start",
      "description": "Test a connection as started by the agent under test.",
      "pass": true,
      "info": null,
      "warnings": []
    }
  ]
}
==== 1 passed, 2 deselected in 10.81 seconds ====
dhh1128 commented 5 years ago

I wouldn't output the info or warnings fields unless they contain data--but that's just a stylistic detail. Full speed ahead. Thanks for doing this.

dbluhm commented 5 years ago

Filtering out the empty stuff; not too exciting but wanted to get that taken care of as it was a simple enough fix:

{
  "@type": "Aries Test Suite Interop Profile v1",
  "suite_version": "0.1.0",
  "under_test_name": "",
  "under_test_version": "",
  "test_time": "2019-11-06T20:58:11",
  "results": [
    {
      "name": "connections,1.0,inviter,can-start",
      "description": "Test a connection as started by the agent under test.",
      "pass": true
    }
  ]
}
dbluhm commented 5 years ago

Sorry, it seems I prematurely asked for review. Got too excited lol. I'll leave this PR alone now.