Skip to content

Commit

Permalink
Add integration test for ipv6.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcamiel committed Oct 23, 2023
1 parent fe39f03 commit 456d137
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 29 deletions.
10 changes: 10 additions & 0 deletions bin/test/test_integ.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ if [[ "$(uname -s)" = "Linux*" ]]; then
fi
fi

if [[ "$(uname -s)" = "Darwin" ]]; then
echo ">>>>>>>>>>>>>>>>>>>"
/usr/local/opt/curl/bin/curl --version
/usr/bin/curl --version
hurl --version
/usr/local/opt/curl/bin/curl --ipv6 --verbose https://google.com
/usr/bin/curl --ipv6 --verbose https://google.com
echo 'GET https://google.com' | hurl --ipv6 --very-verbose
echo ">>>>>>>>>>>>>>>>>>>"
fi

# integration tests
cd integration
Expand Down
8 changes: 8 additions & 0 deletions integration/tests_ok/ip.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">https://google.com</span></span>
<span class="line"><span class="section-header">[Options]</span></span>
<span class="line"><span class="string">ipv4</span>: <span class="boolean">true</span></span>
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
<span class="line"><span class="method">GET</span> <span class="url">https://google.com</span></span>
<span class="line"><span class="section-header">[Options]</span></span>
<span class="line"><span class="string">ipv6</span>: <span class="boolean">true</span></span>
</span></span></code></pre>
7 changes: 7 additions & 0 deletions integration/tests_ok/ip.hurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
GET https://google.com
[Options]
ipv4: true

GET https://google.com
[Options]
ipv6: true
1 change: 1 addition & 0 deletions integration/tests_ok/ip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"entries":[{"request":{"method":"GET","url":"https://google.com","options":[{"name":"ipv4","value":true}]}},{"request":{"method":"GET","url":"https://google.com","options":[{"name":"ipv6","value":true}]}}]}
2 changes: 2 additions & 0 deletions integration/tests_ok/ip.out.pattern
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Connected to google.com (~~~.~~~.~~~.~~~) port 443 (#0)
Connected to google.com (~~~~:~~~~:~~~~:~~~::~~~~) port 443 (#1)
5 changes: 5 additions & 0 deletions integration/tests_ok/ip.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
# GitHub runners only support IPV6 on macOS so we skip other OS (for the moment).
exit 255
hurl --very-verbose tests_ok/ip.hurl 2>&1 | grep 'Connected to google.com' | sed 's/^** //'
29 changes: 0 additions & 29 deletions integration/tests_ok/ip.py

This file was deleted.

9 changes: 9 additions & 0 deletions integration/tests_ok/ip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -Eeuo pipefail

# GitHub runners only support IPV6 on macOS so we skip other OS (for the moment).
if [[ "$(uname -s)" = "Linux" ]]; then
exit 255
fi

hurl --very-verbose tests_ok/ip.hurl 2>&1 | grep 'Connected to google.com' | sed 's/^** //'

0 comments on commit 456d137

Please sign in to comment.