2005-06-05 00:33:38 +00:00
|
|
|
#!/usr/bin/ruby
|
|
|
|
|
2005-06-09 06:18:27 +00:00
|
|
|
$:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..'))
|
2005-06-05 00:33:38 +00:00
|
|
|
|
|
|
|
require 'test/unit'
|
2005-07-09 21:18:49 +00:00
|
|
|
require 'msf/core'
|
2005-06-05 00:33:38 +00:00
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
|
|
|
class Module::Target::UnitTest < Test::Unit::TestCase
|
|
|
|
def test_target
|
2005-06-05 18:03:56 +00:00
|
|
|
t = Target.from_a(['Universal', {
|
|
|
|
'Platform' => 'winxpsp0',
|
|
|
|
'Ret' => 0x12345678
|
|
|
|
}])
|
2005-06-05 00:33:38 +00:00
|
|
|
|
|
|
|
assert_equal('Universal', t.name)
|
2005-09-24 18:42:29 +00:00
|
|
|
assert_equal(true, t.platform.supports?(Msf::Module::PlatformList.transform('winxpsp0')))
|
|
|
|
assert_equal(false, t.platform.supports?(Msf::Module::PlatformList.transform('winxpsp1')))
|
2005-06-05 18:03:56 +00:00
|
|
|
assert_equal(0x12345678, t['Ret'])
|
|
|
|
assert_equal(0x12345678, t.ret)
|
2005-06-05 00:33:38 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|