Replace "assert type(...) is Foo" with "self.assertIsInstance(..., Foo)"
this produces a more meaningful test error message and fixes pep8 rule
E721[0]
[0] https://www.flake8rules.com/rules/E721.html
The existing order of operations after restarting the share is:
1. mount share on ins-1
2. validate the test file on ins-1
3. mount share on ins-2
4. clear the test file using 'rm' on ins-1
5. write the test file on ins-1
6. read the test file on ins-2
The issue is that step 4. can result in a stale file handle on ins-2
which takes an unspecified amount of time to clear. Mounting the share
on ins-2 after the file is re-written does however work without a stale
file handle. The new order is:
1. mount share on ins-1
2. validate the test file on ins-1
3. clear the test file using 'rm' on ins-1
4. write the test file on ins-1
5. mount share on ins-2
6. read the test file on ins-2
Closes-Bug: #1107
When running the pool setup we test after the model is idle, but that
is not a guarantee that all pools have finished setup, so that the test
could race the pool creation.
Add retry to the test to give the system another chance to complete
pool creation
This test launches 1 instance per hypervisor, and then launches a new
audit to optimize the use of hypervisors and consolidate the instances
in a single hypervisor, but also disabling the nova-compute service to
avoid new instances get allocated.
The stop_status parameter allows callers to ask stop retrying based on a
list of statuses that are known to be final (and error) states, this
saves time failing earlier.
Usage example for fail early when an instance reaches to ERROR status:
openstack_utils.resource_reaches_status(self.nova_client.servers,
instance_uuid,
resource_attribute='state',
expected_status='ACTIVE',
stop_status='ERROR')
This change exposes two new parameters in the launch_instance()
function:
- nova_api_version: Set the microversion the novaclient should use.
- host: Request to launch the instance on a specific hypervisor host.
This allows callers to pass None and let get_nova_session_client() to
use a sane default API, specifically this allows intermediate users
(e.g. launch_guest() ) to proxy values passed by the caller.
Add get_watcher_session_client() helper function to build a
watcherclient.v1.Client instance authenticated with a keystone session
that uses admin credentials by default.
Convert images to raw if ceph image backend
We are currently uploading qcow2 images, and
Nova is converting them to raw when running
the tests, sometimes timing out the tests.
With this change we are pre-converting the
images and uploading them as raw, so Nova
does not have to convert them.
This patch ensures kerberos setup does not create duplicate
domains, projects, or users. Duplicate domains were seen to
be caused when the tenacity decorator ran the function multiple
times.
Fixes#1094
Fix below pep8 error message
zaza/openstack/charm_tests/ceilometer/tests.py:129:16: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinst
ance()`
Due to the race condition described in LP: #2024481, before adding
networks to the speaker we need to wait until it gets scheduled,
otherwise it may not advertise some routes that are attempted to be
advertised before the speaker is scheduled to a dragent service causing
a non-fatal service error.