Skip to content

Commit

Permalink
regress: run the proxies on a different port
Browse files Browse the repository at this point in the history
Soon we may want to run (some) proxies with the proxy-protocol so
we can't reuse the same port.
  • Loading branch information
omar-polo committed Aug 3, 2024
1 parent 19dc21b commit 9360fb1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ Execute
$ make regress

to start the suite. Keep in mind that the regression tests needs to
create a few file inside the `regress` directory and bind the 10965
port.
create a few file inside the `regress` directory and bind the 10965 and
10966 ports.


## Contributing
Expand Down
7 changes: 4 additions & 3 deletions regress/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ run_test() {
ggflags=
host="$REGRESS_HOST"
port=10965
proxy_port=10966
config_common="log syslog off"
hdr=
body=
Expand Down Expand Up @@ -86,7 +87,7 @@ set_proxy() {
server "localhost.local" {
cert "$PWD/localhost.pem"
key "$PWD/localhost.key"
listen on $host port $port
listen on $host port $proxy_port
proxy {
relay-to localhost port $port
$1
Expand Down Expand Up @@ -117,13 +118,13 @@ setup_simple_test() {
# usage: get <path>
# return the body of the request on stdout
get() {
$gg -q -T10 $ggflags "gemini://$gghost:10965/$1" || true
$gg -q -T10 $ggflags "gemini://$gghost:$port/$1" || true
}

# usage: head <path>
# return the meta response line on stdout
head() {
$gg -q -T10 -d header $ggflags "gemini://$gghost:10965/$1" || true
$gg -q -T10 -d header $ggflags "gemini://$gghost:$port/$1" || true
}

# usage: fetch <path>
Expand Down
4 changes: 2 additions & 2 deletions regress/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,14 @@ test_proxy_relay_to() {

run

ggflags="-P localhost:$port -H localhost.local"
ggflags="-P localhost:$proxy_port -H localhost.local"

fetch /
check_reply "20 text/gemini" "# hello world"
}

test_proxy_with_certs() {
ggflags="-P localhost:$port -H localhost.local"
ggflags="-P localhost:$proxy_port -H localhost.local"

# first test using the valid keys

Expand Down

0 comments on commit 9360fb1

Please sign in to comment.