Subunit Describe Calls Utility

subunit-describe-calls is a parser for subunit streams to determine what REST API calls are made inside of a test and in what order they are called.

Runtime Arguments

  • --subunit, -s: (Optional) The path to the subunit file being parsed, defaults to stdin

  • --non-subunit-name, -n: (Optional) The file_name that the logs are being stored in

  • --output-file, -o: (Optional) The path where the JSON output will be written to. This contains more information than is present in stdout.

  • --ports, -p: (Optional) The path to a JSON file describing the ports being used by different services

  • --verbose, -v: (Optional) Print Request and Response Headers and Body data to stdout in the non cliff deprecated CLI

  • --all-stdout, -a: (Optional) Print Request and Response Headers and Body data to stdout

Usage

subunit-describe-calls will take in either stdin subunit v1 or v2 stream or a file path which contains either a subunit v1 or v2 stream passed via the --subunit parameter. This is then parsed checking for details contained in the file_bytes of the --non-subunit-name parameter (the default is pythonlogging which is what Tempest uses to store logs). By default the OpenStack default ports are used unless a file is provided via the --ports option. The resulting output is dumped in JSON output to the path provided in the --output-file option.

Ports file JSON structure

{
    "<port number>": "<name of service>",
    ...
}

Output file JSON structure

{
    "full_test_name[with_id_and_tags]": [
        {
            "name": "The ClassName.MethodName that made the call",
            "verb": "HTTP Verb",
            "service": "Name of the service",
            "url": "A shortened version of the URL called",
            "status_code": "The status code of the response",
            "request_headers": "The headers of the request",
            "request_body": "The body of the request",
            "response_headers": "The headers of the response",
            "response_body": "The body of the response"
        }
    ]
}