Make test_revoke_cert_project_not_found_chdir_fails deterministic
Commit b64cebe2eb71a6c2275f6af76839a0b36cf56cbd removed the mock on
os.chdir to always fail with OSError in the test.
The revoke_cert method is using the ca_folder method to get the path and
that checks CONF.use_project_ca which is by default False, so the
project_id isn't even used in the path we're changing to before running
the command, it just uses the global static CONF.ca_path. If that path
exists when this test runs, os.chdir won't raise OSError and the
assertion in the test will fail.
This change makes the test deterministic by (1) setting
use_project_ca=True and (2) using a random project_id uuid.
Reviewed: https:/ /review. openstack. org/223203 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=f8f822afafb c58258bfe0653b2 1be86a5e648305
Committed: https:/
Submitter: Jenkins
Branch: master
commit f8f822afafbc582 58bfe0653b21be8 6a5e648305
Author: Matt Riedemann <email address hidden>
Date: Mon Sep 14 09:04:51 2015 -0700
Make test_revoke_ cert_project_ not_found_ chdir_fails deterministic
Commit b64cebe2eb71a6c 2275f6af76839a0 b36cf56cbd removed the mock on
os.chdir to always fail with OSError in the test.
The revoke_cert method is using the ca_folder method to get the path and
that checks CONF.use_project_ca which is by default False, so the
project_id isn't even used in the path we're changing to before running
the command, it just uses the global static CONF.ca_path. If that path
exists when this test runs, os.chdir won't raise OSError and the
assertion in the test will fail.
This change makes the test deterministic by (1) setting project_ ca=True and (2) using a random project_id uuid.
use_
Closes-Bug: #1495547
Change-Id: I0dc6574b6644aa 09028a07503a3d0 b82e68e69d2