1
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:
Luke Imhoff 2014-10-21 13:46:39 -05:00
parent 003d8547c4
commit da450f49a4
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8

View File

@ -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