diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample index 13a5e4e2b5..4f433a6438 100644 --- a/etc/tempest.conf.sample +++ b/etc/tempest.conf.sample @@ -365,6 +365,8 @@ large_ops_number = 0 enabled = True # directory where python client binaries are located cli_dir = /usr/local/bin +# Number of seconds to wait on a CLI timeout +timeout = 15 [service_available] # Whether or not cinder is expected to be available diff --git a/tempest/cli/__init__.py b/tempest/cli/__init__.py index 00e025d64c..f04d23f38e 100644 --- a/tempest/cli/__init__.py +++ b/tempest/cli/__init__.py @@ -35,6 +35,9 @@ cli_opts = [ cfg.StrOpt('cli_dir', default='/usr/local/bin/', help="directory where python client binaries are located"), + cfg.IntOpt('timeout', + default=15, + help="Number of seconds to wait on a CLI timeout"), ] CONF = cfg.CONF diff --git a/tempest/cli/simple_read_only/test_compute.py b/tempest/cli/simple_read_only/test_compute.py index e60e2380d4..4c7f604111 100644 --- a/tempest/cli/simple_read_only/test_compute.py +++ b/tempest/cli/simple_read_only/test_compute.py @@ -176,7 +176,7 @@ class SimpleReadOnlyNovaClientTest(tempest.cli.ClientTestBase): self.nova('list', flags='--debug') def test_admin_timeout(self): - self.nova('list', flags='--timeout 2') + self.nova('list', flags='--timeout %d' % CONF.cli.timeout) def test_admin_timing(self): self.nova('list', flags='--timing') diff --git a/tempest/cli/simple_read_only/test_keystone.py b/tempest/cli/simple_read_only/test_keystone.py index 4002081239..4c7982b9e6 100644 --- a/tempest/cli/simple_read_only/test_keystone.py +++ b/tempest/cli/simple_read_only/test_keystone.py @@ -18,9 +18,13 @@ import re import subprocess +from oslo.config import cfg + import tempest.cli from tempest.openstack.common import log as logging +CONF = cfg.CONF + LOG = logging.getLogger(__name__) @@ -117,4 +121,4 @@ class SimpleReadOnlyKeystoneClientTest(tempest.cli.ClientTestBase): self.keystone('catalog', flags='--debug') def test_admin_timeout(self): - self.keystone('catalog', flags='--timeout 15') + self.keystone('catalog', flags='--timeout %d' % CONF.cli.timeout)