fixed some stuff
git-svn-id: file:///home/svn/incoming/trunk@2588 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
a0b6980813
commit
e1c4b45e2f
|
@ -10,9 +10,6 @@ module Msf
|
||||||
class Exploit::UnitTest < Test::Unit::TestCase
|
class Exploit::UnitTest < Test::Unit::TestCase
|
||||||
|
|
||||||
class StubExploit < Msf::Exploit
|
class StubExploit < Msf::Exploit
|
||||||
def auto_target
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class Stub2Exploit < Msf::Exploit
|
class Stub2Exploit < Msf::Exploit
|
||||||
|
@ -21,9 +18,6 @@ class Exploit::UnitTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_support
|
def test_support
|
||||||
assert_equal(false, Exploit.new.supports_auto_target?, "auto target support check failed")
|
|
||||||
assert_equal(true, StubExploit.new.supports_auto_target?, "auto target deriv enabled support check failed")
|
|
||||||
assert_equal(false, Stub2Exploit.new.supports_auto_target?, "auto target deriv disabled support check failed")
|
|
||||||
assert_equal(false, Exploit.new.supports_check?, "auto target support check failed")
|
assert_equal(false, Exploit.new.supports_check?, "auto target support check failed")
|
||||||
assert_equal(false, StubExploit.new.supports_check?, "auto target deriv enabled support check failed")
|
assert_equal(false, StubExploit.new.supports_check?, "auto target deriv enabled support check failed")
|
||||||
assert_equal(true, Stub2Exploit.new.supports_check?, "auto target deriv disabled support check failed")
|
assert_equal(true, Stub2Exploit.new.supports_check?, "auto target deriv disabled support check failed")
|
||||||
|
@ -36,7 +30,6 @@ class Exploit::UnitTest < Test::Unit::TestCase
|
||||||
e = Exploit.new
|
e = Exploit.new
|
||||||
|
|
||||||
assert_equal(Msf::Exploit::CheckCode::Unsupported, e.check, "invalid default check")
|
assert_equal(Msf::Exploit::CheckCode::Unsupported, e.check, "invalid default check")
|
||||||
assert_equal(nil, e.auto_target, "invalid default auto_target")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Rex::Encoding::Xor::Generic::UnitTest < Test::Unit::TestCase
|
||||||
|
|
||||||
def hook_static_encode(data, key, expected)
|
def hook_static_encode(data, key, expected)
|
||||||
if enc.keysize != 0 && key.length != enc.keysize
|
if enc.keysize != 0 && key.length != enc.keysize
|
||||||
assert_raise(ArgumentError) { enc.encode(data,key) }
|
assert_raise(Rex::ArgumentError) { enc.encode(data,key) }
|
||||||
else
|
else
|
||||||
assert_equal(enc.encode(data, key), expected)
|
assert_equal(enc.encode(data, key), expected)
|
||||||
end
|
end
|
||||||
|
@ -21,10 +21,10 @@ class Rex::Encoding::Xor::Generic::UnitTest < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_static_encode
|
def test_static_encode
|
||||||
# Test key of zero length
|
# Test key of zero length
|
||||||
assert_raise(ArgumentError) { enc.encode("\x00", "") }
|
assert_raise(Rex::ArgumentError) { enc.encode("\x00", "") }
|
||||||
|
|
||||||
# Test non-string key
|
# Test non-string key
|
||||||
assert_raise(ArgumentError) { enc.encode("\x00\x01", 1) }
|
assert_raise(Rex::ArgumentError) { enc.encode("\x00\x01", 1) }
|
||||||
|
|
||||||
# some simple single byte tests with 0x00
|
# some simple single byte tests with 0x00
|
||||||
30.times {
|
30.times {
|
||||||
|
|
Loading…
Reference in New Issue