diff options
author | elijah <elijah@riseup.net> | 2013-12-27 02:43:24 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-12-27 02:43:24 -0800 |
commit | 34678e895a5a40da6f444199983fee3f8ce518ee (patch) | |
tree | be92fdc1efa49ea177fcaf7632166087ac61f762 /tests/white-box/dummy.rb | |
parent | bf385beb22b7a17899604c21b764d84de55b23a8 (diff) |
added some network tests for stunnel
Diffstat (limited to 'tests/white-box/dummy.rb')
-rw-r--r-- | tests/white-box/dummy.rb | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/white-box/dummy.rb b/tests/white-box/dummy.rb index dd343769..6ca49754 100644 --- a/tests/white-box/dummy.rb +++ b/tests/white-box/dummy.rb @@ -26,8 +26,8 @@ class TestDummy < LeapTest pass end - def test_blah - fail "blah" #assert false + def test_fail + fail "fail" pass end @@ -36,8 +36,24 @@ class TestDummy < LeapTest pass end - def test_err - 12/0 + def test_socket_failure + assert_tcp_socket('localhost', 900000) + pass + end + + def test_socket_success + fork { + Socket.tcp_server_loop('localhost', 12345) do |sock, client_addrinfo| + begin + sock.write('hi') + ensure + sock.close + exit + end + end + } + sleep 0.2 + assert_tcp_socket('localhost', 12345) pass end |