1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-05 14:57:30 +01:00

Adds some rspec tests for the framework class, ensure that all modules can be created and have payloads listed

git-svn-id: file:///home/svn/framework3/trunk@7109 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2009-10-01 18:18:01 +00:00
parent b4d6ba1170
commit 2b5d69447a
3 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,11 @@
require 'testbase'
describe Msf::Simple::Framework do
$msf.modules.each_module do |m|
ref,klass = m
it "should be able create #{ref}" do
e = $msf.modules.create(ref)
e.should_not == nil
end
end
end

View File

@ -0,0 +1,15 @@
require 'testbase'
describe Msf::Simple::Framework do
$msf.exploits.each_module do |m|
e = $msf.exploits.create(m)
it "#{m} should have compatible payloads" do
if(not e.default_target)
e.datastore['TARGET'] = 0
end
r = e.compatible_payloads
r.length.should_not == 0
end
end
end

10
test/tests/testbase.rb Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env
$:.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', 'lib'))
require 'rex'
require 'msf/core'
require 'msf/base'
require 'msf/ui'
$msf = Msf::Simple::Framework.create