Skip to content

Commit 7533370

Browse files
committed
Merge branch 'land/4028' into upstream-master
Land rapid7#4028
2 parents c765100 + 98a56d5 commit 7533370

File tree

7 files changed

+242
-0
lines changed

7 files changed

+242
-0
lines changed

spec/lib/msf/core/author_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'spec_helper'
2+
3+
describe Msf::Author do
4+
it 'is an alias for Msf::Module::Author' do
5+
expect(described_class.name).to eq('Msf::Module::Author')
6+
end
7+
end
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
require 'spec_helper'
2+
3+
describe Msf::Module::Failure do
4+
context 'CONSTANTS' do
5+
context 'None' do
6+
subject(:none) {
7+
described_class::None
8+
}
9+
it { is_expected.to eq('none') }
10+
end
11+
12+
context 'Unknown' do
13+
subject(:unknown) {
14+
described_class::Unknown
15+
}
16+
it { is_expected.to eq('unknown') }
17+
end
18+
context 'Unreachable' do
19+
subject(:unreachable) {
20+
described_class::Unreachable
21+
}
22+
it { is_expected.to eq('unreachable') }
23+
end
24+
25+
context 'BadConfig' do
26+
subject(:bad_config) {
27+
described_class::BadConfig
28+
}
29+
it { is_expected.to eq('bad-config') }
30+
end
31+
32+
context 'Disconnected' do
33+
subject(:disconnected) {
34+
described_class::Disconnected
35+
}
36+
it { is_expected.to eq('disconnected') }
37+
end
38+
39+
context 'NotFound' do
40+
subject(:not_found) {
41+
described_class::NotFound
42+
}
43+
it { is_expected.to eq('not-found') }
44+
end
45+
46+
context 'UnexpectedReply' do
47+
subject(:unexpected_reply) {
48+
described_class::UnexpectedReply
49+
}
50+
51+
it { is_expected.to eq('unexpected-reply') }
52+
end
53+
54+
context 'TimeoutExpired' do
55+
subject(:timeout_expired) {
56+
described_class::TimeoutExpired
57+
}
58+
59+
it { is_expected.to eq('timeout-expired') }
60+
end
61+
62+
context 'UserInterrupt' do
63+
subject(:user_interrupt) {
64+
described_class::UserInterrupt
65+
}
66+
67+
it { is_expected.to eq('user-interrupt') }
68+
end
69+
70+
context 'NoAccess' do
71+
subject(:no_access) {
72+
described_class::NoAccess
73+
}
74+
75+
it { is_expected.to eq('no-access') }
76+
end
77+
78+
context 'NoTarget' do
79+
subject(:no_target) {
80+
described_class::NoTarget
81+
}
82+
83+
it { is_expected.to eq('no-target') }
84+
end
85+
86+
context 'NotVulnerable' do
87+
subject(:not_vulnerable) {
88+
described_class::NotVulnerable
89+
}
90+
91+
it { is_expected.to eq('not-vulnerable') }
92+
end
93+
94+
context 'PayloadFailed' do
95+
subject(:payload_failed) {
96+
described_class::PayloadFailed
97+
}
98+
99+
it { is_expected.to eq('payload-failed') }
100+
end
101+
end
102+
end

spec/lib/msf/core/module_spec.rb

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,111 @@
3838
REF_TYPES = %w(CVE BID OSVDB EDB)
3939

4040
describe Msf::Module do
41+
it { is_expected.to respond_to :[] }
42+
it { is_expected.to respond_to :[]= }
43+
it { is_expected.to respond_to :alias }
44+
it { is_expected.to respond_to :arch? }
45+
it { is_expected.to respond_to :arch_to_s }
46+
it { is_expected.to respond_to :author_to_s }
47+
it { is_expected.to respond_to :auxiliary? }
48+
it { is_expected.to respond_to :check }
49+
it { is_expected.to respond_to :comm }
50+
it { is_expected.to respond_to :compat }
51+
it { is_expected.to respond_to :compatible? }
52+
it { is_expected.to respond_to :debugging? }
53+
it { is_expected.to respond_to :deregister_options }
54+
it { is_expected.to respond_to :derived_implementor? }
55+
it { is_expected.to respond_to :description }
56+
it { is_expected.to respond_to :disclosure_date }
57+
it { is_expected.to respond_to :each_arch }
58+
it { is_expected.to respond_to :each_author }
59+
it { is_expected.to respond_to :encoder? }
60+
it { is_expected.to respond_to :exploit? }
61+
it { is_expected.to respond_to :fail_with }
62+
it { is_expected.to respond_to :file_path }
63+
it { is_expected.to respond_to :framework }
64+
it { is_expected.to respond_to :fullname }
65+
it { is_expected.to respond_to :generate_uuid }
66+
it { is_expected.to respond_to :import_defaults }
67+
it { is_expected.to respond_to :info_fixups }
68+
it { is_expected.to respond_to :init_compat }
69+
it { is_expected.to respond_to :merge_check_key }
70+
it { is_expected.to respond_to :merge_info }
71+
it { is_expected.to respond_to :merge_info_advanced_options }
72+
it { is_expected.to respond_to :merge_info_alias }
73+
it { is_expected.to respond_to :merge_info_description }
74+
it { is_expected.to respond_to :merge_info_evasion_options }
75+
it { is_expected.to respond_to :merge_info_name }
76+
it { is_expected.to respond_to :merge_info_options }
77+
it { is_expected.to respond_to :merge_info_string }
78+
it { is_expected.to respond_to :merge_info_version }
79+
it { is_expected.to respond_to :name }
80+
it { is_expected.to respond_to :nop? }
81+
it { is_expected.to respond_to :orig_cls }
82+
it { is_expected.to respond_to :owner }
83+
it { is_expected.to respond_to :payload? }
84+
it { is_expected.to respond_to :platform? }
85+
it { is_expected.to respond_to :platform_to_s }
86+
it { is_expected.to respond_to :post? }
87+
it { is_expected.to respond_to :print_error }
88+
it { is_expected.to respond_to :print_good }
89+
it { is_expected.to respond_to :print_line }
90+
it { is_expected.to respond_to :print_line_prefix }
91+
it { is_expected.to respond_to :print_prefix }
92+
it { is_expected.to respond_to :print_status }
93+
it { is_expected.to respond_to :print_warning }
94+
it { is_expected.to respond_to :privileged? }
95+
it { is_expected.to respond_to :rank }
96+
it { is_expected.to respond_to :rank_to_h }
97+
it { is_expected.to respond_to :rank_to_s }
98+
it { is_expected.to respond_to :refname }
99+
it { is_expected.to respond_to :register_advanced_options }
100+
it { is_expected.to respond_to :register_evasion_options }
101+
it { is_expected.to respond_to :register_options }
102+
it { is_expected.to respond_to :register_parent }
103+
it { is_expected.to respond_to :replicant }
104+
it { is_expected.to respond_to :set_defaults }
105+
it { is_expected.to respond_to :share_datastore }
106+
it { is_expected.to respond_to :shortname }
107+
it { is_expected.to respond_to :support_ipv6? }
108+
it { is_expected.to respond_to :target_host }
109+
it { is_expected.to respond_to :target_port }
110+
it { is_expected.to respond_to :type }
111+
it { is_expected.to respond_to :update_info }
112+
it { is_expected.to respond_to :validate }
113+
it { is_expected.to respond_to :vprint_debug }
114+
it { is_expected.to respond_to :vprint_error }
115+
it { is_expected.to respond_to :vprint_good }
116+
it { is_expected.to respond_to :vprint_line }
117+
it { is_expected.to respond_to :vprint_status }
118+
it { is_expected.to respond_to :vprint_warning }
119+
it { is_expected.to respond_to :workspace }
120+
121+
context 'CONSTANTS' do
122+
context 'UpdateableOptions' do
123+
subject(:updateable_options) {
124+
described_class::UpdateableOptions
125+
}
126+
127+
it { is_expected.to match_array(%w{Name Description Alias PayloadCompat})}
128+
end
129+
end
130+
131+
context 'class' do
132+
subject {
133+
described_class
134+
}
135+
136+
it { is_expected.to respond_to :cached? }
137+
it { is_expected.to respond_to :fullname }
138+
it { is_expected.to respond_to :is_usable }
139+
it { is_expected.to respond_to :rank }
140+
it { is_expected.to respond_to :rank_to_h }
141+
it { is_expected.to respond_to :rank_to_s }
142+
it { is_expected.to respond_to :shortname }
143+
it { is_expected.to respond_to :type }
144+
end
145+
41146
describe '#search_filter' do
42147
let(:opts) { Hash.new }
43148
before { subject.stub(:fullname => '/module') }

spec/lib/msf/core/platform_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'spec_helper'
2+
3+
describe Msf::Platform do
4+
it 'is an alias for Msf::Module::Platform' do
5+
expect(described_class.name).to eq('Msf::Module::Platform')
6+
end
7+
end

spec/lib/msf/core/reference_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'spec_helper'
2+
3+
describe Msf::Reference do
4+
it 'is an alias for Msf::Module::Reference' do
5+
expect(described_class.name).to eq('Msf::Module::Reference')
6+
end
7+
end
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'spec_helper'
2+
3+
describe Msf::SiteReference do
4+
it 'is an alias for Msf::Module::SiteReference' do
5+
expect(described_class.name).to eq('Msf::Module::SiteReference')
6+
end
7+
end

spec/lib/msf/core/target_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'spec_helper'
2+
3+
describe Msf::Target do
4+
it 'is an alias for Msf::Module::Target' do
5+
expect(described_class.name).to eq('Msf::Module::Target')
6+
end
7+
end

0 commit comments

Comments
 (0)