CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/spec/support/shared/contexts/msf/db_manager.rb
Views: 11789
1
RSpec.shared_context 'Msf::DBManager' do
2
include_context 'Msf::Simple::Framework'
3
4
let(:active) do
5
true
6
end
7
8
let(:db_manager) do
9
if ENV['REMOTE_DB']
10
require 'metasploit/framework/data_service/remote/managed_remote_data_service'
11
remote_data_service = Metasploit::Framework::DataService::ManagedRemoteDataService.instance.remote_data_service
12
framework.db.register_data_service(remote_data_service)
13
end
14
15
framework.db.get_data_service
16
end
17
18
before(:example) do
19
# already connected due to use_transactional_fixtures, but need some of the side-effects of #connect
20
db_manager.workspace = db_manager.default_workspace
21
allow(db_manager).to receive(:active).and_return(active)
22
end
23
end
24
25