Merge "bugfix: kill the stunnel when cleanup"
authorTomi Juvonen <tomi.juvonen@nokia.com>
Thu, 9 Aug 2018 08:53:35 +0000 (08:53 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Thu, 9 Aug 2018 08:53:35 +0000 (08:53 +0000)
docs/development/overview/testing.rst
doctor_tests/installer/__init__.py
doctor_tests/installer/apex.py
doctor_tests/installer/mcp.py
tox.ini

index 98be43e..ba0546e 100644 (file)
@@ -29,6 +29,18 @@ OpenStack services.
 
 .. _OpenStackClient Configuration: https://docs.openstack.org/python-openstackclient/latest/configuration/index.html
 
+Doctor now supports different test cases and for that you might want to
+export TEST_CASE with different values:
+
+.. code-block:: bash
+
+    #Fault management (default)
+    export TEST_CASE='fault_management'
+    #Maintenance (requires 3 compute nodes)
+    export TEST_CASE='maintenance'
+    #Run both tests cases
+    export TEST_CASE='all'
+
 Run Python Test Script
 ~~~~~~~~~~~~~~~~~~~~~~
 
@@ -45,6 +57,18 @@ environment and then run the test.
 
 .. _doctor.sample.conf: https://git.opnfv.org/doctor/tree/etc/doctor.sample.conf
 
+In OPNFV Apex jumphost you can run Doctor testing as follows using tox:
+
+.. code-block:: bash
+
+    #Before Gambia: overcloudrc.v3
+    source overcloudrc
+    export INSTALLER_IP=${INSTALLER_IP}
+    export INSTALLER_TYPE=${INSTALLER_TYPE}
+    git clone https://gerrit.opnfv.org/gerrit/doctor
+    cd doctor
+    sudo -E tox
+
 Run Functest Suite
 ==================
 
index 31fce75..ee44018 100644 (file)
@@ -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),
 ]
 
 
index 1ce3eb6..c851b2a 100644 (file)
@@ -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()
index 8ba9f00..e7e41db 100644 (file)
@@ -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 6a87389..832a1da 100644 (file)
--- 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