Cleans up rake output for MSFIntegration Unit tests. Fixes issue 28

This commit is contained in:
Saafan
2012-01-05 16:14:51 +02:00
parent 93b2f62f28
commit a5c6179e10
2 changed files with 8 additions and 3 deletions

View File

@@ -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

View File

@@ -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