0dde5052bb
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> |
||
---|---|---|
3rdparty | ||
build | ||
data | ||
docs | ||
headers | ||
src | ||
.editorconfig | ||
.gitignore | ||
.gitreview | ||
configure | ||
Jamfile | ||
Jamrules | ||
lgtm.yml | ||
License.md | ||
ReadMe.Compiling.md | ||
ReadMe.md |
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:
- http://xref.plausible.coop/ (OpenGrok, provided by Landon Fuller)
- http://cgit.haiku-os.org/ (cgit, provided by Haiku, Inc.)
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.