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.
bug/bundler_fix
Luke Imhoff 2014-07-22 09:47:35 -05:00
parent f3eb708dd1
commit 14fa49cdeb
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
1 changed files with 5 additions and 5 deletions

View File

@ -73,9 +73,9 @@ describe Msf::Ui::Console::CommandDispatcher::Db do
describe "-p" do
before(:each) do
host = FactoryGirl.create(:mdm_host, :workspace => framework.db.workspace, :address => "192.168.0.1")
FactoryGirl.create(:mdm_service, :host => host, :port => 1024, name: 'Service1')
FactoryGirl.create(:mdm_service, :host => host, :port => 1025, name: 'Service2')
FactoryGirl.create(:mdm_service, :host => host, :port => 1026, name: 'Service3')
FactoryGirl.create(:mdm_service, :host => host, :port => 1024, name: 'Service1', proto: 'udp')
FactoryGirl.create(:mdm_service, :host => host, :port => 1025, name: 'Service2', proto: 'tcp')
FactoryGirl.create(:mdm_service, :host => host, :port => 1026, name: 'Service3', proto: 'udp')
end
it "should list services that are on a given port" do
db.cmd_services "-p", "1024,1025"
@ -85,8 +85,8 @@ describe Msf::Ui::Console::CommandDispatcher::Db do
"",
"host port proto name state info",
"---- ---- ----- ---- ----- ----",
"192.168.0.1 1024 snmp Service1 open ",
"192.168.0.1 1025 snmp Service2 open "
"192.168.0.1 1024 udp Service1 open ",
"192.168.0.1 1025 tcp Service2 open "
]
end
end