23 Commits

Author SHA1 Message Date
Tim Burke
0d44328c75 Quiet more deprecation warnings on py2
Change-Id: I309767b2c6352e097d9572053c08d8377806809c
2021-03-30 14:02:36 -07:00
Tim Burke
104afe56fa py2: Suppress more CryptographyDeprecationWarnings
Change-Id: Icdbebb55e85763a7bd2a269753ced61a99e557be
2020-11-13 22:04:03 -08:00
Tim Burke
8ea227a0e5 Suppress CryptographyDeprecationWarnings
Change-Id: Id123fb0f9173cf75916984d85bcf8c2d5eefaec2
2020-08-26 13:09:41 -07:00
Alistair Coles
9d742b85ad Refactoring, test infrastructure changes and cleanup
...in preparation for the container sharding feature.

Co-Authored-By: Matthew Oliver <matt@oliver.net.au>
Co-Authored-By: Tim Burke <tim.burke@gmail.com>
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>

Change-Id: I4455677abb114a645cff93cd41b394d227e805de
2018-05-15 18:18:25 +01:00
Pete Zaitcev
5dfc3a75fb Open-code eventlet.listen()
Recently out gate started blowing up intermittently with a strange
case of ports mixed up. Sometimes a functional tests tries to
authorize on a port that's clearly an object server port, and
the like. As it turns out, eventlet developers added an unavoidable
SO_REUSEPORT into listen(), which makes listen(("localhost",0)
to reuse ports.

There's an issue about it:
 https://github.com/eventlet/eventlet/issues/411

This patch is working around the problem while eventlet people
consider the issue.

Change-Id: I67522909f96495a6a30e1acdb79835dce2189549
2017-05-11 01:39:14 -06:00
Christian Hugo
ffd5194a3b Raise ValueError if a config section does not exist
Instead of printing the error message and
calling sys.exit() when a section not exists
or reading the file failed rais an Exception
from readconfig. Depending on the Value or IO-Error,
the caller can decide if he wants to exit or continue.
If an Exception reaches the wsgi utilities
it bubbles all the way up.

Change-Id: Ieb444f8c34e37f49bea21c3caf1c6c2d7bee5fb4
Closes-Bug: 1578321
2016-12-15 19:49:57 +00:00
janonymous
923238aa1b test/(functional/probe):Replace python print operator with print function (pep H233, py33)
'print' function is compatible with 2.x and 3.x python versions
Link : https://www.python.org/dev/peps/pep-3105/

Python 2.6 has a __future__ import that removes print as language syntax,
letting you use the functional form instead

Change-Id: I416c6ac21ccbfb91ec328ffb1ed21e492ef52d58
2015-08-20 11:42:58 +09:00
Peter Portante
067b41e854 In-process swift server for functional tests
Provide a way to run the functional tests using a p/a/c/o server setup
in the same process running the nosetests infrastructure.

By setting the environment variable, SWIFT_TEST_IN_PROCESS, to a true
value, the functional test framework will construct a set of proxy,
account, container and object servers running in the same process that
is running the functional tests, ignoring any external swift
service. This in-process swift environment is akin to the one used in
test/unit/proxy/test_server.py.

Setting that same environment variable to a false value will ensure the
in-process servers are not used.

When the above environment variable is not present, and the
/etc/swift/test.conf is _not_ present (or present but empty) on the
system where the functional tests are executing, the in-process
environment will be used. Previously, if no /etc/swift/test.conf file
was found, the tests would just be marked as skipped.

Using this in-process method allows one to gather code coverage using
the functional tests to exercise code paths, in addition to the unit
tests, or more easily debug existing functional tests, or even write new
ones.

There are two constraints that are changed for use with the in-process
functional tests: max_file_size is lowered to roughly 8 MB, and
client_timeout is set to 4s.

Change-Id: I5acd65e3068868d6509feae1d1954237d37fad45
2014-04-29 08:45:11 -04:00
ZhiQiang Fan
f72704fc82 Change OpenStack LLC to Foundation
Change-Id: I7c3df47c31759dbeb3105f8883e2688ada848d58
Closes-bug: #1214176
2013-09-20 01:02:31 +08:00
Clark Boylan
2d0ceb1e50 Verbose functional test request failures.
* test/__init__.py: Put safe_repr import/implementation here so that it
is available to functional and unit tests.

* test/functional/swift_test_client.py: When a request fails
record why that request failed, how many requests failed, and what the
request was when raising RequestError to aid in debugging. Makes use of
safe_repr from test/__init__.py.

* test/unit/common/test_constraints.py: Remove implementation of
safe_repr and use the implementation in test/__init__.py.

Change-Id: I6c957343fb4b8b95d3875fd5ca87b3cf28a5f47a
2013-09-11 10:26:24 -07:00
Clay Gerrard
ce12d66cf9 fix swift i18n
Change-Id: I53cea28a6d7593a1b308dbcf77dddf7f40d76cb2
2013-09-09 20:25:00 -07:00
Dirk Mueller
816c73e015 Add Apache 2.0 licensing headers
Change-Id: I38fae2a78b2369a897b7f298c1aead9b963bf7c9
2013-09-07 16:31:06 +02:00
Greg Lange
44f00a23c1 fixed some minor things in tests that pyflakes complained about
Change-Id: Ifeab56a964630bcf941e932fcbe39e6572e62975
2013-03-26 20:42:26 +00:00
Dan Dillinger
f7fdb9cf12 Implement unit_test config to disable syslog.
bug 701248
bug 819303

This change makes syslog optional, by providing a unit test
config with the ability to cause test/unit/__init__.py to
replace SysLogHandler with a fake logging class. The
default behavior is unchanged.

FakeLogger now inherits directly from Handler and mocks out
its API - this was a backward-compatibility issue.

Change-Id: I653dec148c4f6cf81759de03964c6a3290c1a290
2012-05-03 14:25:46 -04:00
Ewan Mellor
3373382284 Bug #820185: Intermittent TypeError NoneType in atexit handler of unit tests
Work around what appears to be a Python standard library bug by silencing
exceptions in the logging library.
2011-08-02 22:55:13 -07:00
Clay Gerrard
bdba519e02 PEP8 2011-02-24 16:21:14 -06:00
Clay Gerrard
92a5414f25 went ahead and spoofed a [func_test] section 2011-02-24 12:28:17 -06:00
Clay Gerrard
c1b3c8d799 better error messages on missing/malformed configs 2011-02-24 11:59:34 -06:00
Clay Gerrard
49ea0201f7 made functionalnosetests works with no account usernames 2011-02-23 11:29:06 -06:00
Clay Gerrard
a9201fc379 i need to pull in the changes to functionalnosetest/swift_testing.py 2011-02-22 22:25:38 -06:00
Clay Gerrard
d1fa1a0040 made functional tests more configurable
SWIFT_TEST_CONFIG_FILE can redirect both functional test suites to any conf
functional tests that don't require a account:username can now work with only
username for auth systems that don't support the account/namespace concept
2011-02-22 18:00:11 -06:00
Michael Barton
24590669d8 i18n finishup 2010-12-22 16:36:31 +00:00
Chuck Thier
001407b969 Initial commit of Swift code 2010-07-12 17:03:45 -05:00