Go to file
Kyle Ambroff-Kao 0dde5052bb tests/net: Working integration tests for HTTP client
This patch is part 1 of 3 with the goal of having a working
integration test harness for BHttpRequest. In this patch the existing
test cases were expanded and fixed for HTTP. In followup patches the
test harness will be updated to support HTTPS and reverse proxies.

Before this patch the tests for BHttpRequest had hard dependencies on
the external services httpbin.org and portquiz.net. These tests
eventually stopped working because the owner of those services made
changes, causing the assertions in these tests to fail.

The goal of these patches is to make a test harness that allows for
the same kinds of end-to-end integration tests but without any
external dependencies.

The test suite now includes a Python script called testserver.py which
is a HTTP echo server of sorts. When it receives a request, it will
echo the request headers and request body back to the client as a
text/plain response body.

The TestServer class manages the lifecycle of this testserver.py
process. Each test case calls Start() on the server to start a new
instance, and then it is shut down when the destructor is called. On
each invocation a random port is assigned by the kernel in TestServer,
and that socket file descriptor is provided to the child testserver.py
script.

Authorization tests are supported, currently implementing Basic and
Digest auth. If the test server receives a request for a path
/auth/<auth-scheme>/<expected-username>/<expected-password>, then the
appropriate authorization scheme will be employed. For example, if
/auth/basic/foo/bar is used as the path, then the server will expect
the Authorization header to contain an appropriate Basic auth
payload.

The tests now perform a bit more validation than before, validating
the expected HTTP headers and response body is returned from the
server.

The following tests are not fixed yet or were removed:
* PortTest was removed entirely since I'm not sure of the point of this
  test, and that functionality seems to be covered by the existing tests
  anyway.
* HTTPS tests are not functional yet, but will be in a followup
  patch. THis requires updating testserver.py to generate a
  self-signed TLS cert if --use-tls is provided.
* ProxyTest was disabled before this patch, but can be enabled in a
  followup patch by providing a reverse proxy in the test harness.

Change-Id: Ia201ef4583b7636c61e77072a03db936cb0092be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2243
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-02-16 08:34:08 +00:00
3rdparty docker/bootstrap: Add missing autopoint tools 2019-12-09 13:45:14 -06:00
build ImageRules: Use mformat's -f argument. 2020-02-08 15:45:18 -05:00
data Update translations from Pootle 2020-02-15 08:48:39 +00:00
docs Update userguide translations 2020-02-09 17:12:40 -05:00
headers kernel: x86: add some more cpuid flags. 2020-02-14 14:25:43 +00:00
src tests/net: Working integration tests for HTTP client 2020-02-16 08:34:08 +00:00
.editorconfig editorconfig: Add new config file around our unique style 2017-09-26 14:22:32 -05:00
.gitignore .gitignore: Ignore .DS_Store (Mac OS X directory attribute files). 2016-06-18 18:25:40 -04:00
.gitreview gerrit: Add .gitreview config 2018-01-04 00:04:02 -06:00
configure configure: Building GCC2-only Haiku is not supported anymore. 2020-02-08 13:25:23 -05:00
Jamfile Jamfile: gutenprint -> gutenprint8. 2019-05-14 19:32:29 -04:00
Jamrules Revert "Jamrules: Include the UserBuildConfig before processing repositories." 2019-09-15 17:33:36 +02:00
lgtm.yml Initial version of lgtm.com configuration file. 2019-09-19 04:03:09 +00:00
License.md LICENSE: Rename to License.md, and remove all licenses but the MIT. 2016-07-29 17:36:17 -04:00
ReadMe.Compiling.md Update readme.compiling 2020-02-03 13:39:46 +01:00
ReadMe.md README: Drop dead OpenGrok link, add our cgit. 2019-10-18 18:08:25 +00:00

Haiku

Homepage | Mailing Lists | IRC Channels | Issue Tracker | API docs

Haiku is an open-source operating system that specifically targets personal computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful.

Goals

  • Sensible defaults with minimal configuration required.
  • Clean, clear, concise code.
  • Unified desktop environment.

Trying Haiku

Haiku provides pre-built nightly images and release images. Haiku is compatible with a large variety of hardware, but in case you don't want to "take the plunge" and install Haiku on bare metal, you can install it on a virtual machine (VM) instead. If you've never used a VM before, you can follow one of the "Emulating Haiku" guides.

Compiling Haiku

See ReadMe.Compiling.

Contributing

Haiku is a meritocratic open source project with a large variety of tasks. Even if you can't write code, you can still help! Haiku needs designers, (technical) writers, translators, testers... Get involved and help out!

Contributing code

If you're submitting a patch to us, please make sure you're following the patch submitting guidelines.

If you're having trouble finding something in the source tree, you can use one of our web-based source code browsers:

Contributing documentation

The main piece of documentation that still needs work are the API docs (found in the tree at docs/user). Just find an undocumented class, write documentation for it, and submit a patch.

Contributing translations

See wiki:i18n.

Contributing software ports

See HaikuPorts.

Contributing to our infrastructure

See Infrastructure.