summaryrefslogtreecommitdiffstats
path: root/scripts/jira
diff options
context:
space:
mode:
authorDaniel Smith <daniel.smith@qt.io>2019-12-02 14:16:46 +0100
committerDaniel Smith <daniel.smith@qt.io>2019-12-03 10:32:42 +0100
commitad49cac05921b168867f9325041a63c23aee5531 (patch)
treea7fdf774d39f7b3f66043948607a61b3468b4b0b /scripts/jira
parent66e959fcdebb742172aed3d02cf7a1f10dcaa4f5 (diff)
Update ssh config to point to the correct certificate location
Also add a test to verify secrets exist and are not default values to avoid silent authentication failures. Change-Id: I30287bfb683d110efc9dc25087d0acd2324190c3 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'scripts/jira')
-rw-r--r--scripts/jira/jira-bug-closer/_ssh_config2
-rw-r--r--scripts/jira/jira-bug-closer/tests/test_gitlog.py14
2 files changed, 15 insertions, 1 deletions
diff --git a/scripts/jira/jira-bug-closer/_ssh_config b/scripts/jira/jira-bug-closer/_ssh_config
index df1ae8c5..26452a24 100644
--- a/scripts/jira/jira-bug-closer/_ssh_config
+++ b/scripts/jira/jira-bug-closer/_ssh_config
@@ -3,4 +3,4 @@ Host codereview.qt-project.org
ServerAliveInterval 240
Ciphers +aes256-cbc
User qt_ci_bot
- IdentityFile ~/jira-bug-closer/jira_gerrit_bot_id_rsa
+ IdentityFile ~/qtqa/scripts/jira/jira-bug-closer/jira_gerrit_bot_id_rsa
diff --git a/scripts/jira/jira-bug-closer/tests/test_gitlog.py b/scripts/jira/jira-bug-closer/tests/test_gitlog.py
index 485f300a..8850934c 100644
--- a/scripts/jira/jira-bug-closer/tests/test_gitlog.py
+++ b/scripts/jira/jira-bug-closer/tests/test_gitlog.py
@@ -29,10 +29,12 @@
import asyncio
import pytest
+import os
from typing import List
from git import Repository, ChangeRange, FixedByTag
from logger import get_logger
from git.repository import Version
+from config import Config
log = get_logger('test')
@@ -208,3 +210,15 @@ def test_version_class(versions: List[Version], sorted_versions: List[Version]):
assert Version("5.12") <= Version("5.12.0")
assert Version("5.12.0") >= Version("5.12")
assert Version("5.12.0") != Version("5.12")
+
+def test_have_secrets():
+ dir_name = os.path.join(os.path.dirname(os.path.abspath(__file__)))
+ assert os.path.exists(os.path.join(dir_name, "../jira_gerrit_bot_id_rsa"))
+
+ config = Config()
+ oauth = config.get_oauth_data("production")
+ assert oauth.access_token != "get_this_by_running_oauth_dance.py"
+ assert oauth.token_secret != "get_this_by_running_oauth_dance.py"
+ assert oauth.key_cert
+ assert os.path.exists(os.path.join(dir_name, "..", f"{oauth.key_cert_file}.pem"))
+ assert os.path.exists(os.path.join(dir_name, "..", f"{oauth.key_cert_file}.pub"))