summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2018-08-01 11:25:28 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2018-08-01 11:25:28 +0800
commit9bc09d1d18d4777438515393a9427fc0733e6f09 (patch)
tree33a4643dc66283eec7aa823c1d9806328349b1ac
parente70bf248daac03eee6b449cd1654d2ee6265dd8c (diff)
add ssh_keyfile for connect to installer in Apex
Change-Id: I8809a24e75c0260f67d3e128b8bbd1becf924529 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
-rw-r--r--doctor_tests/installer/__init__.py4
-rw-r--r--doctor_tests/installer/apex.py1
-rw-r--r--doctor_tests/installer/mcp.py3
-rw-r--r--tox.ini1
4 files changed, 8 insertions, 1 deletions
diff --git a/doctor_tests/installer/__init__.py b/doctor_tests/installer/__init__.py
index 31fce754..ee44018c 100644
--- a/doctor_tests/installer/__init__.py
+++ b/doctor_tests/installer/__init__.py
@@ -24,6 +24,10 @@ OPTS = [
default='root',
help='the user name for login installer server',
required=True),
+ cfg.StrOpt('key_file',
+ default=os.environ.get('SSH_KEY', None),
+ help='the key for user to login installer server',
+ required=False),
]
diff --git a/doctor_tests/installer/apex.py b/doctor_tests/installer/apex.py
index 1ce3eb65..c851b2ac 100644
--- a/doctor_tests/installer/apex.py
+++ b/doctor_tests/installer/apex.py
@@ -19,6 +19,7 @@ class ApexInstaller(BaseInstaller):
super(ApexInstaller, self).__init__(conf, log)
self.client = SSHClient(self.conf.installer.ip,
self.conf.installer.username,
+ key_filename=self.conf.installer.key_file,
look_for_keys=True)
self.key_file = None
self.controllers = list()
diff --git a/doctor_tests/installer/mcp.py b/doctor_tests/installer/mcp.py
index 8ba9f000..e7e41dbe 100644
--- a/doctor_tests/installer/mcp.py
+++ b/doctor_tests/installer/mcp.py
@@ -22,7 +22,8 @@ class McpInstaller(BaseInstaller):
self.key_file = self.get_ssh_key_from_installer()
self.client = SSHClient(self.conf.installer.ip,
self.node_user_name,
- key_filename=self.key_file)
+ key_filename=self.key_file,
+ look_for_keys=True)
self.controllers = list()
self.controller_clients = list()
diff --git a/tox.ini b/tox.ini
index 6a873899..832a1dae 100644
--- a/tox.ini
+++ b/tox.ini
@@ -30,6 +30,7 @@ passenv =
INSTALLER_IP
INSPECTOR_TYPE
TEST_CASE
+ SSH_KEY
changedir = {toxinidir}/doctor_tests
commands = doctor-test