Commit Graph

15 Commits

Author SHA1 Message Date
Takashi Kajinami 1e99767d0e Drop ineffective options from config file
The following options set in functional tests do not exist.
 [DEFAULT] send_identity_credentials
 [DEFAULT] send_identity_headers

Change-Id: Ia739af13e0f88d0861e453a4d54ecc626e32b34b
2024-01-31 01:16:12 +00:00
Stephen Finucane 9679ffc463 Remove six.moves.http_client usage
This is a rather beefy change due to the number of usages of this
import. The changes are trivial though.

Change-Id: I7badeeaca438b0291f4ed86670e7f217e6372c61
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-01-27 14:54:05 +00:00
Abhishek Kekane 525b6addd0 Make our functional tests compatible with RBAC
Recently we have added new non voting job 'functional-py38-rbac' which
will run our functional tests by enabling Secure RBAC. To run functional
tests with Secure RBAC enabled we need to pass 'reader' role to the
requests as well.

Change-Id: I70e085bd6c07548a9d4802fee651e589276a00e5
2021-07-16 07:58:46 -07:00
Dan Smith 0309814d93 Make wsgi tests use noauth deployment flavor
This gives us a consistent context with roles and project affiliation
for later policy check patches.

Change-Id: I241a81aabe0ca6f8c2b2abacedd86aed9e68c79c
2021-05-05 08:37:13 -07:00
Dan Smith 232177e68c Add housekeeping module and staging cleaner
As noted in previous discussions, glance should clean its staging
directory on startup. This is important for scenarios where we
started an import operation, but failed in the middle. If, when we
recover, the image has already been deleted from the database, then
we will never remove the (potentially very large) residue from disk
in our staging directory.

This is currently a problem with web-download, but will also occur
with glance-direct once we have the non-shared distributed import
functionality merged.

Closes-Bug: #1913625
Change-Id: Ib80e9cfb58680f9e8ead5993dc206f4da882dd09
2021-03-03 14:36:46 -08:00
Abhishek Kekane ffd2f5e63f Fix broken glance-cache-manage utility
glance-cahce-manage is broken due to circilar imports.
Fixed the same by importing 'prefetcher' module right before
'Prefetcher' object is initialized.

Closes-Bug: #1888349
Change-Id: I57d473572ca0a341082bacc3883cd9f763d77fa7
2020-07-23 07:04:52 +00:00
Abhishek Kekane 73fefddd96 Add periodic job to prefetch images into cache
Added new periodic job which will run as per interval set using
'cache_prefetcher_interval' configuration option and fetch images
which are queued for caching in cache directory.

DocImpact
Change-Id: If2875f7a215aca10a6ed2febc89b02219f90a10d
2019-09-10 15:01:58 +00:00
Lucian Petrut 8fe78170e4 Windows: fix flaky tests
Some tests compare timestamps (e.g. image created_at/updated_at
fields).

In some cases, subsequent timestamps may be identical, breaking the
assertions made by those tests.

One idea is to just add a 1ms sleep which should be a negligeable.
Mocking the functions used to retrieve timestamps may be undesireable.

For now, we'll do this only for Windows, where time.time has a lower
resolution compared to Linux (1e-7 as opposed to 1e-9).

At the same time, socket timeouts are rather inconsistent on Windows.
When a timeout is hit, recv may either throw ConnectionAbortedError
*or* return nothing. This needs to be taken into account when
expecting socket timeouts.

Change-Id: Ie5a4d8fb4c979c09eda2fdc0fad0baa1d1840c59
2019-03-25 14:23:21 +02:00
Lucian Petrut 98b7ef195c Allow glance tests to run on Windows
In order to run the unit and functional Glance tests on Windows, we
have to:

* avoid monkey patching the os module on Windows (which causes Popen
  to fail)
* update sqlite connection URL
* avoid os.fork, not available on Windows.
    * we'll use subprocess.Popen when spinning up http servers.
    * for the really simple ones defined in the test helpers, we'll just
      use threads
* do not attempt to connect to '0.0.0.0', use '127.0.0.1' instead
* some tests aren't properly skipped (xattr ones), so we're covering that
  as well
* skip log rotation test, we can't move in-use files. Log rotation can
  be performed by the log handler itself.
* expect an exception when hitting connection timeouts
* avoid installing unavailable test requirements (xattr, pysendfile)
* pin the instance creation timestamp. some tests that deal with
  markers rely on ordering, which can be flipped if the timestamps are
  identical (can happen in case of resources created one after the
  other, not sure yet if this happens really fast or the clock isn't
  accurate enough).
* add a few seconds to some timeouts (much needed when running the tests
  in VMs).

blueprint windows-support

Change-Id: Ife69f56a3f9f4d81e1e2e47fde4778efd490938f
2019-03-13 16:41:11 +02:00
Alexander Bashmakov 9a55baa2c8 Clean up py35 env in tox.ini.
This patch enables the py35 job in tox.ini to run using ostestr.
It also fixes a bytes encoding issue in the 'test_wsgi' functional
test to make progress towards the community goal of enabling
python3.5. Two other functional tests remain disabled and will need
to be addressed in a later patch in order to fully complete the
community goal - 'test_ssl' and 'test_reload'. These tests fail
due to SSL handshake not working in python3.5 when using self-signed
certificate and authority.

Change-Id: Ie9071f1a93d8201f754ae3042d6e51b5de6d2e63
2017-05-09 22:54:59 +00:00
ChangBo Guo(gcb) 815293738a Fix wrong overridden value of config option client_socket_timeout
Config option only allows the value zero which implies wait forever,
or positive integer, so we need pass positive integer. CONF.set_default
will check the value by converting it to integer, 0.1 will be converted
to 0. that leads test failure, use 1 instead.

Related-Bug: #1517839
Change-Id: I86eeff90e464faa80277823a87ab352761dd8544
2017-04-28 23:55:57 +08:00
Erno Kuvaja e8e71dba4d Rationalize test asserts
Utilizing assertIn and assertNotIn in a consistent way rather than
assertTrue( x <not> in y) and assertFalse(x in y).

Change-Id: Ic43d107c40a5a50b852ee476b1167c21e5ad86e8
2015-07-09 13:48:49 +00:00
Alexey Galkin 1512368af6 Improve code readability in functional test for the WSGIServer
Change-Id: I43c484da4d33740f1356a69d7cfcc69704e2c210
Closes-Bug: #1470941
2015-07-08 11:43:00 +03:00
Doug Hellmann e1293da804 Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: If9e7dd93737cc13654e01f1b923cb29f434e8425
2015-06-18 22:02:17 +00:00
Stuart McLaren 19bba346ba Add client_socket_timeout option
Add a parameter to take advantage of the new(ish) eventlet socket timeout
behaviour.  Allows closing idle client connections after a period of
time, eg:

$ time nc localhost 9292
real    1m0.063s

Setting 'client_socket_timeout = 0' means do not timeout.

DocImpact
Closes-bug: 1371022
Change-Id: I9e7edcbf25ece61dc16b8cd5a8bef5ed9a14e3d6
2015-06-18 14:50:00 +00:00