Expand read only cli compute test
* Checks more actions
* Start checking action parameters
Change-Id: I5b72dd6fe49fcc91229f5a9d715e0ed21776238b
diff --git a/cli/simple_read_only/test_compute.py b/cli/simple_read_only/test_compute.py
index 742b5a4..073fde1 100644
--- a/cli/simple_read_only/test_compute.py
+++ b/cli/simple_read_only/test_compute.py
@@ -55,6 +55,7 @@
cls.identity = config.TempestConfig().identity
super(SimpleReadOnlyNovaCLientTest, cls).setUpClass()
+ #NOTE(jogo): This should eventually be moved into a base class
def nova(self, action, flags='', params='', admin=True, fail_ok=False):
"""Executes nova command for the given action."""
#TODO(jogo) make admin=False work
@@ -66,39 +67,144 @@
cmd = ' '.join([CONF.cli.cli_dir + 'nova', flags, action, params])
LOG.info("running: '%s'" % cmd)
cmd = shlex.split(cmd)
- result = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ try:
+ result = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError, e:
+ LOG.error("command output:\n%s" % e.output)
+ raise
return result
- def test_admin_version(self):
- self.nova('', flags='--version')
-
- def test_admin_timing(self):
- self.nova('list', flags='--timing')
-
- def test_admin_timeout(self):
- self.nova('list', flags='--timeout 2')
-
- def test_admin_debug_list(self):
- self.nova('list', flags='--debug')
-
def test_admin_fake_action(self):
self.assertRaises(subprocess.CalledProcessError,
self.nova,
'this-does-nova-exist')
+ #NOTE(jogo): Commands in order listed in 'nova help'
+
+ # Positional arguments:
+
+ def test_admin_absolute_limites(self):
+ self.nova('absolute-limits')
+
def test_admin_aggregate_list(self):
self.nova('aggregate-list')
+ def test_admin_availability_zone_list(self):
+ self.nova('availability-zone-list')
+
def test_admin_cloudpipe_list(self):
self.nova('cloudpipe-list')
- def test_admin_image_list(self):
- self.nova('image-list')
+ def test_admin_credentials(self):
+ self.nova('credentials')
def test_admin_dns_domains(self):
self.nova('dns-domains')
+ @testtools.skip("needs parameters")
+ def test_admin_dns_list(self):
+ self.nova('dns-list')
+
+ def test_admin_endpoints(self):
+ self.nova('endpoints')
+
+ def test_admin_flavor_acces_list(self):
+ self.assertRaises(subprocess.CalledProcessError,
+ self.nova,
+ 'flavor-access-list')
+ # Failed to get access list for public flavor type
+ self.assertRaises(subprocess.CalledProcessError,
+ self.nova,
+ 'flavor-access-list',
+ params='--flavor m1.tiny')
+
def test_admin_flavor_list(self):
self.nova('flavor-list')
- #TODO(jogo) add more tests
+ def test_admin_floating_ip_bulk_list(self):
+ self.nova('floating-ip-bulk-list')
+
+ def test_admin_floating_ip_list(self):
+ self.nova('floating-ip-list')
+
+ def test_admin_floating_ip_pool_list(self):
+ self.nova('floating-ip-pool-list')
+
+ def test_admin_host_list(self):
+ self.nova('host-list')
+
+ def test_admin_hypervisor_list(self):
+ self.nova('hypervisor-list')
+
+ def test_admin_image_list(self):
+ self.nova('image-list')
+
+ @testtools.skip("needs parameters")
+ def test_admin_interface_list(self):
+ self.nova('interface-list')
+
+ def test_admin_keypair_list(self):
+ self.nova('keypair-list')
+
+ def test_admin_list(self):
+ self.nova('list')
+ self.nova('list', params='--all-tenants 1')
+ self.nova('list', params='--all-tenants 0')
+ self.assertRaises(subprocess.CalledProcessError,
+ self.nova,
+ 'list',
+ params='--all-tenants bad')
+
+ def test_admin_network_list(self):
+ self.nova('network-list')
+
+ def test_admin_rate_limits(self):
+ self.nova('rate-limits')
+
+ def test_admin_secgroup_list(self):
+ self.nova('secgroup-list')
+
+ @testtools.skip("needs parameters")
+ def test_admin_secgroup_list_rules(self):
+ self.nova('secgroup-list-rules')
+
+ def test_admin_servce_list(self):
+ self.nova('service-list')
+
+ def test_admin_usage(self):
+ self.nova('usage')
+
+ def test_admin_usage_list(self):
+ self.nova('usage-list')
+
+ def test_admin_volume_list(self):
+ self.nova('volume-list')
+
+ def test_admin_volume_snapshot_list(self):
+ self.nova('volume-snapshot-list')
+
+ def test_admin_volume_type_list(self):
+ self.nova('volume-type-list')
+
+ def test_admin_help(self):
+ self.nova('help')
+
+ def test_admin_list_extensions(self):
+ self.nova('list-extensions')
+
+ def test_admin_net_list(self):
+ self.nova('net-list')
+
+ # Optional arguments:
+
+ def test_admin_version(self):
+ self.nova('', flags='--version')
+
+ def test_admin_debug_list(self):
+ self.nova('list', flags='--debug')
+
+ def test_admin_timeout(self):
+ self.nova('list', flags='--timeout 2')
+
+ def test_admin_timing(self):
+ self.nova('list', flags='--timing')