Skip to content

Commit 1fcd20b

Browse files
committed
adding a spec to show creating a core and login
1 parent c20cdc2 commit 1fcd20b

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

spec/lib/msf/ui/console/command_dispatcher/creds_spec.rb

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,31 @@
445445
end
446446
end
447447
context 'Cores with Logins' do
448-
448+
let(:address) { '192.168.0.1' }
449+
let(:port) { 80 }
450+
let(:proto) { 'tcp' }
451+
let(:name) { 'Web Service' }
452+
context 'With valid params' do
453+
let(:create_core_with_login) {
454+
creds.cmd_creds(
455+
'add', "user:#{username}", "password:#{password}", "realm:#{realm}",
456+
"address:#{address}", "port:#{port}", "protocol:#{proto}", "service-name:#{name}")
457+
}
458+
it 'creates a core' do
459+
expect { create_core_with_login }.to change { Metasploit::Credential::Core.count }.by 1
460+
end
461+
it 'creates a login' do
462+
expect { create_core_with_login }.to change { Metasploit::Credential::Login.count }.by 1
463+
end
464+
it 'creates a service' do
465+
expect { create_core_with_login }.to change { Mdm::Service.count }.by 1
466+
end
467+
it 'creates a host' do
468+
expect { create_core_with_login }.to change { Mdm::Host.count }.by 1
469+
end
470+
end
471+
472+
449473
end
450474
end
451475
end

0 commit comments

Comments
 (0)