Only sleep following a role switch
This commit drops support for not sleeping if the token being
used for keystone auth is UUID, as it is being deprecated
during the "R" release [0]. Thus, the condition for sleeping
has completely changed: Now, time.sleep(1) is only carried
out if the role actually switched (causing a token revocation
event in keystone and hence the need to sleep).
For example, if rbac_test_role = "admin" then there is no need
to sleep (except once, at the beginning, which strips the user
of any additional roles) as setup, API execution and clean up
all require admin. If rbac_test_role = "Member" then sleep
must be carried out each test at least twice, as setup requires
admin, API execution requires Member, and clean up requires
admin.
This commit also adds unit tests to confirm that sleep is
only performed if the role switched. This required
changes to some testing logic.
[0] http://lists.openstack.org/pipermail/openstack-dev/2017-August/121067.html
Change-Id: Iedc97397d9ae76c7f5efed5913850ced470c6c5f
Closes-Bug: #1710237
Depends-On: I34d324575c8117022724a944c034f089eb0c7541
3 files changed