summaryrefslogtreecommitdiff
path: root/glanceclient/tests/functional
Commit message (Collapse)AuthorAgeFilesLines
* Fix functional tests and docs generationCyril Roelandt2023-01-122-2/+16
| | | | | | | | | | | | | | | | | | | | | First, fix test_help(). A commit[1], which first appeared in Python 3.10, changes the output of the help feature of argparse. Options used to be in a section named "Optional arguments:", and they are now in a section named "Options:". Second, tox 4 changes the behaviour of tox, and {toxinidir}/requirements.txt is no longer installed automagically in the docs virtual environment. This causes autodoc to fail on some imports. We explicitely add {toxinidir}/requirements.txt to the list of dependencies to fix this issue. These issues should be fixed in separate patches, but since they both block the CI, they depend on each other. [1] https://github.com/python/cpython/pull/23858 Change-Id: Ia7866390b31f469bdea95624325a13aaf45a496e Closes-Bug: #2002566
* Update hacking for Python3Andreas Jaeger2020-04-022-2/+2
| | | | | | | | | | | | The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Fix problems found. Remove hacking and friends from lower-constraints, they are not needed for installation. Change-Id: I5ae47a7b11ff29a301e440c15daf30db7738485b
* Split glanceclient functional testsBrian Rosmaita2018-03-286-16/+75
| | | | | | | | | | | | Prepare for the Image API v1 to be removed from glance during Rocky by splitting the functional tests that hit v1 from the tests that hit v2. Introduce a new job that runs the functional-v1 tests against a devstack running glance stable/queens, and configure this job for both check and gate for the glanceclient. The v2 functional tests continue to be run for both check and gate against a devstack running glance master. Change-Id: Ifa98ada26a84e4cca3ea8c98173f61a6174cca27
* Revise functional testing README fileBrian Rosmaita2017-12-151-8/+17
| | | | | | Clarifies the location of clouds.yaml for functional testing. Change-Id: Ib0b8e84579bca72e791229752df14542358e21b7
* Migrate dsvm functional test jobs to project repoBrian Rosmaita2017-12-141-46/+0
| | | | | | | | | | | | | | Migrate legacy dsvm functional test jobs for python-glanceclient to the project repository as zuul3 jobs using the devstack functional base job. Co-authored-by: Monty Taylor <mordred@inaugust.com> Co-authored-by: Brian Rosmaita <rosmaita.fossdev@gmail.com> Needed-By: I0b974bf60da6bafabeb037a75ac10654e2a6406c Needed-By: I0271a1430843ef546e991a7a3c4b572b3e404963 Depends-On: I84de60181cb88574e341ff83cd4857cce241f2dd Change-Id: I1977ee0d348645987107c2efb5b454d7f8b81adf
* Add domain info to functional test clientsBrian Rosmaita2017-12-111-1/+5
| | | | | | | Keystone wants domain info, so pass it on. Change-Id: Ie99f79b61e5f8d469695fa19ad99d919fa23ae8e Closes-bug: #1737583
* Removed the --no-ssl-compression parameter which is deprecatedPranaliD2017-07-251-9/+0
| | | | | | | | --no-ssl-compression is deprecated and no longer used. So, it is removed from the help message. Change-Id: I2b886671a568ed191ee380cf16335ccd9ae85062 Closes-Bug: #1583919
* v2: Content-Type: application/octet-stream header always addedckonstanski2017-05-192-1/+91
| | | | | | | | | | | | | | | | | | | | | | | | | The bug: any existing Content-Type header cannot be found because the call to headers.get() fails. Therefore we end up with two Content-Type headers because a new one (applicaion/octet-stream) gets added unconditionally. The cause: the strings (keys and values) in the headers dict are converted from unicode sequences of type <str> to utf-8 sequences of type <bytes>. This happens in safe_encode() (oslo_utils/encodeutils.py:66). <str> != <bytes> even if they appear to have the same characters. Hence, for python 3.x, _set_common_request_kwargs() adds content-type to header even if custom content-type is set in the request. This results in unsupported media type exception when glance client is used with keystoneauth and python 3.x The fix: follow the directions in encode_headers(). It says to do this just before sending the request. Honor this principle; do not encode headers and then perform more business logic on them. Change-Id: Idf6079b32f70bc171f5016467048e917d42f296d Closes-bug: #1641239 Co-Authored-By: Pushkar Umaranikar <pushkar.umaranikar@intel.com>
* Replace tempest_lib with tempest.libwangxiyuan2016-06-272-2/+2
| | | | | | | As the tempest_lib is deprecated and the code has been moved into tempest. We should use tempest.lib insteded of tempest_lib. Change-Id: Id22f90a47056cd88f9524fc6015607c93f7d88b5
* trival: fix a typo in commentyangds2016-02-151-1/+1
| | | | | | s/thouhg/though Change-Id: I483ac7b3f9d9ecac7d6697e6dbd18e0e39669bfd
* Fix warnings in glanceclient READMEkairat_kushaev2016-02-011-5/+10
| | | | | | | | | | | | README.rst file for functional tests and glanceclient itself raises some warnings when passing these docs through REST validator and build the doc: - Need additional empty line to provide correct indent in cloud.yaml example - Title should be with the same length as overline. The patch fixes these warnings. Change-Id: I2e2ef6f838ee639d1a88256b6e321181a62cc76b
* Update set of wanted commands in read-only testKyrylo Romanenko2015-11-271-5/+9
| | | | | | | Nowadays Glance supports more subcommands. Closes-Bug: #1520585 Change-Id: Ic95c26df31dc3bfb4436969e728f7a1a7c50ff0c
* Fix 'test_help' for shell client.Alexey Galkin2015-11-131-1/+2
| | | | | | | | Added new items in 'wanted_commands'. Related bug: #1508356 Change-Id: I21ca66d51ace18ac58d33d5d542f805150cb8e4f
* Merge "Add documentation for running the functional tests"Jenkins2015-11-021-6/+19
|\
| * Add documentation for running the functional testsStuart McLaren2015-10-211-6/+19
| | | | | | | | Change-Id: I824f6cd2aa988ed1e4025765971161b44993f00a
* | Use clouds.yaml from devstack for functional testsMonty Taylor2015-10-213-44/+23
| | | | | | | | | | | | | | | | | | devstack produces a file called clouds.yaml already with credentials in it. Rather than producing our own config file to run functional tests, just consume the clouds.yaml file that's already there. Closes-Bug: #1507386 Change-Id: I82c071b2cd903b9578d1f2ec515882c815812692
* | Consider `--os-token` when using v2Flavio Percoco2015-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The `_cache_schemas` call currently forces authentication even when the `auth_token` and `os_image_url` are passed. Instead of handling forced authentications, let the client use the passed arguments and authenticate only once if needed. This was not caught by the existing tests because the call to `_cache_schemas` was mocked. Change-Id: I93cec9a68cafc0992d14dab38114d03e25f1e5da Closes-bug: #1490462
* | Check if v2 is available and fallbackFlavio Percoco2015-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a basic implementation for a fallback mechanism that will use v1 rather than v2 when downloading schema files from glance-api fails. However, this is not sound. If the schemas are cached already, we won't check if v2 is available and fail to fallback. This patch fixes the aforementioned issue by getting the list of available versions from the server only when the API versions was not explicitly specified through the CLI. That is, for all commands that don't pass `--os-image-api-version 2`, we'll check v2's availability and we'll fallback to v1 if it isn't available. This patch also changes how we handle `/versions` calls in the client. The server has been, incorrectly, replying to requests to `/version` with a 300 error, which ended up in the client re-raising such exception. While I think 300 shouldn't raise an exception, I think we should handle that in a spearate patch. Therefore, this patch just avoids raising such exception when `/version` is explicitly called. This fallback behaviour and the check on `/versions` will be removed in future versions of the client. The later depends on this bug[0] being fixed. [0] https://bugs.launchpad.net/glance/+bug/1491350 Closes-bug: #1489381 Change-Id: Ibeba6bc86db2a97b8a2b4bd042248464cd792e5e
* | Update path to subunit2html in post_test_hookTakashi NATSUME2015-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Per: http://lists.openstack.org/pipermail/openstack-dev/2015-August/072982.html The location of subunit2html changed on the images in the gate so update the path used in the post_test_hook. Long-term we should just use what's in devstack-gate. Change-Id: I142b3c0590ba2fa880973b0ee306ebd1db27fd03 Closes-Bug: #1491646
* | Remove custom SSL compression handlingStuart McLaren2015-08-261-0/+9
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Custom SSL handling was introduced because disabling SSL layer compression provided an approximately five fold performance increase in some cases. Without SSL layer compression disabled the image transfer would be CPU bound -- with the CPU performing the DEFLATE algorithm. This would typically limit image transfers to < 20 MB/s. When --no-ssl-compression was specified the client would not negotiate any compression algorithm during the SSL handshake with the server which would remove the CPU bottleneck and transfers could approach wire speed. In order to support '--no-ssl-compression' two totally separate code paths exist depending on whether this is True or False. When SSL compression is disabled, rather than using the standard 'requests' library, we enter some custom code based on pyopenssl and httplib in order to disable compression. This patch/spec proposes removing the custom code because: * It is a burden to maintain Eg adding new code such as keystone session support is more complicated * It can introduce additional failure modes We have seen some bugs related to the 'custom' certificate checking * Newer Operating Systems disable SSL for us. Eg. While Debian 7 defaulted to compression 'on', Debian 8 has compression 'off'. This makes both servers and client less likely to have compression enabled. * Newer combinations of 'requests' and 'python' do this for us Requests disables compression when backed by a version of python which supports it (>= 2.7.9). This makes clients more likely to disable compression out-of-the-box. * It is (in principle) possible to do this on older versions too If pyopenssl, ndg-httpsclient and pyasn1 are installed on older operating system/python combinations, the requests library should disable SSL compression on the client side. * Systems that have SSL compression enabled may be vulnerable to the CRIME (https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-4929) attack. Installations which are security conscious should be running the Glance server with SSL disabled. Full Spec: https://review.openstack.org/#/c/187674 Blueprint: remove-custom-client-ssl-handling Change-Id: I7e7761fc91b0d6da03939374eeedd809534f6edf
* Use API v2 as defaultFei Long Wang2015-08-111-4/+39
| | | | | | | | | | Now we have claimed v2 is the current API version of Glance, we should change the Glance client as well to be consistent with Glance server. DocImpact Change-Id: I09c9e409d149e2d797785591183e06c13229b7f7
* Enable flake8 checksDarja Shakhray2015-07-212-5/+3
| | | | | | | | | | | | This commit enables new flake8 checks: * E265 block comment should start with '# ' * H405 multi line docstring summary not separated with an empty line * E123 closing bracket does not match indentation of opening bracket's line * H238 old style class declaration, use new style (inherit from `object`) * E128 continuation line under-indented for visual indent and makes related changes in the code. Change-Id: Ie993afc930f6b74d7a990bcaa9fc0e9f5ba1585c
* Fix functional tests in gateStuart McLaren2015-05-152-2/+30
| | | | | | | | | | | The check-glanceclient-dsvm-functional gate job was failing due to the functional tests not picking up valid OpenStack credentials. Update how we aquire credentials -- fixes side effect of how tox 2.0 handles environment variables. Change-Id: Ia665dc9673d09421508476d05039d2da8a5e1a29 Closes-bug: 1455102
* Add some basic CLI functional testsLouis Taylor2015-05-012-5/+60
| | | | | | | This ports over most of the functional glanceclient cli tests out from tempest. Change-Id: I59d409ade72c289ed9942ce374cae732a40518aa
* Create functional test baseStuart McLaren2015-04-185-0/+154
This will allow adding 'check-glanceclient-dsvm-functional' tests in the gate, similar to: * check-novaclient-dsvm-functional * check-keystoneclient-dsvm-functional * check-neutronclient-dsvm-functional * etc Change-Id: Id970db52695db7dc53206aa05fe573995b57aa78