Skip to content
Snippets Groups Projects

tests: Add an HTTP integration test

Merged Clara Engler requested to merge cve/onionmasq:dev/cve/httpd into main
1 unresolved thread

This commit adds an HTTP integration test that performs an HTTP GET request on a dummy server that simply returns the client address.

The purpose of this is to test connectivity to hosts in localhost.

See #120 (closed), #111

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
tests/http.sh 0 → 100755
1 #!/usr/bin/env bash
2
3 set -euo pipefail
4
5 echo -n "starting HTTP server ... "
6 ./tests/httpd.py &> /dev/null &
7 pid=$!
8 sleep 1
9 echo "ok (pid: $pid)"
10
11 echo -n "performing a simple HTTP request ... "
12 resp=$(curl --silent "http://127.0.0.1:8080")
13 if [[ "$resp" != "127.0.0.1" ]]; then
14 echo "error: did not received a 127.0.0.1 back"
15 kill -9 $pid
  • Looks good -- nothing blocking here.

  • Alexander Hansen Færøy approved this merge request

    approved this merge request

  • mentioned in commit 777a3492

  • Please register or sign in to reply
    Loading