* add dotted quad validation tests (to prove the current one is broken :P )
git-svn-id: file:///home/svn/incoming/trunk@3669 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
54540f7eb7
commit
e70b6f7cfe
|
@ -8,6 +8,15 @@ require 'rex/socket/tcp'
|
|||
|
||||
class Rex::Socket::UnitTest < Test::Unit::TestCase
|
||||
|
||||
def test_ip
|
||||
assert_equal(true,Rex::Socket.dotted_ip?('0.0.0.0'), 'valid IP min')
|
||||
assert_equal(true,Rex::Socket.dotted_ip?('255.255.255.255'), 'valid IP max')
|
||||
assert_equal(false,Rex::Socket.dotted_ip?('0.0.0.0.0'), 'too many sections')
|
||||
assert_equal(false,Rex::Socket.dotted_ip?('0..0.0.0'), 'too many dots')
|
||||
assert_equal(false,Rex::Socket.dotted_ip?('00.0.0'), 'not enough dots')
|
||||
assert_equal(false,Rex::Socket.dotted_ip?('256.256.256.256'), 'numbers too big')
|
||||
end
|
||||
|
||||
def test_create
|
||||
port = 64442
|
||||
serv = TCPServer.new('127.0.0.1', port)
|
||||
|
|
Loading…
Reference in New Issue