[openstack-dev] [qa] Checking for return codes in tempest client calls
David Kranz
dkranz at redhat.com
Wed May 7 13:53:23 UTC 2014
I just looked at a patch https://review.openstack.org/#/c/90310/3 which
was given a -1 due to not checking that every call to list_hosts returns
200. I realized that we don't have a shared understanding or policy
about this. We need to make sure that each api is tested to return the
right response, but many tests need to call multiple apis in support of
the one they are actually testing. It seems silly to have the caller
check the response of every api call. Currently there are many, if not
the majority of, cases where api calls are made without checking the
response code. I see a few possibilities:
1. Move all response code checking to the tempest clients. They are
already checking for failure codes and are now doing validation of json
response and headers as well. Callers would only do an explicit check if
there were multiple success codes possible.
2. Have a clear policy of when callers should check response codes and
apply it.
I think the first approach has a lot of advantages. Thoughts?
-David
More information about the OpenStack-dev
mailing list