From d57a155bf413c96ed8f9a0a716b923480cb76168 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Ketelaars?= <bjorn.ketelaars@hydroxide.nl>
Date: Wed, 27 Oct 2021 18:13:17 +0200
Subject: [PATCH] Fix (some) failing tests

Found a couple of failing tests on Alpine Linux and OpenBSD. For the
tests to even run `ip4-localhost` has to be changed to an IP-address
(127.0.0.1). `ip4-localhost` is typically not part of `/etc/hosts`.

Output failing tests:

```
not ok 5
udp: 0
prefix: tls:
listen [1]:
    host: localhost
    port: 9025
flushing deferred data to fd 9
selecting... max_fd=11 num_probing=0
activity on fd8
closing fd 8
closing fd 9
selecting... max_fd=11 num_probing=0
#   Failed test at ./t line 59.
#          got: '1'
#     expected: 'sslh-select: Connect and write nothing'
```

```
not ok 22 - sslh-select:ssh: probe connected correctly
#   Failed test 'sslh-select:ssh: probe connected correctly'
#   at ./t line 59.
#          got: 'regex'
#     expected: 'ssh'
```

```
not ok 68 - sslh-select:ssh: probe connected correctly
#   Failed test 'sslh-select:ssh: probe connected correctly'
#   at ./t line 59.
#          got: 'regex'
#     expected: 'ssh'
```

Diff works around issues causing tests 22 and 68 to fail. As of yet, no
workaround for test 5 has been found.
---
 test.cfg | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test.cfg b/test.cfg
index 4330cfa..2bb0edc 100644
--- a/test.cfg
+++ b/test.cfg
@@ -32,7 +32,7 @@ listen:
 (
     { host: "localhost"; port: "8080"; keepalive: true; },
     { host: "localhost"; port: "8081"; keepalive: true; },
-    { host: "ip4-localhost"; is_udp: true; port: "8086"; }
+    { host: "127.0.0.1"; is_udp: true; port: "8086"; }
 );
 
  
@@ -46,7 +46,7 @@ protocols:
      { name: "xmpp";  host: "localhost"; port: "9009"; },
      { name: "adb";  host: "localhost"; port: "9010"; },
      { name: "syslog"; host: "localhost"; port: "9013"; },
-     { name: "regex"; host: "ip4-localhost"; is_udp: true; port: "9020";
+     { name: "ssh"; host: "127.0.0.1"; is_udp: true; port: "9020";
          udp_timeout: 30;
          regex_patterns: [ "^foo" ];
      },