Add missing CLI Neutron tests
This adds:
* lb-healthmonitor-list
* lb-member-list
* lb-pool-list
* lb-vip-list
Change-Id: I08ec42e00d6c99e92d38e997712d5ccb33432dd6
diff --git a/tempest/cli/__init__.py b/tempest/cli/__init__.py
index a4c8316..38a06fa 100644
--- a/tempest/cli/__init__.py
+++ b/tempest/cli/__init__.py
@@ -128,7 +128,8 @@
if not fail_ok and proc.returncode != 0:
raise CommandFailed(proc.returncode,
cmd,
- result)
+ result,
+ stderr=result_err)
finally:
LOG.debug('output of %s:\n%s' % (cmd_str, result))
if not merge_stderr and result_err:
@@ -149,6 +150,7 @@
class CommandFailed(subprocess.CalledProcessError):
# adds output attribute for python2.6
- def __init__(self, returncode, cmd, output):
+ def __init__(self, returncode, cmd, output, stderr=""):
super(CommandFailed, self).__init__(returncode, cmd)
self.output = output
+ self.stderr = stderr
diff --git a/tempest/cli/simple_read_only/test_neutron.py b/tempest/cli/simple_read_only/test_neutron.py
index 9bd07d0..047b17d 100644
--- a/tempest/cli/simple_read_only/test_neutron.py
+++ b/tempest/cli/simple_read_only/test_neutron.py
@@ -76,6 +76,25 @@
def test_neutron_meter_label_rule_list(self):
self.neutron('meter-label-rule-list')
+ def _test_neutron_lbaas_command(self, command):
+ try:
+ self.neutron(command)
+ except tempest.cli.CommandFailed as e:
+ if '404 Not Found' not in e.stderr:
+ self.fail('%s: Unexpected failure.' % command)
+
+ def test_neutron_lb_healthmonitor_list(self):
+ self._test_neutron_lbaas_command('lb-healthmonitor-list')
+
+ def test_neutron_lb_member_list(self):
+ self._test_neutron_lbaas_command('lb-member-list')
+
+ def test_neutron_lb_pool_list(self):
+ self._test_neutron_lbaas_command('lb-pool-list')
+
+ def test_neutron_lb_vip_list(self):
+ self._test_neutron_lbaas_command('lb-vip-list')
+
def test_neutron_net_external_list(self):
self.neutron('net-external-list')