Cleans up rake output for MSFIntegration Unit tests. Fixes issue 28
This commit is contained in:
@@ -34,6 +34,7 @@ module Metasploit
|
||||
|
||||
@lock = false
|
||||
@lastauth = nil
|
||||
@unit_test = false
|
||||
opts = {
|
||||
:host => @config['host'] || '127.0.0.1',
|
||||
:port => @config['port'] || 55552,
|
||||
@@ -63,6 +64,9 @@ module Metasploit
|
||||
ret
|
||||
end
|
||||
|
||||
def unit_test_init
|
||||
@unit_test = true
|
||||
end
|
||||
# login into metasploit
|
||||
def login
|
||||
get_lock()
|
||||
@@ -74,7 +78,7 @@ module Metasploit
|
||||
return false
|
||||
end
|
||||
|
||||
print_info 'Successful connection with Metasploit.' if not @lastauth
|
||||
print_info 'Successful connection with Metasploit.' if (!@lastauth && !@unit_test)
|
||||
|
||||
@lastauth = Time.now
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class TC_Metasploit < Test::Unit::TestCase
|
||||
|
||||
def setup
|
||||
$root_dir="../../"
|
||||
$:.unshift File.join( %w{ ../../ } )
|
||||
$:.unshift File.join( %w{ ../../ } )
|
||||
end
|
||||
|
||||
#
|
||||
@@ -45,6 +45,7 @@ class TC_Metasploit < Test::Unit::TestCase
|
||||
load_config
|
||||
require 'extensions/metasploit/extension.rb'
|
||||
@api = BeEF::Extension::Metasploit::RpcClient.instance
|
||||
@api.unit_test_init()
|
||||
end
|
||||
|
||||
#
|
||||
@@ -73,7 +74,7 @@ class TC_Metasploit < Test::Unit::TestCase
|
||||
# Verify that the login is working
|
||||
#
|
||||
def test_login
|
||||
new_api
|
||||
new_api
|
||||
assert(@api.login)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user