* rename the Redis token 'timestamp' var to 'created'
* update the Redis token 'last' var when token is successfully validataed
* expose the Redis token 'last' var in GET /token route
The return values from most redis calls inform the caller of whether a
key or hash value exists. Several exists() calls can be removed in
favor of this approach.
Updated spec tests to account for a removal of exists() and ismember()
calls in API tests.
Make a note in the logfile when a pool is detected to be empty.
Also:
- vmpooler__empty__<pool> Redis key to determine when to log
- lifetime/TTL checks moved to `_check_running_vm` method
- no longer pay attention to VMware-based 'host.runtime.bootTime'
This PR implements a bunch of other stuff to account for rspec testing:
- Thread creation and looping in `check_pool`
- Everything else in `_check_pool`
Add spec tests for pool_manager#check_running_vm. In the process of
writing these tests, the method was broken in to smaller methods for
testability reasons.
This moves the inline Helpers contained in V1.rb to their own file:
helpers.rb. In making this change, any API.settings call was removed
from the helper method itself and passed through from V1.
This also adds tests for hostname shortener and validate date string.
This commit breaks apart the method check_pending_vm in to three,
smaller methods that are easier to test. There are no functionality
changes or bug fixes.
This adds spec tests for the overall functionality that was
check_pending_vm.