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:
parent
b4d6ba1170
commit
2b5d69447a
11
test/tests/00_create_all_modules.rb
Executable file
11
test/tests/00_create_all_modules.rb
Executable 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
|
15
test/tests/01_all_exploits_have_payloads.rb
Executable file
15
test/tests/01_all_exploits_have_payloads.rb
Executable 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
10
test/tests/testbase.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user