From f91ed2ec681fd83e5aac9a9fa1c45b7ce4112f06 Mon Sep 17 00:00:00 2001 From: "Ian H. Pittwood" Date: Thu, 22 Aug 2019 10:56:14 -0500 Subject: [PATCH] Update treasuremap revision for tests Pegleg has been using a year old revision of treasuremap for internal testing using seaworthy. The age of this revision has become a problem as the certificates in seaworthy expired on August 20th. This change updates pegleg to the latest version of treasuremap and makes any necessary path updates for the new version to work with Pegleg tests. Change-Id: Icea70b8d9bf24c8f85360719945b5899cab6b396 --- tests/unit/engine/test_secrets.py | 3 ++- tests/unit/test_cli.py | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/unit/engine/test_secrets.py b/tests/unit/engine/test_secrets.py index 69573c8e..69f347a4 100644 --- a/tests/unit/engine/test_secrets.py +++ b/tests/unit/engine/test_secrets.py @@ -363,7 +363,8 @@ def test_check_expiry(temp_deployment_files): cert_info = pki_util.check_expiry(cert) assert cert_info['expired'] is False, \ "%s is expired/expiring on %s" % \ - (generated_file.name, cert_info['expiry_date']) + (result['metadata']['name'], + cert_info['expiry_date']) @mock.patch.dict( diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index ef20d5e8..a124d477 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -26,9 +26,9 @@ from pegleg.engine.util import git from tests.unit import test_utils TEST_PARAMS = { - "site_name": "airship-seaworthy", + "site_name": "seaworthy", "site_type": "foundry", - "repo_rev": '6b183e148b9bb7ba6f75c98dd13451088255c60b', + "repo_rev": '33bdd46754b7acabb2cbc2f4b335d34ecb80d4ce', "repo_name": "treasuremap", "repo_url": "https://opendev.org/airship/treasuremap.git", } @@ -67,7 +67,7 @@ class BaseCLIActionTest(object): def setup_class(cls): cls.runner = CliRunner() - # Pin so we know that airship-seaworthy is a valid site. + # Pin so we know that seaworthy is a valid site. cls.site_name = TEST_PARAMS["site_name"] cls.site_type = TEST_PARAMS["site_type"] @@ -551,7 +551,7 @@ class TestSiteSecretsActions(BaseCLIActionTest): repo_path = self.treasuremap_path file_path = os.path.join( - repo_path, "site", "airship-seaworthy", "secrets", "passphrases", + repo_path, "site", "seaworthy", "secrets", "passphrases", "ceph_fsid.yaml") with open(file_path, "r") as ceph_fsid_fi: ceph_fsid = yaml.safe_load(ceph_fsid_fi) @@ -566,7 +566,7 @@ class TestSiteSecretsActions(BaseCLIActionTest): assert result.exit_code == 0 - with open(os.path.join(repo_path, "site", "airship-seaworthy", + with open(os.path.join(repo_path, "site", "seaworthy", "secrets", "passphrases", "ceph_fsid.yaml"), "r") \ as ceph_fsid_fi: @@ -602,7 +602,7 @@ class TestSiteSecretsActions(BaseCLIActionTest): repo_path = self.treasuremap_path file_dir = os.path.join( - repo_path, "site", "airship-seaworthy", "secrets", "certificates") + repo_path, "site", "seaworthy", "secrets", "certificates") file_path = os.path.join(file_dir, "test.crt") output_path = os.path.join(file_dir, "test.yaml")