Commit Graph
8 Commits
Author SHA1 Message Date
Castulo Martinez b135d49deb Testlib: option to force a response in web server
Sometimes is useful for some tests to be able to force an http code that
corresponds to a filure when using the test web server, that way we can
simulate network problems very easily.

This commit adds an option for forcing the web server to return a
specified http code.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-02-01 12:30:45 -08:00
Castulo Martinez 89c7d390a9 Merge both python test servers into one
We were using an http server based on the SimpleHTTPRequestHandler to
run most of our server-related tests except for one which was using an
http server based on the BaseHTTPRequestHandler.

This commit merges the functionality of both server clasesses into one
so we use the same one for all future tests.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2018-12-27 09:34:01 -08:00
Castulo Martinez 11ee0ee8ad Timeout for testing connection in swupd init
As part of the swupd initialization, curl is initialized, which means it
is configured and the connection is tested. When configuring curl for
this test, no timeout was being configured, which was causing curl to
hang waiting for a response from the server if the server was unresponsive.

This commit configures the curl timeouts the same way they are being
configured when downloading files, so in case we get an unresponsive
server (or mirror) it doesn't get stuck forever.

Closes #669

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2018-12-27 09:34:01 -08:00
Castulo Martinez 58443d50d7 Adding options to further control server.py
The server.py script is used in some functional tests to simulate
a slow content server. This commit provides a few extra options
that extend the use of this script for testing purposes.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2018-12-13 14:11:55 -08:00
Castulo Martinez 8b134041d0 Changes to comply with PEP8
PEP8 dictates the style conventions for Python, complying with these
standards is a good practice.

This commit makes a few small changes to comply with PEP8 standards.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2018-12-07 11:38:07 -08:00
John Akre 1640fadc8a test: Move test files out of /tmp
Some tests wrote files and directories to /tmp. This change moves the
test certificates directory into the swupd repo's top level directory
and moves other test files into their corresponding test directories.

Fixes #650

Signed-off-by: John Akre <john.w.akre@intel.com>
2018-11-12 14:30:45 -08:00
John Akre 897f5d44c8 test: consolidate test web server implementations
There were two web server implementations in the functional tests and the
test library's slow server implementation was not functional. These issues
were addressed by the following changes:

- Consolidate test web server implementations into test library
- Add partial download support to start_web_server test library function
- Fix test library slow server functionality.

Signed-off-by: John Akre <john.w.akre@intel.com>
2018-10-24 09:56:02 -07:00
John Akre 6eb95d4198 Add web server test objects to testlib
This commit adds the following test objects to testlib:

- start_web_server
- destroy_web_server

This change moves the implementation of web server creation and
destruction from individual tests to the test library.

Signed-off-by: John Akre <john.w.akre@intel.com>
2018-09-05 16:15:03 -07:00