mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-10-29 18:07:27 +01:00
Fail rake spec if untested payloads
MSP-11145 Add action to spec task that will cause spec to exit(1) if log/untested-payloads.log exists. The untested payloads are then printed with instructions of which spec to update.
This commit is contained in:
parent
003d8547c4
commit
da450f49a4
17
Rakefile
17
Rakefile
@ -9,3 +9,20 @@ require 'metasploit/framework/require'
|
||||
Metasploit::Framework::Require.optionally_active_record_railtie
|
||||
|
||||
Metasploit::Framework::Application.load_tasks
|
||||
|
||||
# append action to run after normal spec action
|
||||
task :spec do
|
||||
untested_payloads_pathname = Pathname.new 'log/untested-payloads.log'
|
||||
|
||||
if untested_payloads_pathname.exist?
|
||||
$stderr.puts "Untested payload detected. Add tests to spec/modules/payload_spec.rb for payloads classes composed of the following payload modules:"
|
||||
|
||||
untested_payloads_pathname.open do |f|
|
||||
f.each_line do |line|
|
||||
$stderr.write " #{line}"
|
||||
end
|
||||
end
|
||||
|
||||
exit 1
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user