Log untested payloads to stderr

MSP-11145

This commit is a proof that the logger works.  It does no connect the
adding tested payloads reference names to the
actual_ancestor_reference_name_set to show that the logger is working.
This commit is contained in:
Luke Imhoff 2014-10-21 12:44:01 -05:00
parent 162c62f205
commit 653c5ccf4a
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
1 changed files with 27 additions and 2 deletions

View File

@ -63,11 +63,36 @@ describe 'modules/payloads' do
end
end
modules_pathname = Pathname.new(__FILE__).parent.parent.parent.join('modules')
#
# lets
# Callbacks
#
modules_pathname = Pathname.new(__FILE__).parent.parent.parent.join('modules')
before(:all) do
@expected_ancestor_reference_name_set = Set.new
@actual_ancestor_reference_name_set = Set.new
payloads_pathname = modules_pathname.join('payloads')
Dir.glob(payloads_pathname.join('**', '*.rb')) do |expected_ancestor_path|
expected_ancestor_pathname = Pathname.new(expected_ancestor_path)
expected_ancestor_reference_pathname = expected_ancestor_pathname.relative_path_from(payloads_pathname)
expected_ancestor_reference_name = expected_ancestor_reference_pathname.to_path.gsub(/.rb$/, '')
@expected_ancestor_reference_name_set.add(expected_ancestor_reference_name)
end
end
after(:all) do
missing_ancestor_reference_name_set = @expected_ancestor_reference_name_set - @actual_ancestor_reference_name_set
unless missing_ancestor_reference_name_set.empty?
formatted_missing_ancestor_reference_names = missing_ancestor_reference_name_set.sort.join("\n ")
$stderr.puts "Some payloads are untested:\n #{formatted_missing_ancestor_reference_names}"
end
end
context 'aix/ppc/shell_bind_tcp' do
it_should_behave_like 'payload can be instantiated',