mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-09-18 14:00:12 +02:00
small changes, making testing of msfconsole output easier
git-svn-id: file:///home/svn/framework3/trunk@11435 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
b5d0f1837f
commit
45efaa2088
@ -104,6 +104,9 @@ class Regexr
|
|||||||
re = Regexp.new(condition, @case_insensitive)
|
re = Regexp.new(condition, @case_insensitive)
|
||||||
data_lines.each {|line|
|
data_lines.each {|line|
|
||||||
if line =~ re
|
if line =~ re
|
||||||
|
if @verbose
|
||||||
|
puts "DEBUG: matched success: " + line
|
||||||
|
end
|
||||||
success_count += 1
|
success_count += 1
|
||||||
matched = true
|
matched = true
|
||||||
break
|
break
|
||||||
@ -121,13 +124,14 @@ class Regexr
|
|||||||
|
|
||||||
if target_successes == success_count
|
if target_successes == success_count
|
||||||
if @verbose
|
if @verbose
|
||||||
puts "DEBUG: woot, got all successes"
|
puts "DEBUG: Woot, got all successes"
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
if @verbose
|
if @verbose
|
||||||
puts "DEBUG: Didn't get enough successes, somehow. (" + count + "/" + target_successes + ")"
|
puts "DEBUG: Didn't get enough successes, failing. (" + count + "/" + target_successes + ")"
|
||||||
end
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return true # No successes are defined, so count this as a pass (true).
|
return true # No successes are defined, so count this as a pass (true).
|
||||||
@ -151,7 +155,7 @@ class Regexr
|
|||||||
okay = false # oh, we found a match
|
okay = false # oh, we found a match
|
||||||
|
|
||||||
if @verbose
|
if @verbose
|
||||||
puts "found " + line
|
puts "DEBUG: Matched failure: " + line
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -162,7 +166,7 @@ class Regexr
|
|||||||
# If the exception matches here, we'll spare it
|
# If the exception matches here, we'll spare it
|
||||||
if reg_exception =~ line
|
if reg_exception =~ line
|
||||||
if @verbose
|
if @verbose
|
||||||
puts "\'" + line + "\' is an exception, we can ignore it."
|
puts "DEBUG: but \'" + line + "\' is an exception, we can ignore it."
|
||||||
end
|
end
|
||||||
okay = true
|
okay = true
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user