Subunit Describe Calls Utility cmd does not print request and response data

Bug #1749238 reported by Doug Schveninger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Wishlist
Doug Schveninger

Bug Description

I am doing a bug since it is a quick way to talk about this minor change to Subunit Describe Calls Utility.

We would like to add a verbose switch to the command to list out the request headers and body and the response headers and body. This will list out the request and response data for a test run if the -v or --verbose switch is given.

This change would require the following changes if the core and PTL agree I will make the following changes
1) tempest/cmd/subunit_describe_calls.py
1.1) Support new args in ArgumentParser
1.2) Update output method to give request and response headers and body below the status, verb, service and url if the -v or --verbose switch is given
2) update the temepst/tests/cmd/test_subunit_describe_calls.py
3) update doc/subunit_describe_calls.rst with new optional switch

Thank you for your consideration on this issue

Changed in tempest:
assignee: nobody → Doug Schveninger (ds6901)
Masayuki Igawa (igawa)
Changed in tempest:
status: New → Incomplete
Revision history for this message
Masayuki Igawa (igawa) wrote :

Thanks for the report.

I'd like to clarify the information what you want to get.
Do you have a concrete example for this?

Because subunit-describe-calls command should print like that information regarding to this document https://docs.openstack.org/tempest/latest/subunit_describe_calls.html

So, if this is what you want, I think it's just a bug, we don't need to add a new option.

Revision history for this message
Doug Schveninger (ds6901) wrote :

The verbose option would only be for the stdout output since the output-file already has the whole data structure in it. We use the --output-file option for automated processing and this option is for a person that is reviewing the run using stdout. Most of the time this is for the first time run of a new test since it is multi-line and easier to read then the logs.

Here is an example:

tempest.api.object_storage.test_container_services.ContainerTest.test_update_container_metadata_with_delete_metadata_key[id-a2e36378-6f1f-43f4-840a-ffd9cfd61914]
 - 201 PUT request for Swift to v1/AUTH_<id>/tempest-TestContainer-799129158
  - request headers: {'X-Container-Meta-test-container-meta1': 'Meta1', 'X-Auth-Token': '<omitted>'}
  - request body: None
  - response headers: {'status': '201', u'content-length': '0', 'content-location': 'http://object-store-aic.mtn15.cci.att.com:8080/v1/AUTH_fdb6df8742b64ead98cd1321f3457b91/tempest-TestContainer-799129158', u'x-trans-id': 'txcfbdf39b7bdb4c79add03-005a81a629', u'date': 'Mon, 12 Feb 2018 14:35:23 GMT', u'content-type': 'text/html; charset=UTF-8', u'connection': 'close'}
  - response body:
 - 204 POST request for Swift to v1/AUTH_<id>/tempest-TestContainer-799129158
  - request headers: {'X-Remove-Container-Meta-test-container-meta1': '', 'X-Auth-Token': '<omitted>'}
  - request body: None
  - response headers: {'status': '204', u'content-length': '0', 'content-location': 'http://object-store-aic.mtn15.cci.att.com:8080/v1/AUTH_fdb6df8742b64ead98cd1321f3457b91/tempest-TestContainer-799129158', u'x-trans-id': 'tx8ffa1eb465aa457b93d02-005a81a62b', u'date': 'Mon, 12 Feb 2018 14:35:24 GMT', u'content-type': 'text/html; charset=UTF-8', u'connection': 'close'}
  - response body:
 - 204 HEAD request for Swift to v1/AUTH_<id>/tempest-TestContainer-799129158
  - request headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
  - request body: None
  - response headers: {'status': '204', u'content-length': '0', u'x-container-object-count': '0', 'content-location': 'http://object-store-aic.mtn15.cci.att.com:8080/v1/AUTH_fdb6df8742b64ead98cd1321f3457b91/tempest-TestContainer-799129158', u'accept-ranges': 'bytes', u'x-storage-policy': 'Policy-0', u'x-container-bytes-used': '0', u'connection': 'close', u'x-timestamp': '1518446122.71803', u'x-trans-id': 'txa4d35e272d1a4542ad97a-005a81a62c', u'date': 'Mon, 12 Feb 2018 14:35:24 GMT', u'content-type': 'application/json; charset=utf-8'}
  - response body:

Masayuki Igawa (igawa)
Changed in tempest:
importance: Undecided → Wishlist
status: Incomplete → Confirmed
status: Confirmed → Triaged
Revision history for this message
Masayuki Igawa (igawa) wrote :

Thanks for the comment!

Well, OK, I got it (probably). Currently, the output isn't included request and response data what you want with --verbose option.
https://github.com/openstack/tempest/blob/master/tempest/cmd/subunit_describe_calls.py#L302

Am I correct? If so, it makes sense to me.
I think it's not so critical and "Wishlist" is fit for this issue.
If you have any opinion, please let us know.

And, we may need to think about the behavior when we're specifying both --output-file and --verbose options at the same time. I think options are

 Option 1. Just ignore the --verbose option
 Option 2. Cause an error

I suppose option.1 is an easy way to implement but if you have any opinion or any other ideas, feel free to push a patch as you like :) It might be good to discuss through a concrete implementation.

Revision history for this message
Doug Schveninger (ds6901) wrote :

I agree with the importance and Option 1 when --verbose and --output-file.

Thank you for the feedback and quick turn around.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/545839

Changed in tempest:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/545839
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=8b3dc8619b8d43110869410ba8dcd27513c36f3d
Submitter: Zuul
Branch: master

commit 8b3dc8619b8d43110869410ba8dcd27513c36f3d
Author: Doug Schveninger <email address hidden>
Date: Fri Feb 16 21:42:27 2018 -0600

    Add verbose option for stdout in subunit_describe_call

    The PS will allow request and response header and
    body data to be printed to stdout when the -v or
    --verbose switch is given.

    Change-Id: Ibc3ac0ee717e6f71e74fd5970877a7eda89be3a7
    Closes-bug: #1749238

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 19.0.0

This issue was fixed in the openstack/tempest 19.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.