Merge "Change v2 identity client methods to return one value"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index a9778e3..2e1d6f3 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -33,28 +33,25 @@
# Deprecated group/name - [DEFAULT]/log_config
#log_config_append = <None>
-# Format string for %%(asctime)s in log records. Default: %(default)s
-# . (string value)
-#log_date_format = %Y-%m-%d %H:%M:%S
-
-# (Optional) The base directory used for relative --log-file paths.
-# (string value)
-# Deprecated group/name - [DEFAULT]/logdir
-#log_dir = <None>
-
-# (Optional) Name of log file to output to. If no default is set,
-# logging will go to stdout. (string value)
-# Deprecated group/name - [DEFAULT]/logfile
-#log_file = <None>
-
# DEPRECATED. A logging.Formatter log message format string which may
# use any of the available logging.LogRecord attributes. This option
# is deprecated. Please use logging_context_format_string and
# logging_default_format_string instead. (string value)
#log_format = <None>
-# Syslog facility to receive log lines. (string value)
-#syslog_log_facility = LOG_USER
+# Format string for %%(asctime)s in log records. Default: %(default)s
+# . (string value)
+#log_date_format = %Y-%m-%d %H:%M:%S
+
+# (Optional) Name of log file to output to. If no default is set,
+# logging will go to stdout. (string value)
+# Deprecated group/name - [DEFAULT]/logfile
+#log_file = <None>
+
+# (Optional) The base directory used for relative --log-file paths.
+# (string value)
+# Deprecated group/name - [DEFAULT]/logdir
+#log_dir = <None>
# Use syslog for logging. Existing syslog format is DEPRECATED during
# I, and will change in J to honor RFC5424. (boolean value)
@@ -66,6 +63,9 @@
# will be removed in J. (boolean value)
#use_syslog_rfc_format = false
+# Syslog facility to receive log lines. (string value)
+#syslog_log_facility = LOG_USER
+
#
# From tempest.config
#
@@ -77,9 +77,26 @@
# From tempest.config
#
+# Format string to use for log messages with context. (string value)
+#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s
+
+# Format string to use for log messages without context. (string
+# value)
+#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s
+
+# Data to append to log format when level is DEBUG. (string value)
+#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d
+
+# Prefix each line of exception output with this format. (string
+# value)
+#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s
+
# List of logger=LEVEL pairs. (list value)
#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN
+# Enables or disables publication of error events. (boolean value)
+#publish_errors = false
+
# Enables or disables fatal status of deprecations. (boolean value)
#fatal_deprecations = false
@@ -91,23 +108,6 @@
# (string value)
#instance_uuid_format = "[instance: %(uuid)s] "
-# Format string to use for log messages with context. (string value)
-#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s
-
-# Data to append to log format when level is DEBUG. (string value)
-#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d
-
-# Format string to use for log messages without context. (string
-# value)
-#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s
-
-# Prefix each line of exception output with this format. (string
-# value)
-#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s
-
-# Enables or disables publication of error events. (boolean value)
-#publish_errors = false
-
[auth]
@@ -115,6 +115,10 @@
# From tempest.config
#
+# Path to the yaml file that contains the list of credentials to use
+# for running tests (string value)
+#test_accounts_file = etc/accounts.yaml
+
# Allows test cases to create/destroy tenants and users. This option
# requires that OpenStack Identity API admin credentials are known. If
# false, isolated test cases and parallel execution, can still be
@@ -131,10 +135,6 @@
# concurrent test processes. (boolean value)
#locking_credentials_provider = false
-# Path to the yaml file that contains the list of credentials to use
-# for running tests (string value)
-#test_accounts_file = etc/accounts.yaml
-
[baremetal]
@@ -142,6 +142,19 @@
# From tempest.config
#
+# Catalog type of the baremetal provisioning service (string value)
+#catalog_type = baremetal
+
+# Whether the Ironic nova-compute driver is enabled (boolean value)
+#driver_enabled = false
+
+# Driver name which Ironic uses (string value)
+#driver = fake
+
+# The endpoint type to use for the baremetal provisioning service
+# (string value)
+#endpoint_type = publicURL
+
# Timeout for Ironic node to completely provision (integer value)
#active_timeout = 300
@@ -149,19 +162,6 @@
# value)
#association_timeout = 30
-# Catalog type of the baremetal provisioning service (string value)
-#catalog_type = baremetal
-
-# Driver name which Ironic uses (string value)
-#driver = fake
-
-# Whether the Ironic nova-compute driver is enabled (boolean value)
-#driver_enabled = false
-
-# The endpoint type to use for the baremetal provisioning service
-# (string value)
-#endpoint_type = publicURL
-
# Timeout for Ironic power transitions. (integer value)
#power_timeout = 60
@@ -175,47 +175,47 @@
# From tempest.config
#
-# AKI Kernel Image manifest (string value)
-#aki_manifest = cirros-0.3.0-x86_64-vmlinuz.manifest.xml
+# EC2 URL (string value)
+#ec2_url = http://localhost:8773/services/Cloud
-# AMI Machine Image manifest (string value)
-#ami_manifest = cirros-0.3.0-x86_64-blank.img.manifest.xml
-
-# ARI Ramdisk Image manifest (string value)
-#ari_manifest = cirros-0.3.0-x86_64-initrd.manifest.xml
-
-# AWS Access Key (string value)
-#aws_access = <None>
+# S3 URL (string value)
+#s3_url = http://localhost:8080
# AWS Secret Key (string value)
#aws_secret = <None>
+# AWS Access Key (string value)
+#aws_access = <None>
+
# AWS Zone for EC2 tests (string value)
#aws_zone = nova
-# Status Change Test Interval (integer value)
-#build_interval = 1
-
-# Status Change Timeout (integer value)
-#build_timeout = 60
-
-# EC2 URL (string value)
-#ec2_url = http://localhost:8773/services/Cloud
-
-# boto Http socket timeout (integer value)
-#http_socket_timeout = 3
-
-# Instance type (string value)
-#instance_type = m1.tiny
-
-# boto num_retries on error (integer value)
-#num_retries = 1
-
# S3 Materials Path (string value)
#s3_materials_path = /opt/stack/devstack/files/images/s3-materials/cirros-0.3.0
-# S3 URL (string value)
-#s3_url = http://localhost:8080
+# ARI Ramdisk Image manifest (string value)
+#ari_manifest = cirros-0.3.0-x86_64-initrd.manifest.xml
+
+# AMI Machine Image manifest (string value)
+#ami_manifest = cirros-0.3.0-x86_64-blank.img.manifest.xml
+
+# AKI Kernel Image manifest (string value)
+#aki_manifest = cirros-0.3.0-x86_64-vmlinuz.manifest.xml
+
+# Instance type (string value)
+#instance_type = m1.tiny
+
+# boto Http socket timeout (integer value)
+#http_socket_timeout = 3
+
+# boto num_retries on error (integer value)
+#num_retries = 1
+
+# Status Change Timeout (integer value)
+#build_timeout = 60
+
+# Status Change Test Interval (integer value)
+#build_interval = 1
[cli]
@@ -224,12 +224,12 @@
# From tempest.config
#
-# directory where python client binaries are located (string value)
-#cli_dir = /usr/local/bin
-
# enable cli tests (boolean value)
#enabled = true
+# directory where python client binaries are located (string value)
+#cli_dir = /usr/local/bin
+
# Whether the tempest run location has access to the *-manage
# commands. In a pure blackbox environment it will not. (boolean
# value)
@@ -245,43 +245,6 @@
# From tempest.config
#
-# Time in seconds between build status checks. (integer value)
-#build_interval = 1
-
-# Timeout in seconds to wait for an instance to build. Other services
-# that do not define build_timeout will inherit this value, for
-# example the image service. (integer value)
-#build_timeout = 300
-
-# Catalog type of the Compute service. (string value)
-#catalog_type = compute
-
-# The endpoint type to use for the compute service. (string value)
-#endpoint_type = publicURL
-
-# Name of the fixed network that is visible to all test tenants.
-# (string value)
-#fixed_network_name = private
-
-# Valid primary flavor to use in tests. (string value)
-#flavor_ref = 1
-
-# Valid secondary flavor to be used in tests. (string value)
-#flavor_ref_alt = 2
-
-# Unallocated floating IP range, which will be used to test the
-# floating IP bulk feature for CRUD operation. This block must not
-# overlap an existing floating IP pool. (string value)
-#floating_ip_range = 10.0.0.0/29
-
-# Password used to authenticate to an instance using the alternate
-# image. (string value)
-#image_alt_ssh_password = password
-
-# User name used to authenticate to an instance using the alternate
-# image. (string value)
-#image_alt_ssh_user = root
-
# Valid primary image reference to be used in tests. This is a
# required option (string value)
#image_ref = <None>
@@ -291,44 +254,37 @@
# value of image_ref above (string value)
#image_ref_alt = <None>
-# Password used to authenticate to an instance. (string value)
-#image_ssh_password = password
+# Valid primary flavor to use in tests. (string value)
+#flavor_ref = 1
+
+# Valid secondary flavor to be used in tests. (string value)
+#flavor_ref_alt = 2
# User name used to authenticate to an instance. (string value)
#image_ssh_user = root
-# IP version used for SSH connections. (integer value)
-#ip_version_for_ssh = 4
+# Password used to authenticate to an instance. (string value)
+#image_ssh_password = password
-# Network used for SSH connections. Ignored if
-# use_floatingip_for_ssh=true or run_ssh=false. (string value)
-#network_for_ssh = public
+# User name used to authenticate to an instance using the alternate
+# image. (string value)
+#image_alt_ssh_user = root
-# Path to a private key file for SSH access to remote hosts (string
+# Password used to authenticate to an instance using the alternate
+# image. (string value)
+#image_alt_ssh_password = password
+
+# Time in seconds between build status checks. (integer value)
+#build_interval = 1
+
+# Timeout in seconds to wait for an instance to build. Other services
+# that do not define build_timeout will inherit this value. (integer
# value)
-#path_to_private_key = <None>
-
-# Timeout in seconds to wait for ping to succeed. (integer value)
-#ping_timeout = 120
-
-# Additional wait time for clean state, when there is no OS-EXT-STS
-# extension available (integer value)
-#ready_wait = 0
-
-# The compute region name to use. If empty, the value of
-# identity.region is used instead. If no such region is found in the
-# service catalog, the first found one is used. (string value)
-#region =
+#build_timeout = 300
# Should the tests ssh to instances? (boolean value)
#run_ssh = false
-# Time in seconds before a shelved instance is eligible for removing
-# from a host. -1 never offload, 0 offload when shelved. This time
-# should be the same as the time of nova.conf, and some tests will run
-# for as long as the time. (integer value)
-#shelved_offload_time = 0
-
# Auth method used for authenticate to the instance. Valid choices
# are: keypair, configured, adminpass. keypair: start the servers with
# an ssh keypair. configured: use the configured user and password.
@@ -336,29 +292,73 @@
# when it is an option. (string value)
#ssh_auth_method = keypair
-# Timeout in seconds to wait for output from ssh channel. (integer
-# value)
-#ssh_channel_timeout = 60
-
# How to connect to the instance? fixed: using the first ip belongs
# the fixed network floating: creating and using a floating ip (string
# value)
#ssh_connect_method = fixed
+# User name used to authenticate to an instance. (string value)
+#ssh_user = root
+
+# Timeout in seconds to wait for ping to succeed. (integer value)
+#ping_timeout = 120
+
# Timeout in seconds to wait for authentication to succeed. (integer
# value)
#ssh_timeout = 300
-# User name used to authenticate to an instance. (string value)
-#ssh_user = root
+# Additional wait time for clean state, when there is no OS-EXT-STS
+# extension available (integer value)
+#ready_wait = 0
+
+# Timeout in seconds to wait for output from ssh channel. (integer
+# value)
+#ssh_channel_timeout = 60
+
+# Name of the fixed network that is visible to all test tenants.
+# (string value)
+#fixed_network_name = private
+
+# Network used for SSH connections. Ignored if
+# use_floatingip_for_ssh=true or run_ssh=false. (string value)
+#network_for_ssh = public
+
+# IP version used for SSH connections. (integer value)
+#ip_version_for_ssh = 4
# Does SSH use Floating IPs? (boolean value)
#use_floatingip_for_ssh = true
+# Catalog type of the Compute service. (string value)
+#catalog_type = compute
+
+# The compute region name to use. If empty, the value of
+# identity.region is used instead. If no such region is found in the
+# service catalog, the first found one is used. (string value)
+#region =
+
+# The endpoint type to use for the compute service. (string value)
+#endpoint_type = publicURL
+
+# Path to a private key file for SSH access to remote hosts (string
+# value)
+#path_to_private_key = <None>
+
# Expected device name when a volume is attached to an instance
# (string value)
#volume_device_name = vdb
+# Time in seconds before a shelved instance is eligible for removing
+# from a host. -1 never offload, 0 offload when shelved. This time
+# should be the same as the time of nova.conf, and some tests will run
+# for as long as the time. (integer value)
+#shelved_offload_time = 0
+
+# Unallocated floating IP range, which will be used to test the
+# floating IP bulk feature for CRUD operation. This block must not
+# overlap an existing floating IP pool. (string value)
+#floating_ip_range = 10.0.0.0/29
+
[compute-feature-enabled]
@@ -366,20 +366,15 @@
# From tempest.config
#
+# If false, skip disk config tests (boolean value)
+#disk_config = true
+
# A list of enabled compute extensions with a special entry all which
# indicates every extension is enabled. Each extension should be
# specified with alias name. Empty list indicates all extensions are
# disabled (list value)
#api_extensions = all
-# Does the test environment block migration support cinder iSCSI
-# volumes (boolean value)
-#block_migrate_cinder_iscsi = false
-
-# Does the test environment use block devices for live migration
-# (boolean value)
-#block_migration_for_live_migration = false
-
# Does the test environment support changing the admin password?
# (boolean value)
#change_password = false
@@ -388,23 +383,38 @@
# output? (boolean value)
#console_output = true
-# If false, skip disk config tests (boolean value)
-#disk_config = true
+# Does the test environment support resizing? (boolean value)
+#resize = false
-# Enables returning of the instance password by the relevant server
-# API calls such as create, rebuild or rescue. (boolean value)
-#enable_instance_password = true
+# Does the test environment support pausing? (boolean value)
+#pause = true
-# Does the test environment support dynamic network interface
-# attachment? (boolean value)
-#interface_attach = true
+# Does the test environment support shelving/unshelving? (boolean
+# value)
+#shelve = true
+
+# Does the test environment support suspend/resume? (boolean value)
+#suspend = true
# Does the test environment support live migration available? (boolean
# value)
#live_migration = true
-# Does the test environment support pausing? (boolean value)
-#pause = true
+# Does the test environment use block devices for live migration
+# (boolean value)
+#block_migration_for_live_migration = false
+
+# Does the test environment block migration support cinder iSCSI
+# volumes (boolean value)
+#block_migrate_cinder_iscsi = false
+
+# Enable VNC console. This configuration value should be same as
+# [nova.vnc]->vnc_enabled in nova.conf (boolean value)
+#vnc_console = false
+
+# Enable Spice console. This configuration value should be same as
+# [nova.spice]->enabled in nova.conf (boolean value)
+#spice_console = false
# Enable RDP console. This configuration value should be same as
# [nova.rdp]->enabled in nova.conf (boolean value)
@@ -414,28 +424,18 @@
# value)
#rescue = true
-# Does the test environment support resizing? (boolean value)
-#resize = false
+# Enables returning of the instance password by the relevant server
+# API calls such as create, rebuild or rescue. (boolean value)
+#enable_instance_password = true
-# Does the test environment support shelving/unshelving? (boolean
-# value)
-#shelve = true
+# Does the test environment support dynamic network interface
+# attachment? (boolean value)
+#interface_attach = true
# Does the test environment support creating snapshot images of
# running instances? (boolean value)
#snapshot = true
-# Enable Spice console. This configuration value should be same as
-# [nova.spice]->enabled in nova.conf (boolean value)
-#spice_console = false
-
-# Does the test environment support suspend/resume? (boolean value)
-#suspend = true
-
-# Enable VNC console. This configuration value should be same as
-# [nova.vnc]->vnc_enabled in nova.conf (boolean value)
-#vnc_console = false
-
[dashboard]
@@ -473,12 +473,12 @@
# Catalog type of the Database service. (string value)
#catalog_type = database
-# Current database version to use in database tests. (string value)
-#db_current_version = v1.0
-
# Valid primary flavor to use in database tests. (string value)
#db_flavor_ref = 1
+# Current database version to use in database tests. (string value)
+#db_current_version = v1.0
+
[debug]
@@ -507,71 +507,15 @@
# From tempest.config
#
-# Admin domain name for authentication (Keystone V3).The same domain
-# applies to user and project (string value)
-#admin_domain_name = <None>
-
-# API key to use when authenticating as admin. (string value)
-#admin_password = <None>
-
-# Role required to administrate keystone. (string value)
-#admin_role = admin
-
-# Administrative Tenant name to use for Keystone API requests. (string
-# value)
-#admin_tenant_name = <None>
-
-# Administrative Username to use for Keystone API requests. (string
-# value)
-#admin_username = <None>
-
-# Alternate domain name for authentication (Keystone V3).The same
-# domain applies to user and project (string value)
-#alt_domain_name = <None>
-
-# API key to use when authenticating as alternate user. (string value)
-#alt_password = <None>
-
-# Alternate user's Tenant name to use for Nova API requests. (string
-# value)
-#alt_tenant_name = <None>
-
-# Username of alternate user to use for Nova API requests. (string
-# value)
-#alt_username = <None>
-
-# Identity API version to be used for authentication for API tests.
-# (string value)
-#auth_version = v2
-
-# Specify a CA bundle file to use in verifying a TLS (https) server
-# certificate. (string value)
-#ca_certificates_file = <None>
-
# Catalog type of the Identity service. (string value)
#catalog_type = identity
# Set to True if using self-signed SSL certificates. (boolean value)
#disable_ssl_certificate_validation = false
-# Domain name for authentication (Keystone V3).The same domain applies
-# to user and project (string value)
-#domain_name = <None>
-
-# The endpoint type to use for the identity service. (string value)
-#endpoint_type = publicURL
-
-# API key to use when authenticating. (string value)
-#password = <None>
-
-# The identity region name to use. Also used as the other services'
-# region name unless they are set explicitly. If no such region is
-# found in the service catalog, the first found one is used. (string
-# value)
-#region = RegionOne
-
-# Tenant name to use for Nova API requests. (string value)
-#tenant_name = <None>
+# Specify a CA bundle file to use in verifying a TLS (https) server
+# certificate. (string value)
+#ca_certificates_file = <None>
# Full URI of the OpenStack Identity API (Keystone), v2 (string value)
#uri = <None>
@@ -579,9 +523,65 @@
# Full URI of the OpenStack Identity API (Keystone), v3 (string value)
#uri_v3 = <None>
+# Identity API version to be used for authentication for API tests.
+# (string value)
+#auth_version = v2
+
+# The identity region name to use. Also used as the other services'
+# region name unless they are set explicitly. If no such region is
+# found in the service catalog, the first found one is used. (string
+# value)
+#region = RegionOne
+
+# The endpoint type to use for the identity service. (string value)
+#endpoint_type = publicURL
+
# Username to use for Nova API requests. (string value)
#username = <None>
+# Tenant name to use for Nova API requests. (string value)
+#tenant_name = <None>
+
+# Role required to administrate keystone. (string value)
+#admin_role = admin
+
+# API key to use when authenticating. (string value)
+#password = <None>
+
+# Domain name for authentication (Keystone V3).The same domain applies
+# to user and project (string value)
+#domain_name = <None>
+
+# Username of alternate user to use for Nova API requests. (string
+# value)
+#alt_username = <None>
+
+# Alternate user's Tenant name to use for Nova API requests. (string
+# value)
+#alt_tenant_name = <None>
+
+# API key to use when authenticating as alternate user. (string value)
+#alt_password = <None>
+
+# Alternate domain name for authentication (Keystone V3).The same
+# domain applies to user and project (string value)
+#alt_domain_name = <None>
+
+# Administrative Username to use for Keystone API requests. (string
+# value)
+#admin_username = <None>
+
+# Administrative Tenant name to use for Keystone API requests. (string
+# value)
+#admin_tenant_name = <None>
+
+# API key to use when authenticating as admin. (string value)
+#admin_password = <None>
+
+# Admin domain name for authentication (Keystone V3).The same domain
+# applies to user and project (string value)
+#admin_domain_name = <None>
+
[identity-feature-enabled]
@@ -589,16 +589,16 @@
# From tempest.config
#
+# Does the identity service have delegation and impersonation enabled
+# (boolean value)
+#trust = true
+
# Is the v2 identity API enabled (boolean value)
#api_v2 = true
# Is the v3 identity API enabled (boolean value)
#api_v3 = true
-# Does the identity service have delegation and impersonation enabled
-# (boolean value)
-#trust = true
-
[image]
@@ -609,16 +609,24 @@
# Catalog type of the Image service. (string value)
#catalog_type = image
+# The image region name to use. If empty, the value of identity.region
+# is used instead. If no such region is found in the service catalog,
+# the first found one is used. (string value)
+#region =
+
# The endpoint type to use for the image service. (string value)
#endpoint_type = publicURL
# http accessible image (string value)
#http_image = http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz
-# The image region name to use. If empty, the value of identity.region
-# is used instead. If no such region is found in the service catalog,
-# the first found one is used. (string value)
-#region =
+# Timeout in seconds to wait for an image to become available.
+# (integer value)
+#build_timeout = 300
+
+# Time in seconds between image operation status checks. (integer
+# value)
+#build_interval = 1
[image-feature-enabled]
@@ -627,12 +635,12 @@
# From tempest.config
#
-# Is the v1 image API enabled (boolean value)
-#api_v1 = true
-
# Is the v2 image API enabled (boolean value)
#api_v2 = true
+# Is the v1 image API enabled (boolean value)
+#api_v1 = true
+
[input-scenario]
@@ -640,12 +648,12 @@
# From tempest.config
#
-# Matching flavors become parameters for scenario tests (string value)
-#flavor_regex = ^m1.nano$
-
# Matching images become parameters for scenario tests (string value)
#image_regex = ^cirros-0.3.1-x86_64-uec$
+# Matching flavors become parameters for scenario tests (string value)
+#flavor_regex = ^m1.nano$
+
# SSH verification in tests is skippedfor matching images (string
# value)
#non_ssh_image_regex = ^.*[Ww]in.*$
@@ -663,31 +671,31 @@
# Catalog type of the Messaging service. (string value)
#catalog_type = messaging
-# The maximum grace period for a claim (integer value)
-#max_claim_grace = 43200
+# The maximum number of queue records per page when listing queues
+# (integer value)
+#max_queues_per_page = 20
-# The maximum ttl for a claim (integer value)
-#max_claim_ttl = 43200
-
-# The maximum size of a message body (integer value)
-#max_message_size = 262144
-
-# The maximum ttl for a message (integer value)
-#max_message_ttl = 1209600
-
-# The maximum number of messages per claim (integer value)
-#max_messages_per_claim = 20
+# The maximum metadata size for a queue (integer value)
+#max_queue_metadata = 65536
# The maximum number of queue message per page when listing (or)
# posting messages (integer value)
#max_messages_per_page = 20
-# The maximum metadata size for a queue (integer value)
-#max_queue_metadata = 65536
+# The maximum size of a message body (integer value)
+#max_message_size = 262144
-# The maximum number of queue records per page when listing queues
-# (integer value)
-#max_queues_per_page = 20
+# The maximum number of messages per claim (integer value)
+#max_messages_per_claim = 20
+
+# The maximum ttl for a message (integer value)
+#max_message_ttl = 1209600
+
+# The maximum ttl for a claim (integer value)
+#max_claim_ttl = 43200
+
+# The maximum grace period for a claim (integer value)
+#max_claim_grace = 43200
[negative]
@@ -706,39 +714,17 @@
# From tempest.config
#
-# Time in seconds between network operation status checks. (integer
-# value)
-#build_interval = 1
-
-# Timeout in seconds to wait for network operation to complete.
-# (integer value)
-#build_timeout = 300
-
# Catalog type of the Neutron service. (string value)
#catalog_type = network
-# List of dns servers which should be used for subnet creation (list
-# value)
-#dns_servers = 8.8.8.8,8.8.4.4
-
-# The endpoint type to use for the network service. (string value)
-#endpoint_type = publicURL
-
-# Id of the public network that provides external connectivity (string
-# value)
-#public_network_id =
-
-# Id of the public router that provides external connectivity. This
-# should only be used when Neutron's 'allow_overlapping_ips' is set to
-# 'False' in neutron.conf. usually not needed past 'Grizzly' release
-# (string value)
-#public_router_id =
-
# The network region name to use. If empty, the value of
# identity.region is used instead. If no such region is found in the
# service catalog, the first found one is used. (string value)
#region =
+# The endpoint type to use for the network service. (string value)
+#endpoint_type = publicURL
+
# The cidr block to allocate tenant ipv4 subnets from (string value)
#tenant_network_cidr = 10.100.0.0/16
@@ -755,6 +741,28 @@
# (boolean value)
#tenant_networks_reachable = false
+# Id of the public network that provides external connectivity (string
+# value)
+#public_network_id =
+
+# Id of the public router that provides external connectivity. This
+# should only be used when Neutron's 'allow_overlapping_ips' is set to
+# 'False' in neutron.conf. usually not needed past 'Grizzly' release
+# (string value)
+#public_router_id =
+
+# Timeout in seconds to wait for network operation to complete.
+# (integer value)
+#build_timeout = 300
+
+# Time in seconds between network operation status checks. (integer
+# value)
+#build_interval = 1
+
+# List of dns servers which should be used for subnet creation (list
+# value)
+#dns_servers = 8.8.8.8,8.8.4.4
+
[network-feature-enabled]
@@ -762,14 +770,14 @@
# From tempest.config
#
+# Allow the execution of IPv6 tests (boolean value)
+#ipv6 = true
+
# A list of enabled network extensions with a special entry all which
# indicates every extension is enabled. Empty list indicates all
# extensions are disabled (list value)
#api_extensions = all
-# Allow the execution of IPv6 tests (boolean value)
-#ipv6 = true
-
# Allow the execution of IPv6 subnet tests that use the extended IPv6
# attributes ipv6_ra_mode and ipv6_address_mode (boolean value)
#ipv6_subnet_attributes = false
@@ -784,27 +792,27 @@
# Catalog type of the Object-Storage service. (string value)
#catalog_type = object-store
-# Number of seconds to wait while looping to check the status of a
-# container to container synchronization (integer value)
-#container_sync_interval = 5
-
-# Number of seconds to time on waiting for a container to container
-# synchronization complete. (integer value)
-#container_sync_timeout = 120
+# The object-storage region name to use. If empty, the value of
+# identity.region is used instead. If no such region is found in the
+# service catalog, the first found one is used. (string value)
+#region =
# The endpoint type to use for the object-store service. (string
# value)
#endpoint_type = publicURL
+# Number of seconds to time on waiting for a container to container
+# synchronization complete. (integer value)
+#container_sync_timeout = 120
+
+# Number of seconds to wait while looping to check the status of a
+# container to container synchronization (integer value)
+#container_sync_interval = 5
+
# Role to add to users created for swift tests to enable creating
# containers (string value)
#operator_role = Member
-# The object-storage region name to use. If empty, the value of
-# identity.region is used instead. If no such region is found in the
-# service catalog, the first found one is used. (string value)
-#region =
-
# User role that has reseller admin (string value)
#reseller_admin_role = ResellerAdmin
@@ -815,20 +823,20 @@
# From tempest.config
#
-# Execute (old style) container-sync tests (boolean value)
-#container_sync = true
-
-# Execute discoverability tests (boolean value)
-#discoverability = true
-
# A list of the enabled optional discoverable apis. A single entry,
# all, indicates that all of these features are expected to be enabled
# (list value)
#discoverable_apis = all
+# Execute (old style) container-sync tests (boolean value)
+#container_sync = true
+
# Execute object-versioning tests (boolean value)
#object_versioning = true
+# Execute discoverability tests (boolean value)
+#discoverability = true
+
[orchestration]
@@ -836,42 +844,42 @@
# From tempest.config
#
+# Catalog type of the Orchestration service. (string value)
+#catalog_type = orchestration
+
+# The orchestration region name to use. If empty, the value of
+# identity.region is used instead. If no such region is found in the
+# service catalog, the first found one is used. (string value)
+#region =
+
+# The endpoint type to use for the orchestration service. (string
+# value)
+#endpoint_type = publicURL
+
# Time in seconds between build status checks. (integer value)
#build_interval = 1
# Timeout in seconds to wait for a stack to build. (integer value)
#build_timeout = 1200
-# Catalog type of the Orchestration service. (string value)
-#catalog_type = orchestration
-
-# The endpoint type to use for the orchestration service. (string
-# value)
-#endpoint_type = publicURL
+# Instance type for tests. Needs to be big enough for a full OS plus
+# the test workload (string value)
+#instance_type = m1.micro
# Name of heat-cfntools enabled image to use when launching test
# instances. (string value)
#image_ref = <None>
-# Instance type for tests. Needs to be big enough for a full OS plus
-# the test workload (string value)
-#instance_type = m1.micro
-
# Name of existing keypair to launch servers with. (string value)
#keypair_name = <None>
# Value must match heat configuration of the same name. (integer
# value)
-#max_resources_per_stack = 1000
+#max_template_size = 524288
# Value must match heat configuration of the same name. (integer
# value)
-#max_template_size = 524288
-
-# The orchestration region name to use. If empty, the value of
-# identity.region is used instead. If no such region is found in the
-# service catalog, the first found one is used. (string value)
-#region =
+#max_resources_per_stack = 1000
[scenario]
@@ -880,8 +888,18 @@
# From tempest.config
#
-# AKI image file name (string value)
-#aki_img_file = cirros-0.3.1-x86_64-vmlinuz
+# Directory containing image files (string value)
+#img_dir = /opt/stack/new/devstack/files/images/cirros-0.3.1-x86_64-uec
+
+# Image file name (string value)
+# Deprecated group/name - [DEFAULT]/qcow2_img_file
+#img_file = cirros-0.3.1-x86_64-disk.img
+
+# Image disk format (string value)
+#img_disk_format = qcow2
+
+# Image container format (string value)
+#img_container_format = bare
# AMI image file name (string value)
#ami_img_file = cirros-0.3.1-x86_64-blank.img
@@ -889,26 +907,16 @@
# ARI image file name (string value)
#ari_img_file = cirros-0.3.1-x86_64-initrd
-# Image container format (string value)
-#img_container_format = bare
+# AKI image file name (string value)
+#aki_img_file = cirros-0.3.1-x86_64-vmlinuz
-# Directory containing image files (string value)
-#img_dir = /opt/stack/new/devstack/files/images/cirros-0.3.1-x86_64-uec
-
-# Image disk format (string value)
-#img_disk_format = qcow2
-
-# Image file name (string value)
-# Deprecated group/name - [DEFAULT]/qcow2_img_file
-#img_file = cirros-0.3.1-x86_64-disk.img
+# ssh username for the image file (string value)
+#ssh_user = cirros
# specifies how many resources to request at once. Used for large
# operations testing. (integer value)
#large_ops_number = 0
-# ssh username for the image file (string value)
-#ssh_user = cirros
-
[service_available]
@@ -916,36 +924,36 @@
# From tempest.config
#
-# Whether or not Ceilometer is expected to be available (boolean
-# value)
-#ceilometer = true
-
# Whether or not cinder is expected to be available (boolean value)
#cinder = true
-# Whether or not glance is expected to be available (boolean value)
-#glance = true
-
-# Whether or not Heat is expected to be available (boolean value)
-#heat = false
-
-# Whether or not Horizon is expected to be available (boolean value)
-#horizon = true
-
-# Whether or not Ironic is expected to be available (boolean value)
-#ironic = false
-
# Whether or not neutron is expected to be available (boolean value)
#neutron = false
+# Whether or not glance is expected to be available (boolean value)
+#glance = true
+
+# Whether or not swift is expected to be available (boolean value)
+#swift = true
+
# Whether or not nova is expected to be available (boolean value)
#nova = true
+# Whether or not Heat is expected to be available (boolean value)
+#heat = false
+
+# Whether or not Ceilometer is expected to be available (boolean
+# value)
+#ceilometer = true
+
+# Whether or not Horizon is expected to be available (boolean value)
+#horizon = true
+
# Whether or not Sahara is expected to be available (boolean value)
#sahara = false
-# Whether or not swift is expected to be available (boolean value)
-#swift = true
+# Whether or not Ironic is expected to be available (boolean value)
+#ironic = false
# Whether or not Trove is expected to be available (boolean value)
#trove = false
@@ -960,40 +968,40 @@
# From tempest.config
#
+# Directory containing log files on the compute nodes (string value)
+#nova_logdir = <None>
+
+# Maximum number of instances to create during test. (integer value)
+#max_instances = 16
+
# Controller host. (string value)
#controller = <None>
+# Controller host. (string value)
+#target_controller = <None>
+
+# ssh user. (string value)
+#target_ssh_user = <None>
+
+# Path to private key. (string value)
+#target_private_key_path = <None>
+
+# regexp for list of log files. (string value)
+#target_logfiles = <None>
+
+# time (in seconds) between log file error checks. (integer value)
+#log_check_interval = 60
+
# The number of threads created while stress test. (integer value)
#default_thread_number_per_action = 4
-# Allows a full cleaning process after a stress test. Caution : this
-# cleanup will remove every objects of every tenant. (boolean value)
-#full_clean_stack = false
-
# Prevent the cleaning (tearDownClass()) between each stress test run
# if an exception occurs during this run. (boolean value)
#leave_dirty_stack = false
-# time (in seconds) between log file error checks. (integer value)
-#log_check_interval = 60
-
-# Maximum number of instances to create during test. (integer value)
-#max_instances = 16
-
-# Directory containing log files on the compute nodes (string value)
-#nova_logdir = <None>
-
-# Controller host. (string value)
-#target_controller = <None>
-
-# regexp for list of log files. (string value)
-#target_logfiles = <None>
-
-# Path to private key. (string value)
-#target_private_key_path = <None>
-
-# ssh user. (string value)
-#target_ssh_user = <None>
+# Allows a full cleaning process after a stress test. Caution : this
+# cleanup will remove every objects of every tenant. (boolean value)
+#full_clean_stack = false
[telemetry]
@@ -1019,14 +1027,6 @@
# From tempest.config
#
-# Name of the backend1 (must be declared in cinder.conf) (string
-# value)
-#backend1_name = BACKEND_1
-
-# Name of the backend2 (must be declared in cinder.conf) (string
-# value)
-#backend2_name = BACKEND_2
-
# Time in seconds between volume availability checks. (integer value)
#build_interval = 1
@@ -1037,23 +1037,31 @@
# Catalog type of the Volume Service (string value)
#catalog_type = volume
-# Disk format to use when copying a volume to image (string value)
-#disk_format = raw
-
-# The endpoint type to use for the volume service. (string value)
-#endpoint_type = publicURL
-
# The volume region name to use. If empty, the value of
# identity.region is used instead. If no such region is found in the
# service catalog, the first found one is used. (string value)
#region =
+# The endpoint type to use for the volume service. (string value)
+#endpoint_type = publicURL
+
+# Name of the backend1 (must be declared in cinder.conf) (string
+# value)
+#backend1_name = BACKEND_1
+
+# Name of the backend2 (must be declared in cinder.conf) (string
+# value)
+#backend2_name = BACKEND_2
+
# Backend protocol to target when creating volume types (string value)
#storage_protocol = iSCSI
# Backend vendor to target when creating volume types (string value)
#vendor_name = Open Source
+# Disk format to use when copying a volume to image (string value)
+#disk_format = raw
+
# Default size in GB for volumes created by volumes tests (integer
# value)
#volume_size = 1
@@ -1065,6 +1073,15 @@
# From tempest.config
#
+# Runs Cinder multi-backend test (requires 2 backends) (boolean value)
+#multi_backend = false
+
+# Runs Cinder volumes backup test (boolean value)
+#backup = true
+
+# Runs Cinder volume snapshot test (boolean value)
+#snapshot = true
+
# A list of enabled volume extensions with a special entry all which
# indicates every extension is enabled. Empty list indicates all
# extensions are disabled (list value)
@@ -1075,12 +1092,3 @@
# Is the v2 volume API enabled (boolean value)
#api_v2 = true
-
-# Runs Cinder volumes backup test (boolean value)
-#backup = true
-
-# Runs Cinder multi-backend test (requires 2 backends) (boolean value)
-#multi_backend = false
-
-# Runs Cinder volume snapshot test (boolean value)
-#snapshot = true
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions.py b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
index db382eb..19f5fba 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
@@ -96,6 +96,11 @@
self.floating_ip,
self.server_id)
self.assertEqual(202, resp.status)
+
+ # Check instance_id in the floating_ip body
+ resp, body = self.client.get_floating_ip_details(self.floating_ip_id)
+ self.assertEqual(self.server_id, body['instance_id'])
+
# Disassociation of floating IP that was associated in this method
resp, body = self.client.disassociate_floating_ip_from_server(
self.floating_ip,
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index 5105e2f..38e55b1 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -37,10 +37,10 @@
cls.image_id = None
name = data_utils.rand_name('image')
- resp, body = cls.glance_client.create_image(name=name,
- container_format='bare',
- disk_format='raw',
- is_public=False)
+ body = cls.glance_client.create_image(name=name,
+ container_format='bare',
+ disk_format='raw',
+ is_public=False)
cls.image_id = body['id']
cls.images.append(cls.image_id)
image_file = StringIO.StringIO(('*' * 1024))
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index ceab4f9..d9a7201 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -42,10 +42,10 @@
def _create_image():
name = data_utils.rand_name('image')
- _, body = cls.glance_client.create_image(name=name,
- container_format='bare',
- disk_format='raw',
- is_public=False)
+ body = cls.glance_client.create_image(name=name,
+ container_format='bare',
+ disk_format='raw',
+ is_public=False)
image_id = body['id']
cls.images.append(image_id)
# Wait 1 second between creation and upload to ensure a delta
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 28deaa7..76c858b 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -290,12 +290,11 @@
'backup_type': "daily",
'instance_uuid': self.server_id,
}
- resp, image_list = self.os.image_client.image_list_detail(
+ image_list = self.os.image_client.image_list_detail(
properties,
status='active',
sort_key='created_at',
sort_dir='asc')
- self.assertEqual(200, resp.status)
self.assertEqual(2, len(image_list))
self.assertEqual((backup1, backup2),
(image_list[0]['name'], image_list[1]['name']))
@@ -315,12 +314,11 @@
self.servers_client.wait_for_server_status(self.server_id, 'ACTIVE')
self.os.image_client.wait_for_resource_deletion(image1_id)
oldest_backup_exist = False
- resp, image_list = self.os.image_client.image_list_detail(
+ image_list = self.os.image_client.image_list_detail(
properties,
status='active',
sort_key='created_at',
sort_dir='asc')
- self.assertEqual(200, resp.status)
self.assertEqual(2, len(image_list),
'Unexpected number of images for '
'v2:test_create_backup; was the oldest backup not '
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index 1f4f124..3dd6e34 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -57,13 +57,13 @@
resp, cls.server = cls.client.get_server(server['id'])
name = data_utils.rand_name('image')
- resp, body = cls.glance_client.create_image(name=name,
- container_format='bare',
- disk_format='raw',
- is_public=False)
+ body = cls.glance_client.create_image(name=name,
+ container_format='bare',
+ disk_format='raw',
+ is_public=False)
image_id = body['id']
image_file = StringIO.StringIO(('*' * 1024))
- resp, body = cls.glance_client.update_image(image_id, data=image_file)
+ body = cls.glance_client.update_image(image_id, data=image_file)
cls.glance_client.wait_for_image_status(image_id, 'active')
resp, cls.image = cls.images_client.get_image(image_id)
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index 76b6f17..12f3fdd 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -67,10 +67,10 @@
container_format = kwargs.pop('container_format')
disk_format = kwargs.pop('disk_format')
- resp, image = cls.client.create_image(name, container_format,
- disk_format, **kwargs)
+ image = cls.client.create_image(name, container_format,
+ disk_format, **kwargs)
cls.created_images.append(image['id'])
- return resp, image
+ return image
class BaseV1ImageTest(BaseImageTest):
@@ -95,11 +95,10 @@
def _create_image(self):
image_file = StringIO.StringIO(data_utils.random_bytes())
- resp, image = self.create_image(container_format='bare',
- disk_format='raw',
- is_public=False,
- data=image_file)
- self.assertEqual(201, resp.status)
+ image = self.create_image(container_format='bare',
+ disk_format='raw',
+ is_public=False,
+ data=image_file)
image_id = image['id']
return image_id
@@ -127,15 +126,15 @@
cls.alt_tenant_id = cls.alt_img_client.tenant_id
def _list_image_ids_as_alt(self):
- _, image_list = self.alt_img_client.image_list()
+ image_list = self.alt_img_client.image_list()
image_ids = map(lambda x: x['id'], image_list)
return image_ids
def _create_image(self):
name = data_utils.rand_name('image')
- _, image = self.os_img_client.create_image(name,
- container_format='bare',
- disk_format='raw')
+ image = self.os_img_client.create_image(name,
+ container_format='bare',
+ disk_format='raw')
image_id = image['id']
self.addCleanup(self.os_img_client.delete_image, image_id)
return image_id
diff --git a/tempest/api/image/v1/test_image_members.py b/tempest/api/image/v1/test_image_members.py
index f91cb69..d18a274 100644
--- a/tempest/api/image/v1/test_image_members.py
+++ b/tempest/api/image/v1/test_image_members.py
@@ -23,7 +23,7 @@
def test_add_image_member(self):
image = self._create_image()
self.client.add_member(self.alt_tenant_id, image)
- _, body = self.client.get_image_membership(image)
+ body = self.client.get_image_membership(image)
members = body['members']
members = map(lambda x: x['member_id'], members)
self.assertIn(self.alt_tenant_id, members)
@@ -36,7 +36,7 @@
self.client.add_member(self.alt_tenant_id, image)
share_image = self._create_image()
self.client.add_member(self.alt_tenant_id, share_image)
- _, body = self.client.get_shared_images(self.alt_tenant_id)
+ body = self.client.get_shared_images(self.alt_tenant_id)
images = body['shared_images']
images = map(lambda x: x['image_id'], images)
self.assertIn(share_image, images)
@@ -47,6 +47,6 @@
image_id = self._create_image()
self.client.add_member(self.alt_tenant_id, image_id)
self.client.delete_member(self.alt_tenant_id, image_id)
- _, body = self.client.get_image_membership(image_id)
+ body = self.client.get_image_membership(image_id)
members = body['members']
self.assertEqual(0, len(members), str(members))
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index bc45da5..b9f12e6 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -30,11 +30,11 @@
def test_register_then_upload(self):
# Register, then upload an image
properties = {'prop1': 'val1'}
- _, body = self.create_image(name='New Name',
- container_format='bare',
- disk_format='raw',
- is_public=False,
- properties=properties)
+ body = self.create_image(name='New Name',
+ container_format='bare',
+ disk_format='raw',
+ is_public=False,
+ properties=properties)
self.assertIn('id', body)
image_id = body.get('id')
self.assertEqual('New Name', body.get('name'))
@@ -45,19 +45,19 @@
# Now try uploading an image file
image_file = StringIO.StringIO(data_utils.random_bytes())
- _, body = self.client.update_image(image_id, data=image_file)
+ body = self.client.update_image(image_id, data=image_file)
self.assertIn('size', body)
self.assertEqual(1024, body.get('size'))
@test.attr(type='gate')
def test_register_remote_image(self):
# Register a new remote image
- _, body = self.create_image(name='New Remote Image',
- container_format='bare',
- disk_format='raw', is_public=False,
- location=CONF.image.http_image,
- properties={'key1': 'value1',
- 'key2': 'value2'})
+ body = self.create_image(name='New Remote Image',
+ container_format='bare',
+ disk_format='raw', is_public=False,
+ location=CONF.image.http_image,
+ properties={'key1': 'value1',
+ 'key2': 'value2'})
self.assertIn('id', body)
self.assertEqual('New Remote Image', body.get('name'))
self.assertFalse(body.get('is_public'))
@@ -68,10 +68,10 @@
@test.attr(type='gate')
def test_register_http_image(self):
- _, body = self.create_image(name='New Http Image',
- container_format='bare',
- disk_format='raw', is_public=False,
- copy_from=CONF.image.http_image)
+ body = self.create_image(name='New Http Image',
+ container_format='bare',
+ disk_format='raw', is_public=False,
+ copy_from=CONF.image.http_image)
self.assertIn('id', body)
image_id = body.get('id')
self.assertEqual('New Http Image', body.get('name'))
@@ -83,12 +83,12 @@
def test_register_image_with_min_ram(self):
# Register an image with min ram
properties = {'prop1': 'val1'}
- _, body = self.create_image(name='New_image_with_min_ram',
- container_format='bare',
- disk_format='raw',
- is_public=False,
- min_ram=40,
- properties=properties)
+ body = self.create_image(name='New_image_with_min_ram',
+ container_format='bare',
+ disk_format='raw',
+ is_public=False,
+ min_ram=40,
+ properties=properties)
self.assertIn('id', body)
self.assertEqual('New_image_with_min_ram', body.get('name'))
self.assertFalse(body.get('is_public'))
@@ -140,11 +140,11 @@
"""
name = 'New Remote Image %s' % name
location = CONF.image.http_image
- _, image = cls.create_image(name=name,
- container_format=container_format,
- disk_format=disk_format,
- is_public=False,
- location=location)
+ image = cls.create_image(name=name,
+ container_format=container_format,
+ disk_format=disk_format,
+ is_public=False,
+ location=location)
image_id = image['id']
return image_id
@@ -158,24 +158,24 @@
"""
image_file = StringIO.StringIO(data_utils.random_bytes(size))
name = 'New Standard Image %s' % name
- _, image = cls.create_image(name=name,
- container_format=container_format,
- disk_format=disk_format,
- is_public=False, data=image_file)
+ image = cls.create_image(name=name,
+ container_format=container_format,
+ disk_format=disk_format,
+ is_public=False, data=image_file)
image_id = image['id']
return image_id
@test.attr(type='gate')
def test_index_no_params(self):
# Simple test to see all fixture images returned
- _, images_list = self.client.image_list()
+ images_list = self.client.image_list()
image_list = map(lambda x: x['id'], images_list)
for image_id in self.created_images:
self.assertIn(image_id, image_list)
@test.attr(type='gate')
def test_index_disk_format(self):
- _, images_list = self.client.image_list(disk_format='ami')
+ images_list = self.client.image_list(disk_format='ami')
for image in images_list:
self.assertEqual(image['disk_format'], 'ami')
result_set = set(map(lambda x: x['id'], images_list))
@@ -184,7 +184,7 @@
@test.attr(type='gate')
def test_index_container_format(self):
- _, images_list = self.client.image_list(container_format='bare')
+ images_list = self.client.image_list(container_format='bare')
for image in images_list:
self.assertEqual(image['container_format'], 'bare')
result_set = set(map(lambda x: x['id'], images_list))
@@ -193,7 +193,7 @@
@test.attr(type='gate')
def test_index_max_size(self):
- _, images_list = self.client.image_list(size_max=42)
+ images_list = self.client.image_list(size_max=42)
for image in images_list:
self.assertTrue(image['size'] <= 42)
result_set = set(map(lambda x: x['id'], images_list))
@@ -202,7 +202,7 @@
@test.attr(type='gate')
def test_index_min_size(self):
- _, images_list = self.client.image_list(size_min=142)
+ images_list = self.client.image_list(size_min=142)
for image in images_list:
self.assertTrue(image['size'] >= 142)
result_set = set(map(lambda x: x['id'], images_list))
@@ -211,9 +211,9 @@
@test.attr(type='gate')
def test_index_status_active_detail(self):
- _, images_list = self.client.image_list_detail(status='active',
- sort_key='size',
- sort_dir='desc')
+ images_list = self.client.image_list_detail(status='active',
+ sort_key='size',
+ sort_dir='desc')
top_size = images_list[0]['size'] # We have non-zero sized images
for image in images_list:
size = image['size']
@@ -223,7 +223,7 @@
@test.attr(type='gate')
def test_index_name(self):
- _, images_list = self.client.image_list_detail(
+ images_list = self.client.image_list_detail(
name='New Remote Image dup')
result_set = set(map(lambda x: x['id'], images_list))
for image in images_list:
@@ -247,18 +247,18 @@
"""
image_file = StringIO.StringIO(data_utils.random_bytes(size))
name = 'New Standard Image %s' % name
- _, image = cls.create_image(name=name,
- container_format=container_format,
- disk_format=disk_format,
- is_public=False, data=image_file,
- properties={'key1': 'value1'})
+ image = cls.create_image(name=name,
+ container_format=container_format,
+ disk_format=disk_format,
+ is_public=False, data=image_file,
+ properties={'key1': 'value1'})
image_id = image['id']
return image_id
@test.attr(type='gate')
def test_list_image_metadata(self):
# All metadata key/value pairs for an image should be returned
- _, resp_metadata = self.client.get_image_meta(self.image_id)
+ resp_metadata = self.client.get_image_meta(self.image_id)
expected = {'key1': 'value1'}
self.assertEqual(expected, resp_metadata['properties'])
@@ -266,12 +266,12 @@
def test_update_image_metadata(self):
# The metadata for the image should match the updated values
req_metadata = {'key1': 'alt1', 'key2': 'value2'}
- _, metadata = self.client.get_image_meta(self.image_id)
+ metadata = self.client.get_image_meta(self.image_id)
self.assertEqual(metadata['properties'], {'key1': 'value1'})
metadata['properties'].update(req_metadata)
- _, metadata = self.client.update_image(
+ metadata = self.client.update_image(
self.image_id, properties=metadata['properties'])
- _, resp_metadata = self.client.get_image_meta(self.image_id)
+ resp_metadata = self.client.get_image_meta(self.image_id)
expected = {'key1': 'alt1', 'key2': 'value2'}
self.assertEqual(expected, resp_metadata['properties'])
diff --git a/tempest/api/image/v2/test_images.py b/tempest/api/image/v2/test_images.py
index 7e018e5..e307c5c 100644
--- a/tempest/api/image/v2/test_images.py
+++ b/tempest/api/image/v2/test_images.py
@@ -37,11 +37,11 @@
uuid = '00000000-1111-2222-3333-444455556666'
image_name = data_utils.rand_name('image')
- _, body = self.create_image(name=image_name,
- container_format='bare',
- disk_format='raw',
- visibility='private',
- ramdisk_id=uuid)
+ body = self.create_image(name=image_name,
+ container_format='bare',
+ disk_format='raw',
+ visibility='private',
+ ramdisk_id=uuid)
self.assertIn('id', body)
image_id = body.get('id')
self.assertIn('name', body)
@@ -57,7 +57,7 @@
self.client.store_image(image_id, image_file)
# Now try to get image details
- _, body = self.client.get_image(image_id)
+ body = self.client.get_image(image_id)
self.assertEqual(image_id, body['id'])
self.assertEqual(image_name, body['name'])
self.assertEqual(uuid, body['ramdisk_id'])
@@ -74,10 +74,10 @@
# Create image
image_name = data_utils.rand_name('image')
- _, body = self.client.create_image(name=image_name,
- container_format='bare',
- disk_format='raw',
- visibility='private')
+ body = self.client.create_image(name=image_name,
+ container_format='bare',
+ disk_format='raw',
+ visibility='private')
image_id = body['id']
# Delete Image
@@ -85,7 +85,7 @@
self.client.wait_for_resource_deletion(image_id)
# Verifying deletion
- _, images = self.client.image_list()
+ images = self.client.image_list()
images_id = [item['id'] for item in images]
self.assertNotIn(image_id, images_id)
@@ -95,10 +95,10 @@
# Create image
image_name = data_utils.rand_name('image')
- _, body = self.client.create_image(name=image_name,
- container_format='bare',
- disk_format='iso',
- visibility='private')
+ body = self.client.create_image(name=image_name,
+ container_format='bare',
+ disk_format='iso',
+ visibility='private')
self.addCleanup(self.client.delete_image, body['id'])
self.assertEqual('queued', body['status'])
image_id = body['id']
@@ -109,12 +109,12 @@
# Update Image
new_image_name = data_utils.rand_name('new-image')
- _, body = self.client.update_image(image_id, [
+ body = self.client.update_image(image_id, [
dict(replace='/name', value=new_image_name)])
# Verifying updating
- _, body = self.client.get_image(image_id)
+ body = self.client.get_image(image_id)
self.assertEqual(image_id, body['id'])
self.assertEqual(new_image_name, body['name'])
@@ -147,10 +147,10 @@
size = random.randint(1024, 4096)
image_file = StringIO.StringIO(data_utils.random_bytes(size))
name = data_utils.rand_name('image-')
- _, body = cls.create_image(name=name,
- container_format=container_format,
- disk_format=disk_format,
- visibility='private')
+ body = cls.create_image(name=name,
+ container_format=container_format,
+ disk_format=disk_format,
+ visibility='private')
image_id = body['id']
cls.client.store_image(image_id, data=image_file)
@@ -160,7 +160,7 @@
"""
Perform list action with given params and validates result.
"""
- _, images_list = self.client.image_list(params=params)
+ images_list = self.client.image_list(params=params)
# Validating params of fetched images
for image in images_list:
for key in params:
@@ -170,7 +170,7 @@
@test.attr(type='gate')
def test_index_no_params(self):
# Simple test to see all fixture images returned
- _, images_list = self.client.image_list()
+ images_list = self.client.image_list()
image_list = map(lambda x: x['id'], images_list)
for image in self.created_images:
@@ -199,7 +199,7 @@
# Test to get all images by size
image_id = self.created_images[1]
# Get image metadata
- _, image = self.client.get_image(image_id)
+ image = self.client.get_image(image_id)
params = {"size": image['size']}
self._list_by_param_value_and_assert(params)
@@ -209,11 +209,11 @@
# Test to get all images with size between 2000 to 3000
image_id = self.created_images[1]
# Get image metadata
- _, image = self.client.get_image(image_id)
+ image = self.client.get_image(image_id)
size = image['size']
params = {"size_min": size - 500, "size_max": size + 500}
- _, images_list = self.client.image_list(params=params)
+ images_list = self.client.image_list(params=params)
image_size_list = map(lambda x: x['size'], images_list)
for image_size in image_size_list:
@@ -231,7 +231,7 @@
def test_list_images_param_limit(self):
# Test to get images by limit
params = {"limit": 2}
- _, images_list = self.client.image_list(params=params)
+ images_list = self.client.image_list(params=params)
self.assertEqual(len(images_list), params['limit'],
"Failed to get images by limit")
@@ -240,12 +240,12 @@
def test_get_image_schema(self):
# Test to get image schema
schema = "image"
- _, body = self.client.get_schema(schema)
+ body = self.client.get_schema(schema)
self.assertEqual("image", body['name'])
@test.attr(type='gate')
def test_get_images_schema(self):
# Test to get images schema
schema = "images"
- _, body = self.client.get_schema(schema)
+ body = self.client.get_schema(schema)
self.assertEqual("images", body['name'])
diff --git a/tempest/api/image/v2/test_images_member.py b/tempest/api/image/v2/test_images_member.py
index 5aaf578..ec1cf14 100644
--- a/tempest/api/image/v2/test_images_member.py
+++ b/tempest/api/image/v2/test_images_member.py
@@ -20,8 +20,8 @@
@test.attr(type='gate')
def test_image_share_accept(self):
image_id = self._create_image()
- _, member = self.os_img_client.add_member(image_id,
- self.alt_tenant_id)
+ member = self.os_img_client.add_member(image_id,
+ self.alt_tenant_id)
self.assertEqual(member['member_id'], self.alt_tenant_id)
self.assertEqual(member['image_id'], image_id)
self.assertEqual(member['status'], 'pending')
@@ -30,7 +30,7 @@
self.alt_tenant_id,
'accepted')
self.assertIn(image_id, self._list_image_ids_as_alt())
- _, body = self.os_img_client.get_image_membership(image_id)
+ body = self.os_img_client.get_image_membership(image_id)
members = body['members']
member = members[0]
self.assertEqual(len(members), 1, str(members))
@@ -41,8 +41,8 @@
@test.attr(type='gate')
def test_image_share_reject(self):
image_id = self._create_image()
- _, member = self.os_img_client.add_member(image_id,
- self.alt_tenant_id)
+ member = self.os_img_client.add_member(image_id,
+ self.alt_tenant_id)
self.assertEqual(member['member_id'], self.alt_tenant_id)
self.assertEqual(member['image_id'], image_id)
self.assertEqual(member['status'], 'pending')
@@ -62,8 +62,8 @@
'accepted')
self.assertIn(image_id, self._list_image_ids_as_alt())
- _, member = self.os_img_client.get_member(image_id,
- self.alt_tenant_id)
+ member = self.os_img_client.get_member(image_id,
+ self.alt_tenant_id)
self.assertEqual(self.alt_tenant_id, member['member_id'])
self.assertEqual(image_id, member['image_id'])
self.assertEqual('accepted', member['status'])
@@ -83,10 +83,10 @@
@test.attr(type='gate')
def test_get_image_member_schema(self):
- _, body = self.os_img_client.get_schema("member")
+ body = self.os_img_client.get_schema("member")
self.assertEqual("member", body['name'])
@test.attr(type='gate')
def test_get_image_members_schema(self):
- _, body = self.os_img_client.get_schema("members")
+ body = self.os_img_client.get_schema("members")
self.assertEqual("members", body['name'])
diff --git a/tempest/api/image/v2/test_images_member_negative.py b/tempest/api/image/v2/test_images_member_negative.py
index 7da6e65..1f8e3d0 100644
--- a/tempest/api/image/v2/test_images_member_negative.py
+++ b/tempest/api/image/v2/test_images_member_negative.py
@@ -21,8 +21,8 @@
@test.attr(type=['negative', 'gate'])
def test_image_share_invalid_status(self):
image_id = self._create_image()
- _, member = self.os_img_client.add_member(image_id,
- self.alt_tenant_id)
+ member = self.os_img_client.add_member(image_id,
+ self.alt_tenant_id)
self.assertEqual(member['status'], 'pending')
self.assertRaises(exceptions.BadRequest,
self.alt_img_client.update_member_status,
@@ -31,8 +31,8 @@
@test.attr(type=['negative', 'gate'])
def test_image_share_owner_cannot_accept(self):
image_id = self._create_image()
- _, member = self.os_img_client.add_member(image_id,
- self.alt_tenant_id)
+ member = self.os_img_client.add_member(image_id,
+ self.alt_tenant_id)
self.assertEqual(member['status'], 'pending')
self.assertNotIn(image_id, self._list_image_ids_as_alt())
self.assertRaises(exceptions.Unauthorized,
diff --git a/tempest/api/image/v2/test_images_negative.py b/tempest/api/image/v2/test_images_negative.py
index 722929e..fc781b1 100644
--- a/tempest/api/image/v2/test_images_negative.py
+++ b/tempest/api/image/v2/test_images_negative.py
@@ -52,9 +52,9 @@
def test_get_delete_deleted_image(self):
# get and delete the deleted image
# create and delete image
- _, body = self.client.create_image(name='test',
- container_format='bare',
- disk_format='raw')
+ body = self.client.create_image(name='test',
+ container_format='bare',
+ disk_format='raw')
image_id = body['id']
self.client.delete_image(image_id)
self.client.wait_for_resource_deletion(image_id)
diff --git a/tempest/api/image/v2/test_images_tags.py b/tempest/api/image/v2/test_images_tags.py
index a9db24b..4686de2 100644
--- a/tempest/api/image/v2/test_images_tags.py
+++ b/tempest/api/image/v2/test_images_tags.py
@@ -21,19 +21,19 @@
@test.attr(type='gate')
def test_update_delete_tags_for_image(self):
- _, body = self.create_image(container_format='bare',
- disk_format='raw',
- visibility='private')
+ body = self.create_image(container_format='bare',
+ disk_format='raw',
+ visibility='private')
image_id = body['id']
tag = data_utils.rand_name('tag-')
self.addCleanup(self.client.delete_image, image_id)
# Creating image tag and verify it.
self.client.add_image_tag(image_id, tag)
- _, body = self.client.get_image(image_id)
+ body = self.client.get_image(image_id)
self.assertIn(tag, body['tags'])
# Deleting image tag and verify it.
self.client.delete_image_tag(image_id, tag)
- _, body = self.client.get_image(image_id)
+ body = self.client.get_image(image_id)
self.assertNotIn(tag, body['tags'])
diff --git a/tempest/api/image/v2/test_images_tags_negative.py b/tempest/api/image/v2/test_images_tags_negative.py
index 8e42b7c..aa0a214 100644
--- a/tempest/api/image/v2/test_images_tags_negative.py
+++ b/tempest/api/image/v2/test_images_tags_negative.py
@@ -33,10 +33,10 @@
@test.attr(type=['negative', 'gate'])
def test_delete_non_existing_tag(self):
# Delete non existing tag.
- _, body = self.create_image(container_format='bare',
- disk_format='raw',
- visibility='private'
- )
+ body = self.create_image(container_format='bare',
+ disk_format='raw',
+ visibility='private'
+ )
image_id = body['id']
tag = data_utils.rand_name('non-exist-tag-')
self.addCleanup(self.client.delete_image, image_id)
diff --git a/tempest/api/network/test_floating_ips_negative.py b/tempest/api/network/test_floating_ips_negative.py
new file mode 100644
index 0000000..82f0519
--- /dev/null
+++ b/tempest/api/network/test_floating_ips_negative.py
@@ -0,0 +1,78 @@
+# Copyright 2014 Hewlett-Packard Development Company, L.P.
+# Copyright 2014 OpenStack Foundation
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from tempest.api.network import base
+from tempest.common.utils import data_utils
+from tempest import config
+from tempest import exceptions
+from tempest import test
+
+CONF = config.CONF
+
+
+class FloatingIPNegativeTestJSON(base.BaseNetworkTest):
+ _interface = 'json'
+ """
+ Test the following negative operations for floating ips:
+
+ Create floatingip with a port that is unreachable to external network
+ Create floatingip in private network
+ Associate floatingip with port that is unreachable to external network
+ """
+
+ @classmethod
+ def resource_setup(cls):
+ super(FloatingIPNegativeTestJSON, cls).resource_setup()
+ if not test.is_extension_enabled('router', 'network'):
+ msg = "router extension not enabled."
+ raise cls.skipException(msg)
+ cls.ext_net_id = CONF.network.public_network_id
+ # Create a network with a subnet connected to a router.
+ cls.network = cls.create_network()
+ cls.subnet = cls.create_subnet(cls.network)
+ cls.router = cls.create_router(data_utils.rand_name('router'))
+ cls.create_router_interface(cls.router['id'], cls.subnet['id'])
+ cls.port = cls.create_port(cls.network)
+
+ @test.attr(type=['negative', 'smoke'])
+ def test_create_floatingip_with_port_ext_net_unreachable(self):
+ self.assertRaises(exceptions.NotFound, self.client.create_floatingip,
+ floating_network_id=self.ext_net_id,
+ port_id=self.port['id'],
+ fixed_ip_address=self.port['fixed_ips'][0]
+ ['ip_address'])
+
+ @test.attr(type=['negative', 'smoke'])
+ def test_create_floatingip_in_private_network(self):
+ self.assertRaises(exceptions.BadRequest,
+ self.client.create_floatingip,
+ floating_network_id=self.network['id'],
+ port_id=self.port['id'],
+ fixed_ip_address=self.port['fixed_ips'][0]
+ ['ip_address'])
+
+ @test.attr(type=['negative', 'smoke'])
+ def test_associate_floatingip_port_ext_net_unreachable(self):
+ # Create floating ip
+ body = self.client.create_floatingip(
+ floating_network_id=self.ext_net_id)
+ floating_ip = body['floatingip']
+ self.addCleanup(self.client.delete_floatingip, floating_ip['id'])
+ # Associate floating IP to the other port
+ self.assertRaises(exceptions.NotFound, self.client.update_floatingip,
+ floating_ip['id'], port_id=self.port['id'],
+ fixed_ip_address=self.port['fixed_ips'][0]
+ ['ip_address'])
diff --git a/tempest/api/network/test_load_balancer.py b/tempest/api/network/test_load_balancer.py
index 289da7e..b606115 100644
--- a/tempest/api/network/test_load_balancer.py
+++ b/tempest/api/network/test_load_balancer.py
@@ -422,5 +422,6 @@
self.assertEqual(2, member['weight'])
+@test.skip_because(bug="1402007")
class LoadBalancerIpV6TestJSON(LoadBalancerTestJSON):
_ip_version = 6
diff --git a/tempest/api/network/test_routers_negative.py b/tempest/api/network/test_routers_negative.py
index 88aa3c9..d571e92 100644
--- a/tempest/api/network/test_routers_negative.py
+++ b/tempest/api/network/test_routers_negative.py
@@ -83,6 +83,24 @@
self.client.delete_router,
self.router['id'])
+ @test.attr(type=['negative', 'smoke'])
+ def test_show_non_existent_router_returns_404(self):
+ router = data_utils.rand_name('non_exist_router')
+ self.assertRaises(exceptions.NotFound, self.client.show_router,
+ router)
+
+ @test.attr(type=['negative', 'smoke'])
+ def test_update_non_existent_router_returns_404(self):
+ router = data_utils.rand_name('non_exist_router')
+ self.assertRaises(exceptions.NotFound, self.client.update_router,
+ router, name="new_name")
+
+ @test.attr(type=['negative', 'smoke'])
+ def test_delete_non_existent_router_returns_404(self):
+ router = data_utils.rand_name('non_exist_router')
+ self.assertRaises(exceptions.NotFound, self.client.delete_router,
+ router)
+
class RoutersNegativeIpV6Test(RoutersNegativeTest):
_ip_version = 6
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index c4720cb..36c9f5a 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -46,10 +46,8 @@
cls.object_client = cls.os.object_client
cls.container_client = cls.os.container_client
cls.account_client = cls.os.account_client
- cls.custom_object_client = cls.os.custom_object_client
cls.token_client = cls.os_admin.token_client
cls.identity_admin_client = cls.os_admin.identity_client
- cls.custom_account_client = cls.os.custom_account_client
cls.object_client_alt = cls.os_alt.object_client
cls.container_client_alt = cls.os_alt.container_client
cls.identity_client_alt = cls.os_alt.identity_client
@@ -58,8 +56,6 @@
cls.object_client.auth_provider.clear_auth()
cls.container_client.auth_provider.clear_auth()
cls.account_client.auth_provider.clear_auth()
- cls.custom_object_client.auth_provider.clear_auth()
- cls.custom_account_client.auth_provider.clear_auth()
cls.object_client_alt.auth_provider.clear_auth()
cls.container_client_alt.auth_provider.clear_auth()
diff --git a/tempest/api/object_storage/test_account_quotas.py b/tempest/api/object_storage/test_account_quotas.py
index e75e971..1832b37 100644
--- a/tempest/api/object_storage/test_account_quotas.py
+++ b/tempest/api/object_storage/test_account_quotas.py
@@ -43,30 +43,30 @@
def setUp(self):
super(AccountQuotasTest, self).setUp()
- # Set the reselleradmin auth in headers for next custom_account_client
+ # Set the reselleradmin auth in headers for next account_client
# request
- self.custom_account_client.auth_provider.set_alt_auth_data(
+ self.account_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.reselleradmin_auth_data
)
# Set a quota of 20 bytes on the user's account before each test
headers = {"X-Account-Meta-Quota-Bytes": "20"}
- self.os.custom_account_client.request("POST", url="", headers=headers,
- body="")
+ self.os.account_client.request("POST", url="", headers=headers,
+ body="")
def tearDown(self):
- # Set the reselleradmin auth in headers for next custom_account_client
+ # Set the reselleradmin auth in headers for next account_client
# request
- self.custom_account_client.auth_provider.set_alt_auth_data(
+ self.account_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.reselleradmin_auth_data
)
# remove the quota from the container
headers = {"X-Remove-Account-Meta-Quota-Bytes": "x"}
- self.os.custom_account_client.request("POST", url="", headers=headers,
- body="")
+ self.os.account_client.request("POST", url="", headers=headers,
+ body="")
super(AccountQuotasTest, self).tearDown()
@classmethod
@@ -91,7 +91,7 @@
"""Test that the ResellerAdmin is able to modify and remove the quota
on a user's account.
- Using the custom_account client, the test modifies the quota
+ Using the account client, the test modifies the quota
successively to:
* "25": a random value different from the initial quota value.
@@ -100,15 +100,15 @@
"""
for quota in ("25", "", "20"):
- self.custom_account_client.auth_provider.set_alt_auth_data(
+ self.account_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.reselleradmin_auth_data
)
headers = {"X-Account-Meta-Quota-Bytes": quota}
- resp, _ = self.os.custom_account_client.request("POST", url="",
- headers=headers,
- body="")
+ resp, _ = self.os.account_client.request("POST", url="",
+ headers=headers,
+ body="")
self.assertEqual(resp["status"], "204")
self.assertHeaders(resp, 'Account', 'POST')
diff --git a/tempest/api/object_storage/test_account_quotas_negative.py b/tempest/api/object_storage/test_account_quotas_negative.py
index 6c1fb5a..a6ea6ee 100644
--- a/tempest/api/object_storage/test_account_quotas_negative.py
+++ b/tempest/api/object_storage/test_account_quotas_negative.py
@@ -43,30 +43,30 @@
def setUp(self):
super(AccountQuotasNegativeTest, self).setUp()
- # Set the reselleradmin auth in headers for next custom_account_client
+ # Set the reselleradmin auth in headers for next account_client
# request
- self.custom_account_client.auth_provider.set_alt_auth_data(
+ self.account_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.reselleradmin_auth_data
)
# Set a quota of 20 bytes on the user's account before each test
headers = {"X-Account-Meta-Quota-Bytes": "20"}
- self.os.custom_account_client.request("POST", url="", headers=headers,
- body="")
+ self.os.account_client.request("POST", url="", headers=headers,
+ body="")
def tearDown(self):
- # Set the reselleradmin auth in headers for next custom_account_client
+ # Set the reselleradmin auth in headers for next account_client
# request
- self.custom_account_client.auth_provider.set_alt_auth_data(
+ self.account_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.reselleradmin_auth_data
)
# remove the quota from the container
headers = {"X-Remove-Account-Meta-Quota-Bytes": "x"}
- self.os.custom_account_client.request("POST", url="", headers=headers,
- body="")
+ self.os.account_client.request("POST", url="", headers=headers,
+ body="")
super(AccountQuotasNegativeTest, self).tearDown()
@classmethod
diff --git a/tempest/api/object_storage/test_account_services_negative.py b/tempest/api/object_storage/test_account_services_negative.py
index e4c46e2..ef04387 100644
--- a/tempest/api/object_storage/test_account_services_negative.py
+++ b/tempest/api/object_storage/test_account_services_negative.py
@@ -34,10 +34,10 @@
test_auth_provider.auth_data
# Get fresh auth for test user and set it to next auth request for
- # custom_account_client
+ # account_client
delattr(test_auth_provider, 'auth_data')
test_auth_new_data = test_auth_provider.auth_data
- self.custom_account_client.auth_provider.set_alt_auth_data(
+ self.account_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=test_auth_new_data
)
@@ -45,5 +45,5 @@
params = {'format': 'json'}
# list containers with non-authorized user token
self.assertRaises(exceptions.Unauthorized,
- self.custom_account_client.list_account_containers,
+ self.account_client.list_account_containers,
params=params)
diff --git a/tempest/api/object_storage/test_container_acl.py b/tempest/api/object_storage/test_container_acl.py
index 2244900..205bc91 100644
--- a/tempest/api/object_storage/test_container_acl.py
+++ b/tempest/api/object_storage/test_container_acl.py
@@ -52,11 +52,11 @@
object_name, 'data')
self.assertHeaders(resp, 'Object', 'PUT')
# Trying to read the object with rights
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.test_auth_data
)
- resp, _ = self.custom_object_client.get_object(
+ resp, _ = self.object_client.get_object(
self.container_name, object_name)
self.assertHeaders(resp, 'Object', 'GET')
@@ -71,12 +71,12 @@
metadata_prefix='')
self.assertHeaders(resp_meta, 'Container', 'POST')
# Trying to write the object with rights
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.test_auth_data
)
object_name = data_utils.rand_name(name='Object')
- resp, _ = self.custom_object_client.create_object(
+ resp, _ = self.object_client.create_object(
self.container_name,
- object_name, 'data')
+ object_name, 'data', headers={})
self.assertHeaders(resp, 'Object', 'PUT')
diff --git a/tempest/api/object_storage/test_container_acl_negative.py b/tempest/api/object_storage/test_container_acl_negative.py
index fed4549..138d25a 100644
--- a/tempest/api/object_storage/test_container_acl_negative.py
+++ b/tempest/api/object_storage/test_container_acl_negative.py
@@ -43,13 +43,13 @@
# trying to create object with empty headers
# X-Auth-Token is not provided
object_name = data_utils.rand_name(name='Object')
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=None
)
self.assertRaises(exceptions.Unauthorized,
- self.custom_object_client.create_object,
- self.container_name, object_name, 'data')
+ self.object_client.create_object,
+ self.container_name, object_name, 'data', headers={})
@test.attr(type=['negative', 'gate'])
def test_delete_object_without_using_creds(self):
@@ -59,12 +59,12 @@
object_name, 'data')
# trying to delete object with empty headers
# X-Auth-Token is not provided
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=None
)
self.assertRaises(exceptions.Unauthorized,
- self.custom_object_client.delete_object,
+ self.object_client.delete_object,
self.container_name, object_name)
@test.attr(type=['negative', 'gate'])
@@ -73,13 +73,13 @@
# User provided token is forbidden. ACL are not set
object_name = data_utils.rand_name(name='Object')
# trying to create object with non-authorized user
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.test_auth_data
)
self.assertRaises(exceptions.Unauthorized,
- self.custom_object_client.create_object,
- self.container_name, object_name, 'data')
+ self.object_client.create_object,
+ self.container_name, object_name, 'data', headers={})
@test.attr(type=['negative', 'gate'])
def test_read_object_with_non_authorized_user(self):
@@ -90,12 +90,12 @@
self.container_name, object_name, 'data')
self.assertHeaders(resp, 'Object', 'PUT')
# trying to get object with non authorized user token
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.test_auth_data
)
self.assertRaises(exceptions.Unauthorized,
- self.custom_object_client.get_object,
+ self.object_client.get_object,
self.container_name, object_name)
@test.attr(type=['negative', 'gate'])
@@ -107,12 +107,12 @@
self.container_name, object_name, 'data')
self.assertHeaders(resp, 'Object', 'PUT')
# trying to delete object with non-authorized user token
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.test_auth_data
)
self.assertRaises(exceptions.Unauthorized,
- self.custom_object_client.delete_object,
+ self.object_client.delete_object,
self.container_name, object_name)
@test.attr(type=['negative', 'smoke'])
@@ -130,12 +130,12 @@
object_name, 'data')
self.assertHeaders(resp, 'Object', 'PUT')
# Trying to read the object without rights
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.test_auth_data
)
self.assertRaises(exceptions.Unauthorized,
- self.custom_object_client.get_object,
+ self.object_client.get_object,
self.container_name, object_name)
@test.attr(type=['negative', 'smoke'])
@@ -148,15 +148,15 @@
metadata_prefix='')
self.assertHeaders(resp_meta, 'Container', 'POST')
# Trying to write the object without rights
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.test_auth_data
)
object_name = data_utils.rand_name(name='Object')
self.assertRaises(exceptions.Unauthorized,
- self.custom_object_client.create_object,
+ self.object_client.create_object,
self.container_name,
- object_name, 'data')
+ object_name, 'data', headers={})
@test.attr(type=['negative', 'smoke'])
def test_write_object_without_write_rights(self):
@@ -170,15 +170,15 @@
metadata_prefix='')
self.assertHeaders(resp_meta, 'Container', 'POST')
# Trying to write the object without write rights
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.test_auth_data
)
object_name = data_utils.rand_name(name='Object')
self.assertRaises(exceptions.Unauthorized,
- self.custom_object_client.create_object,
+ self.object_client.create_object,
self.container_name,
- object_name, 'data')
+ object_name, 'data', headers={})
@test.attr(type=['negative', 'smoke'])
def test_delete_object_without_write_rights(self):
@@ -197,11 +197,11 @@
object_name, 'data')
self.assertHeaders(resp, 'Object', 'PUT')
# Trying to delete the object without write rights
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=self.test_auth_data
)
self.assertRaises(exceptions.Unauthorized,
- self.custom_object_client.delete_object,
+ self.object_client.delete_object,
self.container_name,
object_name)
diff --git a/tempest/api/object_storage/test_container_staticweb.py b/tempest/api/object_storage/test_container_staticweb.py
index 5c4e0bf..a8e5f9a 100644
--- a/tempest/api/object_storage/test_container_staticweb.py
+++ b/tempest/api/object_storage/test_container_staticweb.py
@@ -17,6 +17,7 @@
from tempest.api.object_storage import base
from tempest.common import custom_matchers
from tempest.common.utils import data_utils
+from tempest import exceptions
from tempest import test
@@ -58,15 +59,16 @@
self.container_name, metadata=headers)
# Maintain original headers, no auth added
- self.custom_account_client.auth_provider.set_alt_auth_data(
+ self.account_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=None
)
# test GET on http://account_url/container_name
# we should retrieve the self.object_name file
- resp, body = self.custom_account_client.request("GET",
- self.container_name)
+ resp, body = self.account_client.request("GET",
+ self.container_name,
+ headers={})
# This request is equivalent to GET object
self.assertHeaders(resp, 'Object', 'GET')
self.assertEqual(body, self.object_data)
@@ -89,8 +91,9 @@
# test GET on http://account_url/container_name
# we should retrieve a listing of objects
- resp, body = self.custom_account_client.request("GET",
- self.container_name)
+ resp, body = self.account_client.request("GET",
+ self.container_name,
+ headers={})
# The target of the request is not any Swift resource. Therefore, the
# existence of response header is checked without a custom matcher.
self.assertIn('content-length', resp)
@@ -120,15 +123,16 @@
self.container_name, metadata=headers)
# Maintain original headers, no auth added
- self.custom_account_client.auth_provider.set_alt_auth_data(
+ self.account_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=None
)
# test GET on http://account_url/container_name
# we should retrieve a listing of objects
- resp, body = self.custom_account_client.request("GET",
- self.container_name)
+ resp, body = self.account_client.request("GET",
+ self.container_name,
+ headers={})
self.assertIn(self.object_name, body)
css = '<link rel="stylesheet" type="text/css" href="listings.css" />'
self.assertIn(css, body)
@@ -150,13 +154,12 @@
object_data_404)
# Do not set auth in HTTP headers for next request
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=None
)
# Request non-existing object
- resp, body = self.custom_object_client.get_object(self.container_name,
- "notexisting")
- self.assertEqual(resp['status'], '404')
- self.assertEqual(body, object_data_404)
+ self.assertRaises(
+ exceptions.NotFound, self.object_client.get_object,
+ self.container_name, "notexisting")
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index f78220c..cbca5e8 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -177,7 +177,7 @@
object_name = data_utils.rand_name(name='TestObject')
data = data_utils.arbitrary_string()
metadata = {'Expect': '100-continue'}
- resp = self.custom_object_client.create_object_continue(
+ resp = self.object_client.create_object_continue(
self.container_name,
object_name,
data,
@@ -186,7 +186,7 @@
self.assertIn('status', resp)
self.assertEqual(resp['status'], '100')
- self.custom_object_client.create_object_continue(
+ self.object_client.create_object_continue(
self.container_name,
object_name,
data,
@@ -1014,11 +1014,11 @@
self.assertEqual(resp_meta['x-container-read'], '.r:*,.rlistings')
# trying to get object with empty headers as it is public readable
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=None
)
- resp, body = self.custom_object_client.get_object(
+ resp, body = self.object_client.get_object(
self.container_name, object_name)
self.assertHeaders(resp, 'Object', 'GET')
@@ -1052,12 +1052,12 @@
# get auth token of alternative user
alt_auth_data = self.identity_client_alt.auth_provider.auth_data
- self.custom_object_client.auth_provider.set_alt_auth_data(
+ self.object_client.auth_provider.set_alt_auth_data(
request_part='headers',
auth_data=alt_auth_data
)
# access object using alternate user creds
- resp, body = self.custom_object_client.get_object(
+ resp, body = self.object_client.get_object(
self.container_name, object_name)
self.assertHeaders(resp, 'Object', 'GET')
diff --git a/tempest/api/orchestration/base.py b/tempest/api/orchestration/base.py
index 6896362..21f2578 100644
--- a/tempest/api/orchestration/base.py
+++ b/tempest/api/orchestration/base.py
@@ -113,9 +113,9 @@
def _create_image(cls, name_start='image-heat-', container_format='bare',
disk_format='iso'):
image_name = data_utils.rand_name(name_start)
- _, body = cls.images_v2_client.create_image(image_name,
- container_format,
- disk_format)
+ body = cls.images_v2_client.create_image(image_name,
+ container_format,
+ disk_format)
image_id = body['id']
cls.images.append(image_id)
return body
diff --git a/tempest/clients.py b/tempest/clients.py
index 99339c1..8d59742 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -14,7 +14,7 @@
# under the License.
from tempest import auth
-from tempest.common import rest_client
+from tempest.common import negative_rest_client
from tempest import config
from tempest import manager
from tempest.openstack.common import log as logging
@@ -83,12 +83,8 @@
MessagingClientJSON
from tempest.services.network.json.network_client import NetworkClientJSON
from tempest.services.object_storage.account_client import AccountClient
-from tempest.services.object_storage.account_client import \
- AccountClientCustomizedHeader
from tempest.services.object_storage.container_client import ContainerClient
from tempest.services.object_storage.object_client import ObjectClient
-from tempest.services.object_storage.object_client import \
- ObjectClientCustomizedHeader
from tempest.services.orchestration.json.orchestration_client import \
OrchestrationClient
from tempest.services.telemetry.json.telemetry_client import \
@@ -157,7 +153,7 @@
if CONF.service_available.ceilometer:
self.telemetry_client = TelemetryClientJSON(
self.auth_provider)
- self.negative_client = rest_client.NegativeRestClient(
+ self.negative_client = negative_rest_client.NegativeRestClient(
self.auth_provider, service)
# TODO(andreaf) EC2 client still do their auth, v2 only
@@ -177,10 +173,6 @@
self.auth_provider)
self.ec2api_client = botoclients.APIClientEC2(*ec2_client_args)
self.s3_client = botoclients.ObjectClientS3(*ec2_client_args)
- self.custom_object_client = ObjectClientCustomizedHeader(
- self.auth_provider)
- self.custom_account_client = \
- AccountClientCustomizedHeader(self.auth_provider)
self.data_processing_client = DataProcessingClient(
self.auth_provider)
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 86df74c..227fbe6 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -845,7 +845,7 @@
def list(self):
client = self.client
- _, images = client.list_images({"all_tenants": True})
+ images = client.list_images({"all_tenants": True})
if not self.is_save_state:
images = [image for image in images if image['id']
not in self.saved_state_json['images'].keys()]
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index 17b6c19..001e3dc 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -528,7 +528,7 @@
def _get_image_by_name(client, name):
- r, body = client.images.image_list()
+ body = client.images.image_list()
for image in body:
if name == image['name']:
return image
@@ -551,19 +551,19 @@
extras = {}
if image['format'] == 'ami':
name, fname = _resolve_image(image, 'aki')
- r, aki = client.images.create_image(
+ aki = client.images.create_image(
'javelin_' + name, 'aki', 'aki')
client.images.store_image(aki.get('id'), open(fname, 'r'))
extras['kernel_id'] = aki.get('id')
name, fname = _resolve_image(image, 'ari')
- r, ari = client.images.create_image(
+ ari = client.images.create_image(
'javelin_' + name, 'ari', 'ari')
client.images.store_image(ari.get('id'), open(fname, 'r'))
extras['ramdisk_id'] = ari.get('id')
_, fname = _resolve_image(image, 'file')
- r, body = client.images.create_image(
+ body = client.images.create_image(
image['name'], image['format'], image['format'], **extras)
image_id = body.get('id')
client.images.store_image(image_id, open(fname, 'r'))
diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py
index abf8fc3..890c77a 100755
--- a/tempest/cmd/verify_tempest_config.py
+++ b/tempest/cmd/verify_tempest_config.py
@@ -59,7 +59,7 @@
def verify_glance_api_versions(os, update):
# Check glance api versions
- __, versions = os.image_client.get_versions()
+ versions = os.image_client.get_versions()
if CONF.image_feature_enabled.api_v1 != ('v1.1' in versions or 'v1.0' in
versions):
print_and_or_update('api_v1', 'image_feature_enabled',
diff --git a/tempest/common/negative_rest_client.py b/tempest/common/negative_rest_client.py
new file mode 100644
index 0000000..a9ae1c3
--- /dev/null
+++ b/tempest/common/negative_rest_client.py
@@ -0,0 +1,72 @@
+# (c) 2014 Deutsche Telekom AG
+# Copyright 2014 Red Hat, Inc.
+# Copyright 2014 NEC Corporation
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from tempest.common import rest_client
+from tempest import config
+
+CONF = config.CONF
+
+
+class NegativeRestClient(rest_client.RestClient):
+ """
+ Version of RestClient that does not raise exceptions.
+ """
+
+ def __init__(self, auth_provider, service):
+ region = self._get_region(service)
+ super(NegativeRestClient, self).__init__(auth_provider,
+ service, region)
+
+ def _get_region(self, service):
+ """
+ Returns the region for a specific service
+ """
+ service_region = None
+ for cfgname in dir(CONF._config):
+ # Find all config.FOO.catalog_type and assume FOO is a service.
+ cfg = getattr(CONF, cfgname)
+ catalog_type = getattr(cfg, 'catalog_type', None)
+ if catalog_type == service:
+ service_region = getattr(cfg, 'region', None)
+ if not service_region:
+ service_region = CONF.identity.region
+ return service_region
+
+ def _error_checker(self, method, url,
+ headers, body, resp, resp_body):
+ pass
+
+ def send_request(self, method, url_template, resources, body=None):
+ url = url_template % tuple(resources)
+ if method == "GET":
+ resp, body = self.get(url)
+ elif method == "POST":
+ resp, body = self.post(url, body)
+ elif method == "PUT":
+ resp, body = self.put(url, body)
+ elif method == "PATCH":
+ resp, body = self.patch(url, body)
+ elif method == "HEAD":
+ resp, body = self.head(url)
+ elif method == "DELETE":
+ resp, body = self.delete(url)
+ elif method == "COPY":
+ resp, body = self.copy(url)
+ else:
+ assert False
+
+ return resp, body
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index ca87a75..3802c9d 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -78,10 +78,12 @@
LOG = logging.getLogger(__name__)
- def __init__(self, auth_provider, service, endpoint_type='publicURL',
+ def __init__(self, auth_provider, service, region,
+ endpoint_type='publicURL',
build_interval=1, build_timeout=60):
self.auth_provider = auth_provider
self.service = service
+ self.region = region
self.endpoint_type = endpoint_type
self.build_interval = build_interval
self.build_timeout = build_timeout
@@ -124,21 +126,6 @@
str(self.token)[0:STRING_LIMIT],
str(self.get_headers())[0:STRING_LIMIT])
- def _get_region(self, service):
- """
- Returns the region for a specific service
- """
- service_region = None
- for cfgname in dir(CONF._config):
- # Find all config.FOO.catalog_type and assume FOO is a service.
- cfg = getattr(CONF, cfgname)
- catalog_type = getattr(cfg, 'catalog_type', None)
- if catalog_type == service:
- service_region = getattr(cfg, 'region', None)
- if not service_region:
- service_region = CONF.identity.region
- return service_region
-
@property
def user(self):
return self.auth_provider.credentials.username
@@ -172,7 +159,7 @@
_filters = dict(
service=self.service,
endpoint_type=self.endpoint_type,
- region=self._get_region(self.service)
+ region=self.region
)
if self.api_version is not None:
_filters['api_version'] = self.api_version
@@ -494,6 +481,11 @@
else:
raise exceptions.RateLimitExceeded(resp_body)
+ if resp.status == 415:
+ if parse_resp:
+ resp_body = self._parse_resp(resp_body)
+ raise exceptions.InvalidContentType(resp_body)
+
if resp.status == 422:
if parse_resp:
resp_body = self._parse_resp(resp_body)
@@ -603,33 +595,3 @@
except jsonschema.ValidationError as ex:
msg = ("HTTP response header is invalid (%s)") % ex
raise exceptions.InvalidHTTPResponseHeader(msg)
-
-
-class NegativeRestClient(RestClient):
- """
- Version of RestClient that does not raise exceptions.
- """
- def _error_checker(self, method, url,
- headers, body, resp, resp_body):
- pass
-
- def send_request(self, method, url_template, resources, body=None):
- url = url_template % tuple(resources)
- if method == "GET":
- resp, body = self.get(url)
- elif method == "POST":
- resp, body = self.post(url, body)
- elif method == "PUT":
- resp, body = self.put(url, body)
- elif method == "PATCH":
- resp, body = self.patch(url, body)
- elif method == "HEAD":
- resp, body = self.head(url)
- elif method == "DELETE":
- resp, body = self.delete(url)
- elif method == "COPY":
- resp, body = self.copy(url)
- else:
- assert False
-
- return resp, body
diff --git a/tempest/config.py b/tempest/config.py
index 54a4dd1..1c0dabb 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -187,7 +187,7 @@
default=300,
help="Timeout in seconds to wait for an instance to build. "
"Other services that do not define build_timeout will "
- "inherit this value, for example the image service."),
+ "inherit this value."),
cfg.BoolOpt('run_ssh',
default=False,
help="Should the tests ssh to instances?"),
@@ -371,7 +371,15 @@
cfg.StrOpt('http_image',
default='http://download.cirros-cloud.net/0.3.1/'
'cirros-0.3.1-x86_64-uec.tar.gz',
- help='http accessible image')
+ help='http accessible image'),
+ cfg.IntOpt('build_timeout',
+ default=300,
+ help="Timeout in seconds to wait for an image to "
+ "become available."),
+ cfg.IntOpt('build_interval',
+ default=1,
+ help="Time in seconds between image operation status "
+ "checks.")
]
image_feature_group = cfg.OptGroup(name='image-feature-enabled',
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 9cb24b9..b417472 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -338,7 +338,7 @@
'is_public': 'False',
}
params.update(properties)
- _, image = self.image_client.create_image(**params)
+ image = self.image_client.create_image(**params)
self.addCleanup(self.image_client.delete_image, image['id'])
self.assertEqual("queued", image['status'])
self.image_client.update_image(image['id'], data=image_file)
@@ -407,7 +407,7 @@
thing_id=image_id, thing_id_param='id',
cleanup_callable=self.delete_wrapper,
cleanup_args=[_image_client.delete_image, image_id])
- _, snapshot_image = _image_client.get_image_meta(image_id)
+ snapshot_image = _image_client.get_image_meta(image_id)
image_name = snapshot_image['name']
self.assertEqual(name, image_name)
LOG.debug("Created snapshot image %s for server %s",
diff --git a/tempest/services/baremetal/base.py b/tempest/services/baremetal/base.py
index 4bcf2aa..c1ebba5 100644
--- a/tempest/services/baremetal/base.py
+++ b/tempest/services/baremetal/base.py
@@ -50,7 +50,9 @@
def __init__(self, auth_provider):
super(BaremetalClient, self).__init__(
- auth_provider, CONF.baremetal.catalog_type,
+ auth_provider,
+ CONF.baremetal.catalog_type,
+ CONF.identity.region,
endpoint_type=CONF.baremetal.endpoint_type)
self.uri_prefix = ''
diff --git a/tempest/services/compute/json/base.py b/tempest/services/compute/json/base.py
index 9187cc4..cb4915b 100644
--- a/tempest/services/compute/json/base.py
+++ b/tempest/services/compute/json/base.py
@@ -33,6 +33,7 @@
super(ComputeClient, self).__init__(
auth_provider,
CONF.compute.catalog_type,
+ CONF.compute.region or CONF.identity.region,
endpoint_type=CONF.compute.endpoint_type,
build_interval=build_interval,
build_timeout=build_timeout)
diff --git a/tempest/services/data_processing/v1_1/client.py b/tempest/services/data_processing/v1_1/client.py
index 6004b22..1b6842d 100644
--- a/tempest/services/data_processing/v1_1/client.py
+++ b/tempest/services/data_processing/v1_1/client.py
@@ -24,7 +24,9 @@
def __init__(self, auth_provider):
super(DataProcessingClient, self).__init__(
- auth_provider, CONF.data_processing.catalog_type,
+ auth_provider,
+ CONF.data_processing.catalog_type,
+ CONF.identity.region,
endpoint_type=CONF.data_processing.endpoint_type)
def _request_and_check_resp(self, request_func, uri, resp_status):
diff --git a/tempest/services/database/json/flavors_client.py b/tempest/services/database/json/flavors_client.py
index a57b045..01be29a 100644
--- a/tempest/services/database/json/flavors_client.py
+++ b/tempest/services/database/json/flavors_client.py
@@ -25,7 +25,9 @@
def __init__(self, auth_provider):
super(DatabaseFlavorsClientJSON, self).__init__(
- auth_provider, CONF.database.catalog_type)
+ auth_provider,
+ CONF.database.catalog_type,
+ CONF.identity.region)
def list_db_flavors(self, params=None):
url = 'flavors'
diff --git a/tempest/services/database/json/versions_client.py b/tempest/services/database/json/versions_client.py
index 911b55d..8a408e9 100644
--- a/tempest/services/database/json/versions_client.py
+++ b/tempest/services/database/json/versions_client.py
@@ -25,7 +25,9 @@
def __init__(self, auth_provider):
super(DatabaseVersionsClientJSON, self).__init__(
- auth_provider, CONF.database.catalog_type)
+ auth_provider,
+ CONF.database.catalog_type,
+ CONF.identity.region)
self.skip_path()
def list_db_versions(self, params=None):
diff --git a/tempest/services/identity/json/identity_client.py b/tempest/services/identity/json/identity_client.py
index 0b73c04..f6c77e1 100644
--- a/tempest/services/identity/json/identity_client.py
+++ b/tempest/services/identity/json/identity_client.py
@@ -22,9 +22,11 @@
class IdentityClientJSON(rest_client.RestClient):
def __init__(self, auth_provider):
- super(IdentityClientJSON, self).__init__(auth_provider,
- CONF.identity.catalog_type,
- endpoint_type='adminURL')
+ super(IdentityClientJSON, self).__init__(
+ auth_provider,
+ CONF.identity.catalog_type,
+ CONF.identity.region,
+ endpoint_type='adminURL')
def has_admin_extensions(self):
"""
diff --git a/tempest/services/identity/v3/json/base.py b/tempest/services/identity/v3/json/base.py
index da8e287..30d3886 100644
--- a/tempest/services/identity/v3/json/base.py
+++ b/tempest/services/identity/v3/json/base.py
@@ -24,7 +24,9 @@
"""
def __init__(self, auth_provider):
- super(IdentityV3Client, self).__init__(auth_provider,
- CONF.identity.catalog_type,
- endpoint_type='adminURL')
+ super(IdentityV3Client, self).__init__(
+ auth_provider,
+ CONF.identity.catalog_type,
+ CONF.identity.region,
+ endpoint_type='adminURL')
self.api_version = "v3"
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index 48ba909..59902bb 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -523,7 +523,7 @@
class V3TokenClientJSON(rest_client.RestClient):
def __init__(self):
- super(V3TokenClientJSON, self).__init__(None, None)
+ super(V3TokenClientJSON, self).__init__(None, None, None)
auth_url = CONF.identity.uri_v3
if not auth_url:
raise exceptions.InvalidConfiguration('you must specify a v3 uri '
diff --git a/tempest/services/image/v1/json/image_client.py b/tempest/services/image/v1/json/image_client.py
index ba3a814..0d35ef5 100644
--- a/tempest/services/image/v1/json/image_client.py
+++ b/tempest/services/image/v1/json/image_client.py
@@ -38,7 +38,10 @@
super(ImageClientJSON, self).__init__(
auth_provider,
CONF.image.catalog_type,
- endpoint_type=CONF.image.endpoint_type)
+ CONF.image.region or CONF.identity.region,
+ endpoint_type=CONF.image.endpoint_type,
+ build_interval=CONF.image.build_interval,
+ build_timeout=CONF.image.build_timeout)
self._http = None
def _image_meta_from_headers(self, headers):
@@ -119,7 +122,7 @@
self._error_checker('POST', '/v1/images', headers, data, resp,
body_iter)
body = json.loads(''.join([c for c in body_iter]))
- return resp, body['image']
+ return rest_client.ResponseBody(resp, body['image'])
def _update_with_data(self, image_id, headers, data):
url = '/v1/images/%s' % image_id
@@ -128,7 +131,7 @@
self._error_checker('PUT', url, headers, data,
resp, body_iter)
body = json.loads(''.join([c for c in body_iter]))
- return resp, body['image']
+ return rest_client.ResponseBody(resp, body['image'])
@property
def http(self):
@@ -159,7 +162,7 @@
resp, body = self.post('v1/images', None, headers)
self.expected_success(201, resp.status)
body = json.loads(body)
- return resp, body['image']
+ return rest_client.ResponseBody(resp, body['image'])
def update_image(self, image_id, name=None, container_format=None,
data=None, properties=None):
@@ -183,13 +186,13 @@
resp, body = self.put(url, data, headers)
self.expected_success(200, resp.status)
body = json.loads(body)
- return resp, body['image']
+ return rest_client.ResponseBody(resp, body['image'])
def delete_image(self, image_id):
url = 'v1/images/%s' % image_id
resp, body = self.delete(url)
self.expected_success(200, resp.status)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def image_list(self, **kwargs):
url = 'v1/images'
@@ -200,7 +203,7 @@
resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
- return resp, body['images']
+ return rest_client.ResponseBodyList(resp, body['images'])
def image_list_detail(self, properties=dict(), changes_since=None,
**kwargs):
@@ -221,19 +224,20 @@
resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
- return resp, body['images']
+ return rest_client.ResponseBodyList(resp, body['images'])
def get_image_meta(self, image_id):
url = 'v1/images/%s' % image_id
resp, __ = self.head(url)
self.expected_success(200, resp.status)
body = self._image_meta_from_headers(resp)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def get_image(self, image_id):
url = 'v1/images/%s' % image_id
resp, body = self.get(url)
self.expected_success(200, resp.status)
+ # We can't return a ResponseBody because the body is a string
return resp, body
def is_resource_deleted(self, id):
@@ -253,14 +257,14 @@
resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def get_shared_images(self, member_id):
url = 'v1/shared-images/%s' % member_id
resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def add_member(self, member_id, image_id, can_share=False):
url = 'v1/images/%s/members/%s' % (image_id, member_id)
@@ -269,17 +273,17 @@
body = json.dumps({'member': {'can_share': True}})
resp, __ = self.put(url, body)
self.expected_success(204, resp.status)
- return resp
+ return rest_client.ResponseBody(resp)
def delete_member(self, member_id, image_id):
url = 'v1/images/%s/members/%s' % (image_id, member_id)
resp, __ = self.delete(url)
self.expected_success(204, resp.status)
- return resp
+ return rest_client.ResponseBody(resp)
# NOTE(afazekas): just for the wait function
def _get_image_status(self, image_id):
- resp, meta = self.get_image_meta(image_id)
+ meta = self.get_image_meta(image_id)
status = meta['status']
return status
diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py
index 23810f9..852832b 100644
--- a/tempest/services/image/v2/json/image_client.py
+++ b/tempest/services/image/v2/json/image_client.py
@@ -32,7 +32,10 @@
super(ImageClientV2JSON, self).__init__(
auth_provider,
CONF.image.catalog_type,
- endpoint_type=CONF.image.endpoint_type)
+ CONF.image.region or CONF.identity.region,
+ endpoint_type=CONF.image.endpoint_type,
+ build_interval=CONF.image.build_interval,
+ build_timeout=CONF.image.build_timeout)
self._http = None
def _get_http(self):
@@ -44,7 +47,7 @@
def _validate_schema(self, body, type='image'):
if type in ['image', 'images']:
- resp, schema = self.get_schema(type)
+ schema = self.get_schema(type)
else:
raise ValueError("%s is not a valid schema type" % type)
@@ -65,7 +68,7 @@
"-json-patch"}
resp, body = self.patch('v2/images/%s' % image_id, data, headers)
self.expected_success(200, resp.status)
- return resp, self._parse_resp(body)
+ return rest_client.ResponseBody(resp, self._parse_resp(body))
def create_image(self, name, container_format, disk_format, **kwargs):
params = {
@@ -87,12 +90,13 @@
resp, body = self.post('v2/images', data)
self.expected_success(201, resp.status)
body = json.loads(body)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def delete_image(self, image_id):
url = 'v2/images/%s' % image_id
resp, _ = self.delete(url)
self.expected_success(204, resp.status)
+ return rest_client.ResponseBody(resp)
def image_list(self, params=None):
url = 'v2/images'
@@ -104,14 +108,14 @@
self.expected_success(200, resp.status)
body = json.loads(body)
self._validate_schema(body, type='images')
- return resp, body['images']
+ return rest_client.ResponseBodyList(resp, body['images'])
def get_image(self, image_id):
url = 'v2/images/%s' % image_id
resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def is_resource_deleted(self, id):
try:
@@ -131,32 +135,33 @@
resp, body = self.http.raw_request('PUT', url, headers=headers,
body=data)
self.expected_success(204, resp.status)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def get_image_file(self, image_id):
url = 'v2/images/%s/file' % image_id
resp, body = self.get(url)
self.expected_success(200, resp.status)
+ # We can't return a ResponseBody because the body is a string
return resp, body
def add_image_tag(self, image_id, tag):
url = 'v2/images/%s/tags/%s' % (image_id, tag)
resp, body = self.put(url, body=None)
self.expected_success(204, resp.status)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def delete_image_tag(self, image_id, tag):
url = 'v2/images/%s/tags/%s' % (image_id, tag)
resp, _ = self.delete(url)
self.expected_success(204, resp.status)
- return resp
+ return rest_client.ResponseBody(resp)
def get_image_membership(self, image_id):
url = 'v2/images/%s/members' % image_id
resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def add_member(self, image_id, member_id):
url = 'v2/images/%s/members' % image_id
@@ -164,7 +169,7 @@
resp, body = self.post(url, data)
self.expected_success(200, resp.status)
body = json.loads(body)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def update_member_status(self, image_id, member_id, status):
"""Valid status are: ``pending``, ``accepted``, ``rejected``."""
@@ -173,23 +178,23 @@
resp, body = self.put(url, data)
self.expected_success(200, resp.status)
body = json.loads(body)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
def get_member(self, image_id, member_id):
url = 'v2/images/%s/members/%s' % (image_id, member_id)
resp, body = self.get(url)
self.expected_success(200, resp.status)
- return resp, json.loads(body)
+ return rest_client.ResponseBody(resp, json.loads(body))
def remove_member(self, image_id, member_id):
url = 'v2/images/%s/members/%s' % (image_id, member_id)
resp, _ = self.delete(url)
self.expected_success(204, resp.status)
- return resp
+ return rest_client.ResponseBody(resp)
def get_schema(self, schema):
url = 'v2/schemas/%s' % schema
resp, body = self.get(url)
self.expected_success(200, resp.status)
body = json.loads(body)
- return resp, body
+ return rest_client.ResponseBody(resp, body)
diff --git a/tempest/services/messaging/json/messaging_client.py b/tempest/services/messaging/json/messaging_client.py
index caed02f..45534c7 100644
--- a/tempest/services/messaging/json/messaging_client.py
+++ b/tempest/services/messaging/json/messaging_client.py
@@ -28,8 +28,10 @@
class MessagingClientJSON(rest_client.RestClient):
def __init__(self, auth_provider):
- super(MessagingClientJSON, self).__init__(auth_provider,
- CONF.messaging.catalog_type)
+ super(MessagingClientJSON, self).__init__(
+ auth_provider,
+ CONF.messaging.catalog_type,
+ CONF.identity.region)
self.version = '1'
self.uri_prefix = 'v{0}'.format(self.version)
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index c279efd..8f5ed5a 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -39,7 +39,9 @@
def __init__(self, auth_provider):
super(NetworkClientJSON, self).__init__(
- auth_provider, CONF.network.catalog_type,
+ auth_provider,
+ CONF.network.catalog_type,
+ CONF.network.region or CONF.identity.region,
endpoint_type=CONF.network.endpoint_type,
build_interval=CONF.network.build_interval,
build_timeout=CONF.network.build_timeout)
diff --git a/tempest/services/object_storage/account_client.py b/tempest/services/object_storage/account_client.py
index 23984cd..c24bbba 100644
--- a/tempest/services/object_storage/account_client.py
+++ b/tempest/services/object_storage/account_client.py
@@ -17,9 +17,7 @@
import urllib
from xml.etree import ElementTree as etree
-from tempest.common import http
from tempest import config
-from tempest import exceptions
from tempest.services.object_storage import base
CONF = config.CONF
@@ -162,75 +160,3 @@
body = json.loads(body)
self.expected_success(200, resp.status)
return resp, body
-
-
-class AccountClientCustomizedHeader(base.ObjectStorageClient):
-
- # TODO(andreaf) This class is now redundant, to be removed in next patch
-
- def request(self, method, url, extra_headers=False, headers=None,
- body=None):
- """A simple HTTP request interface."""
- dscv = CONF.identity.disable_ssl_certificate_validation
- ca_certs = CONF.identity.ca_certificates_file
- self.http_obj = http.ClosingHttp(
- disable_ssl_certificate_validation=dscv,
- ca_certs=ca_certs)
- if headers is None:
- headers = {}
- elif extra_headers:
- try:
- headers.update(self.get_headers())
- except (ValueError, TypeError):
- headers = {}
-
- # Authorize the request
- req_url, req_headers, req_body = self.auth_provider.auth_request(
- method=method, url=url, headers=headers, body=body,
- filters=self.filters
- )
- # use original body
- resp, resp_body = self.http_obj.request(req_url, method,
- headers=req_headers,
- body=req_body)
- self._log_request(method, req_url, resp)
-
- if resp.status == 401 or resp.status == 403:
- raise exceptions.Unauthorized()
-
- return resp, resp_body
-
- def list_account_containers(self, params=None, metadata=None):
- """
- GET on the (base) storage URL
- Given a valid X-Auth-Token, returns a list of all containers for the
- account.
-
- Optional Arguments:
- limit=[integer value N]
- Limits the number of results to at most N values
- DEFAULT: 10,000
-
- marker=[string value X]
- Given string value X, return object names greater in value
- than the specified marker.
- DEFAULT: No Marker
-
- format=[string value, either 'json' or 'xml']
- Specify either json or xml to return the respective serialized
- response.
- DEFAULT: Python-List returned in response body
- """
-
- url = '?format=%s' % self.format
- if params:
- url += '&%s' % urllib.urlencode(params)
-
- headers = {}
- if metadata:
- for key in metadata:
- headers[str(key)] = metadata[key]
-
- resp, body = self.get(url, headers=headers)
- self.expected_success(200, resp.status)
- return resp, body
diff --git a/tempest/services/object_storage/base.py b/tempest/services/object_storage/base.py
index 3900e82..655596f 100644
--- a/tempest/services/object_storage/base.py
+++ b/tempest/services/object_storage/base.py
@@ -25,6 +25,8 @@
def __init__(self, auth_provider):
super(ObjectStorageClient, self).__init__(
- auth_provider, CONF.object_storage.catalog_type,
+ auth_provider,
+ CONF.object_storage.catalog_type,
+ CONF.object_storage.region or CONF.identity.region,
endpoint_type=CONF.object_storage.endpoint_type)
self.format = 'json'
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index a93a9df..bb74fd7 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -17,9 +17,7 @@
import urllib
import urlparse
-from tempest.common import http
from tempest import config
-from tempest import exceptions
from tempest.services.object_storage import base
CONF = config.CONF
@@ -28,10 +26,11 @@
class ObjectClient(base.ObjectStorageClient):
def create_object(self, container, object_name, data,
- params=None, metadata=None):
+ params=None, metadata=None, headers=None):
"""Create storage object."""
- headers = self.get_headers()
+ if headers is None:
+ headers = self.get_headers()
if not data:
headers['content-length'] = '0'
if metadata:
@@ -177,82 +176,6 @@
self.expected_success(201, resp.status)
return resp.status, resp.reason, resp_headers
-
-class ObjectClientCustomizedHeader(base.ObjectStorageClient):
-
- # TODO(andreaf) This class is now redundant, to be removed in next patch
-
- def request(self, method, url, extra_headers=False, headers=None,
- body=None):
- """A simple HTTP request interface."""
- dscv = CONF.identity.disable_ssl_certificate_validation
- ca_certs = CONF.identity.ca_certificates_file
- self.http_obj = http.ClosingHttp(
- disable_ssl_certificate_validation=dscv,
- ca_certs=ca_certs)
- if headers is None:
- headers = {}
- elif extra_headers:
- try:
- headers.update(self.get_headers())
- except (ValueError, TypeError):
- headers = {}
-
- # Authorize the request
- req_url, req_headers, req_body = self.auth_provider.auth_request(
- method=method, url=url, headers=headers, body=body,
- filters=self.filters
- )
- # Use original method
- resp, resp_body = self.http_obj.request(req_url, method,
- headers=req_headers,
- body=req_body)
- self._log_request(method, req_url, resp)
- if resp.status == 401 or resp.status == 403:
- raise exceptions.Unauthorized()
-
- return resp, resp_body
-
- def get_object(self, container, object_name, metadata=None):
- """Retrieve object's data."""
- headers = {}
- if metadata:
- for key in metadata:
- headers[str(key)] = metadata[key]
-
- url = "{0}/{1}".format(container, object_name)
- resp, body = self.get(url, headers=headers)
- self.expected_success(200, resp.status)
- return resp, body
-
- def create_object(self, container, object_name, data, metadata=None):
- """Create storage object."""
-
- headers = {}
- if metadata:
- for key in metadata:
- headers[str(key)] = metadata[key]
-
- if not data:
- headers['content-length'] = '0'
- url = "%s/%s" % (str(container), str(object_name))
- resp, body = self.put(url, data, headers=headers)
- self.expected_success(201, resp.status)
- return resp, body
-
- def delete_object(self, container, object_name, metadata=None):
- """Delete storage object."""
-
- headers = {}
- if metadata:
- for key in metadata:
- headers[str(key)] = metadata[key]
-
- url = "%s/%s" % (str(container), str(object_name))
- resp, body = self.delete(url, headers=headers)
- self.expected_success(200, resp.status)
- return resp, body
-
def create_object_continue(self, container, object_name,
data, metadata=None):
"""Create storage object."""
diff --git a/tempest/services/orchestration/json/orchestration_client.py b/tempest/services/orchestration/json/orchestration_client.py
index 2dedf01..054f410 100644
--- a/tempest/services/orchestration/json/orchestration_client.py
+++ b/tempest/services/orchestration/json/orchestration_client.py
@@ -31,6 +31,7 @@
super(OrchestrationClient, self).__init__(
auth_provider,
CONF.orchestration.catalog_type,
+ CONF.orchestration.region or CONF.identity.region,
endpoint_type=CONF.orchestration.endpoint_type,
build_interval=CONF.orchestration.build_interval,
build_timeout=CONF.orchestration.build_timeout)
diff --git a/tempest/services/telemetry/json/telemetry_client.py b/tempest/services/telemetry/json/telemetry_client.py
index 622c996..2b5dc1a 100644
--- a/tempest/services/telemetry/json/telemetry_client.py
+++ b/tempest/services/telemetry/json/telemetry_client.py
@@ -28,6 +28,7 @@
super(TelemetryClientJSON, self).__init__(
auth_provider,
CONF.telemetry.catalog_type,
+ CONF.identity.region,
endpoint_type=CONF.telemetry.endpoint_type)
self.version = '2'
self.uri_prefix = "v%s" % self.version
diff --git a/tempest/services/volume/json/base.py b/tempest/services/volume/json/base.py
index 1800ee6..ef316f2 100644
--- a/tempest/services/volume/json/base.py
+++ b/tempest/services/volume/json/base.py
@@ -27,6 +27,7 @@
super(VolumeClient, self).__init__(
auth_provider,
CONF.volume.catalog_type,
+ CONF.volume.region or CONF.identity.region,
endpoint_type=CONF.volume.endpoint_type,
build_interval=CONF.volume.build_interval,
build_timeout=CONF.volume.build_timeout)
diff --git a/tempest/tests/cmd/test_verify_tempest_config.py b/tempest/tests/cmd/test_verify_tempest_config.py
index 65106cc..a8adc7e 100644
--- a/tempest/tests/cmd/test_verify_tempest_config.py
+++ b/tempest/tests/cmd/test_verify_tempest_config.py
@@ -171,7 +171,7 @@
def test_verify_glance_version_no_v2_with_v1_1(self):
def fake_get_versions():
- return (None, ['v1.1'])
+ return (['v1.1'])
fake_os = mock.MagicMock()
fake_os.image_client.get_versions = fake_get_versions
with mock.patch.object(verify_tempest_config,
@@ -182,7 +182,7 @@
def test_verify_glance_version_no_v2_with_v1_0(self):
def fake_get_versions():
- return (None, ['v1.0'])
+ return (['v1.0'])
fake_os = mock.MagicMock()
fake_os.image_client.get_versions = fake_get_versions
with mock.patch.object(verify_tempest_config,
@@ -193,7 +193,7 @@
def test_verify_glance_version_no_v1(self):
def fake_get_versions():
- return (None, ['v2.0'])
+ return (['v2.0'])
fake_os = mock.MagicMock()
fake_os.image_client.get_versions = fake_get_versions
with mock.patch.object(verify_tempest_config,
diff --git a/tempest/tests/test_list_tests.py b/tempest/tests/test_list_tests.py
index efdb413..19e4c9c 100644
--- a/tempest/tests/test_list_tests.py
+++ b/tempest/tests/test_list_tests.py
@@ -31,7 +31,7 @@
ids, err = p.communicate()
self.assertEqual(0, p.returncode,
"test discovery failed, one or more files cause an "
- "error on import")
+ "error on import %s" % ids)
ids = ids.split('\n')
for test_id in ids:
if re.match('(\w+\.){3}\w+', test_id):
diff --git a/tempest/tests/test_rest_client.py b/tempest/tests/test_rest_client.py
index 42ba5a0..a133800 100644
--- a/tempest/tests/test_rest_client.py
+++ b/tempest/tests/test_rest_client.py
@@ -17,6 +17,7 @@
import httplib2
from oslotest import mockpatch
+from tempest.common import negative_rest_client
from tempest.common import rest_client
from tempest import config
from tempest import exceptions
@@ -30,18 +31,13 @@
url = 'fake_endpoint'
- def _get_region(self):
- return 'fake region'
-
def setUp(self):
super(BaseRestClientTestClass, self).setUp()
self.useFixture(fake_config.ConfigFixture())
self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)
self.rest_client = rest_client.RestClient(
- fake_auth_provider.FakeAuthProvider(), None)
+ fake_auth_provider.FakeAuthProvider(), None, None)
self.stubs.Set(httplib2.Http, 'request', self.fake_http.request)
- self.useFixture(mockpatch.PatchObject(self.rest_client, '_get_region',
- side_effect=self._get_region()))
self.useFixture(mockpatch.PatchObject(self.rest_client,
'_log_request'))
@@ -304,7 +300,7 @@
self.useFixture(fake_config.ConfigFixture())
self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)
self.rest_client = rest_client.RestClient(
- fake_auth_provider.FakeAuthProvider(), None)
+ fake_auth_provider.FakeAuthProvider(), None, None)
def test_response_less_than_400(self):
self.rest_client._error_checker(**self.set_data("399"))
@@ -339,6 +335,11 @@
self.rest_client._error_checker,
**self.set_data("413"))
+ def test_response_415(self):
+ self.assertRaises(exceptions.InvalidContentType,
+ self.rest_client._error_checker,
+ **self.set_data("415"))
+
def test_response_422(self):
self.assertRaises(exceptions.UnprocessableEntity,
self.rest_client._error_checker,
@@ -433,7 +434,7 @@
def setUp(self):
self.fake_http = fake_http.fake_httplib2()
super(TestNegativeRestClient, self).setUp()
- self.negative_rest_client = rest_client.NegativeRestClient(
+ self.negative_rest_client = negative_rest_client.NegativeRestClient(
fake_auth_provider.FakeAuthProvider(), None)
self.useFixture(mockpatch.PatchObject(self.negative_rest_client,
'_log_request'))