Skip to content

Commit

Permalink
fix ipv6 tests
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Cormack <justin@specialbusservice.com>
  • Loading branch information
justincormack committed Dec 13, 2015
1 parent 185c1a6 commit 5148bc3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ test_sockets_pipes = {
local sa = assert(t.sockaddr_in6(0, "loopback"))
assert_equal(sa.family, c.AF.INET6)
ok, err = ss:bind(sa)
if err.ADDRNOTAVAIL then error "skipped" end
if not ok and err.ADDRNOTAVAIL then error "skipped" end
assert(ok, err)
local ba = assert(ss:getsockname())
assert_equal(ba.family, c.AF.INET6)
Expand Down Expand Up @@ -1459,7 +1459,7 @@ test_sockets_pipes = {
local sa = assert(t.sockaddr_in6(0, "loopback"))
assert_equal(sa.family, c.AF.INET6)
ok, err = ss:bind(sa)
if err.ADDRNOTAVAIL then error "skipped" end
if not ok and err.ADDRNOTAVAIL then error "skipped" end
assert(ok, err)
local ba = assert(ss:getsockname())
assert_equal(ba.family, c.AF.INET6)
Expand Down Expand Up @@ -1503,7 +1503,7 @@ test_sockets_pipes = {
local sa = assert(t.sockaddr_in6(0, "loopback"))
assert_equal(sa.family, c.AF.INET6)
ok, err = ss:bind(sa)
if err.ADDRNOTAVAIL then error "skipped" end
if not ok and err.ADDRNOTAVAIL then error "skipped" end
assert(ok, err)
local ba = assert(ss:getsockname())
assert_equal(ba.family, c.AF.INET6)
Expand Down Expand Up @@ -1542,7 +1542,7 @@ test_sockets_pipes = {
local cs = assert(S.socket("inet6", "dgram"))
local sa = assert(t.sockaddr_in6(0, loop6))
ok, err = ss:bind(sa)
if err.ADDRNOTAVAIL then error "skipped" end
if not ok and err.ADDRNOTAVAIL then error "skipped" end
assert(ok, err)
local bsa = ss:getsockname() -- find bound address
local n = assert(cs:sendto(teststring, nil, c.MSG.NOSIGNAL or 0, bsa)) -- got a sigpipe here on MIPS
Expand Down Expand Up @@ -1655,7 +1655,7 @@ test_sockets_pipes = {
local s = assert(S.socket("inet6", "stream"))
local sa = t.sockaddr_in6(0, "loopback")
ok, err = s:bind(sa)
if err.ADDRNOTAVAIL then error "skipped" end
if not ok and err.ADDRNOTAVAIL then error "skipped" end
assert(ok, err)
assert_equal(s:getsockopt("socket", "keepalive"), 0)
assert(s:setsockopt("socket", "keepalive", 1))
Expand All @@ -1680,7 +1680,7 @@ test_sockets_pipes = {
local s = assert(S.socket("inet6", "stream"))
local sa = t.sockaddr_in6(0, "loopback")
ok, err = s:bind(sa)
if err.ADDRNOTAVAIL then error "skipped" end
if not ok and err.ADDRNOTAVAIL then error "skipped" end
assert(ok, err)
assert_equal(s:getsockopt(c.IPPROTO.TCP, c.TCP.NODELAY), 0)
assert(s:setsockopt(c.IPPROTO.TCP, c.TCP.NODELAY, 1))
Expand Down

0 comments on commit 5148bc3

Please sign in to comment.