Conversation
|
@moogchi This is great. I see that in the test script, a local http server hosts webpages, which curl requests. Could you please add tests to request for webpages which are not local. This will involve dns resolution and other mechanisms and we would like to test that too. |
|
@vidyalakshmir Added 5 external URL tests (HTTP GET, HTTPS GET, content verification, redirect follow, HEAD request) that test DNS resolution and real network connectivity. Right now they auto-skip because getaddrinfo() fails for external hosts from inside the sandbox. Curl returns error 6 (Could not resolve host). Local networking works fine though. The tests will automatically run once DNS support is working. Also found that /etc/resolv.conf was missing from lindfs, but even after copying it in, DNS still doesn't resolve. Looks like it's a syscall-level limitation. |
|
@moogchi Could you test this again, now that Nick's DNS fix is merged into main? |
* feat: added shm changes * feat: added basic tests * fix: revert test removal * feat: added comments for clarity * fix: revert test cases * feat: added add_entry_with_overwrite error handeling * fix: added else block for error propogation * fix: removed nacl comment * feat: added shmat tests * fix: fixed length error * fix: length order fix * fix: reverted length error * fix: update syscall return * fix: update syscall return
Add curl test suite for lind-wasm
Summary
Adds a self-contained test runner (
curl/test.sh) that verifies curl functionality within the Lind sandbox. 30/30 tests pass.What's included
curl/test.sh— Test runner with 30 test cases covering:Basic functionality (3):
lindfs/bin/curlcurl --versionreturns valid outputcurl --helpreturns usage infoHTTP methods & status codes (6):
-X POST -d)-X PUT)Request options (7):
-H)-A)-L)-o)-w)-v)-s)HTTPS / TLS (2):
-k)--cacert)Data transfer (4):
-r)Timeouts & reliability (3):
--connect-timeout)--max-time)--retry)External URLs (5):
External tests probe DNS availability before running and auto-skip if DNS is unavailable.
How it works
Similar to the nginx test approach:
lindfs/tests/curl/www/$HTTP_PORT)lind_run bin/curlagainst local and external serversSetup requirements
--disable-ipv6and copied tolindfs/bin/curl/dev/urandomand/dev/randomdevice nodes in lindfs (script creates them if missing — required for TLS/SSL)python3andopensslon host (for test servers and certificate generation)Key findings
/dev/urandomrequired for TLS: HTTPS fails with "Insufficient randomness" without it. The script creates these device nodes if missing.PF_UNSPECDNS lookups broken:getaddrinfo()works withAF_INETbut fails withPF_UNSPEC("Temporary failure in name resolution"). Curl must be compiled with--disable-ipv6to forceAF_INETonly. Opened issue on lind-wasm repo.-k(insecure) to skip certificate verification.Test results
Usage