Skip to content

Commit 14fa49c

Browse files
committed
Update spec to handle Mdm::Service#proto sequence
MSP-10029 Mdm::Service factories were changed in metasploit_data_models 0.19.0 to use a sequence that cycles between 'tcp' and 'udp'. To make the spec clearer, just hard-code the protos under test instead of relying on default behavior.
1 parent f3eb708 commit 14fa49c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spec/lib/msf/ui/command_dispatcher/db_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
describe "-p" do
7474
before(:each) do
7575
host = FactoryGirl.create(:mdm_host, :workspace => framework.db.workspace, :address => "192.168.0.1")
76-
FactoryGirl.create(:mdm_service, :host => host, :port => 1024, name: 'Service1')
77-
FactoryGirl.create(:mdm_service, :host => host, :port => 1025, name: 'Service2')
78-
FactoryGirl.create(:mdm_service, :host => host, :port => 1026, name: 'Service3')
76+
FactoryGirl.create(:mdm_service, :host => host, :port => 1024, name: 'Service1', proto: 'udp')
77+
FactoryGirl.create(:mdm_service, :host => host, :port => 1025, name: 'Service2', proto: 'tcp')
78+
FactoryGirl.create(:mdm_service, :host => host, :port => 1026, name: 'Service3', proto: 'udp')
7979
end
8080
it "should list services that are on a given port" do
8181
db.cmd_services "-p", "1024,1025"
@@ -85,8 +85,8 @@
8585
"",
8686
"host port proto name state info",
8787
"---- ---- ----- ---- ----- ----",
88-
"192.168.0.1 1024 snmp Service1 open ",
89-
"192.168.0.1 1025 snmp Service2 open "
88+
"192.168.0.1 1024 udp Service1 open ",
89+
"192.168.0.1 1025 tcp Service2 open "
9090
]
9191
end
9292
end

0 commit comments

Comments
 (0)