luaposix icon indicating copy to clipboard operation
luaposix copied to clipboard

socket test script

Open zevv opened this issue 12 years ago • 6 comments
trafficstars

zevv avatar Apr 16 '13 15:04 zevv

I'd have to look into the details, but my guess is that this stuff is hard to test as a standalone unit. To be able to test IPv6 the host should have IPv6 connectivity configured and enabled, and should allow the tests to bind ports and connect to the outside world. Not sure if this is something which can be properly tested with something like Travis...

zevv avatar Jun 27 '13 18:06 zevv

Thanks for the swift response! :)

I think its more to do with whether the luaposix socket calls provide everything needed to check whether the functionality required is available before trying to run an unsupported test. This is surely possible with C, so if it can't (yet) be done with luaposix from the Lua side, then I see no technical reason why it can't be fixed by exposing the APIs that C would use to make the pre-test checks.

Plainly, Mac OS has perfectly functional sockets, and most Linux software compiles on the Mac with very little patching (ref. Homebrew). If I need to add a skip function to Specl for gracefully exiting tests that are discovered to be incompatible in the pre-test phase, it would be quite a quick feature to implement.

I sometimes hear the term: a simple matter of programming ;-)

gvvaughan avatar Jun 27 '13 19:06 gvvaughan

Actually, an explicit skip function is not required in recent Specl, because it only reports on examples that fire expect commands. Conditionally running an example is as simple as this:

- describe ipv6 only functionality:
    if posix.IPPROTO_IPV6 then
      expect (ipv6 stuff).to_contain (ipv6 only results)
    end

And reporting will automatically elide that test case if the expect is not reached.

gvvaughan avatar May 30 '14 04:05 gvvaughan

The test for this issue started passing unexpectedly for me, since I merged today's commits.

rrthomas avatar Dec 17 '14 00:12 rrthomas

It passes unexpectedly for me on my dev machines, but fails on Travis (Ubuntu Precise?) last I checked.

gvvaughan avatar Jan 19 '15 23:01 gvvaughan

See https://travis-ci.org/luaposix/luaposix/jobs/51387861 : one appears to be passing, but not the other (unless I am misreading the log).

rrthomas avatar Feb 19 '15 15:02 rrthomas