Commit Graph

57 Commits (59b5e8e688e646f819817608b7c7e631a0c881ad)

Author SHA1 Message Date
James Lee 904a69ba63 Move xor tests to the right filenames
Thanks, simplecov, for telling me that these weren't actually getting
run.
2013-02-25 13:02:03 -06:00
James Lee b497fdb72a Merge branch 'master' of github.com:rapid7/metasploit-framework into rapid7 2013-02-25 12:58:38 -06:00
James Lee ff9fc02fee Merge remote-tracking branch 'rapid7/feature/simplecov-groups' into rapid7 2013-02-25 12:54:04 -06:00
Tod Beardsley 73f6314373 Moving @cli and @ip to instance vars 2013-02-25 08:29:08 -06:00
Tod Beardsley caed599f7d Backed out all the fails from the auth bits 2013-02-25 08:26:02 -06:00
Tod Beardsley 6e35813d69 Pending hashes need to end w a block 2013-02-25 08:20:46 -06:00
James Lee 4a84528ecf Move pending messages to it()'s args 2013-02-20 15:02:12 -06:00
Tod Beardsley 5a0744934e Let's not intro functionality as testing
That's a bad habit to get into.
2013-02-11 21:06:52 -06:00
Tod Beardsley ba7f5a7245 Actually run this spec. 2013-02-11 21:04:57 -06:00
Tod Beardsley 039fd2b885 Adds some light testing for Rex's HTTP client lib
In light ofi PR #1476, it would be nice to have some basic, modern,
maintained testing on Rex's HTTP Client proto library.

My rspec fu is quite weak, of course, but this should cover the very
basic cases. There are lots of pending holes, but hey, it's a start.
2013-02-11 15:54:40 -06:00
egypt 9d4bc6bb89 Restructure a bit and add checks for doubled '//' 2013-01-31 15:34:34 -06:00
sinn3r d8b15daaf2 Correct rspect to the correct behavior 2013-01-30 16:13:17 -06:00
Luke Imhoff 3c2c808457 Better Rubymine compatibility for .simplecov
Rubymine's code coverage tools separate collection from reporting so
that multiple runs can have their data merged.  To separate, collecting
from reporting, SimpleCov.start is only run when not using Rubymine (as
indicated by a lack of the RM_INFO environment variable).  This way,
`rake spec` will collect coverage info and generate the report as
before, but Rubymine will only collect coverage when using 'Run ... with
coverage enabled' button and will only generate a report when using
'Generate Coverage Report' as is the intended behavior in Rubymine.
2013-01-18 11:12:16 -06:00
James Lee 2ee0c0d8fb Add simple specs for Rex::Encoding::Xor* 2013-01-15 16:59:01 -06:00
James Lee bbb3fa25be Allow negative values for OptInt
[FixRM #7540]
2013-01-14 14:18:56 -06:00
James Lee 0d34e0b249 Fix regex for hex numbers 2013-01-13 20:53:40 -06:00
James Lee 4703a6f737 Unbreak OptInt hex syntax
* Fix spec for no-longer-pending tests
* Fix regex in OptInt#valid? to allow hex syntax again

[See #1293][See #1296]
2013-01-12 14:17:29 -06:00
Tod Beardsley f6478678ce trailing whitespace 2012-12-27 23:08:50 -06:00
David Maloney ee6db8794e Basic specs for meterpreter packet parser 2012-12-27 17:19:37 -06:00
David Maloney 74e543ec5a add spec skeleton for packet parser 2012-12-27 14:23:05 -06:00
Tod Beardsley 10511e8281 Merge remote branch 'origin/bug/fix-double-slashes'
Ran the new normalize_uri() specs, all passes, so I'm quite confident in
this change.
2012-12-17 13:29:19 -06:00
sinn3r 1cb067e7ae Merge branch 'cleanup/option_specs' of git://github.com/jlee-r7/metasploit-framework into jlee-r7-cleanup/option_specs 2012-12-12 21:22:07 -06:00
David Maloney aaa8716f5b minor cleanup as per egypt 2012-12-12 10:12:42 -06:00
David Maloney c952ed0f87 Add test for raw format of packets 2012-12-07 12:51:53 -06:00
David Maloney b707f8d13a Packet specs now complete
82 tests for the packet lib
2012-12-07 12:32:34 -06:00
David Maloney 89c98ebd39 Finished tests for GroupTlv ftmp 2012-12-06 17:59:07 -06:00
David Maloney 468f637efe basics for adding tlvs to GroupTlv 2012-12-05 18:19:12 -06:00
David Maloney 5dcf573063 TLV tests down, on to GroupTlv 2012-12-05 17:55:28 -06:00
David Maloney 391ff5bbb0 basic TLV method tests 2012-12-05 15:44:03 -06:00
David Maloney b18f5b1875 Start with the duh stuff, responds_to 2012-12-05 14:39:29 -06:00
James Lee 2cbc15a22b Add #import_option and #from_file 2012-11-29 18:10:29 -06:00
James Lee e298c5b9cd Add a simple spec for DataStore 2012-11-29 17:28:15 -06:00
James Lee cf93a81110 Add specs and pending examples for more Opt*s
[SeeRM #7535]
[SeeRM #7536]
[SeeRM #7537]
[SeeRM #7539]
[SeeRM #7540]
2012-11-29 16:35:50 -06:00
James Lee 7f803744d2 Fix typo 2012-11-29 14:42:27 -06:00
James Lee 7f34586780 Add specs for several Opt* classes 2012-11-29 14:40:25 -06:00
James Lee 3205941a59 Use a SyntaxError instead of JumpError
Since the 1.8.7 behavior is insane. Also adds a require for msf/core so
this spec can run by itself.
2012-11-20 19:44:55 -06:00
Luke Imhoff 858cef83fe Add specs for normalize_uri 2012-11-08 13:22:07 -06:00
James Lee 57bb23ce3d Fix 1.9ism that breaks specs on 1.8 2012-11-08 09:55:29 -06:00
James Lee 26a145e527 Always overwrite the old module even when ambiguous 2012-11-07 18:51:12 -06:00
Luke Imhoff 16407f91c8 Rescue Errno::ENOENT from File.open in read_module_content
[Fixes #38426061, #38097411]

Msf::Modules::Loader::Directory#read_module_content may calculate a non-existent
module_path that gets passed to File.open causing an Errno::ENOENT exception
to be raised when using the module cache with a module that has been
moved to a new path (as is the case that originally found this bug) or
deleted.  Now, the exception is rescued and read_module_content returns
an empty string (''), which load_module detects with
module_content.empty? and returns earlier without attempting to module
eval the (empty) content.

As having Msf::Modules::Loader::Directory#read_module_content rescue the
exception, meant there was another place that needed to log and error
and store an error in Msf::ModuleManager#module_load_error_by_path, I
refactored the error reporting to call
Msf::Modules::Loader::Base#load_error, which handles writing to the log
and setting the Hash, so the error reporting is consistent across the
loaders.

The exception hierarchy was also refactored so that
namespace_module.metasploit_class now has an error raising counter-part:
namespace_module.metasploit_class! that can be used with
Msf::Modules::Loader::Base#load_error as it requires an exception, and
not just a string so the exception class, message, and backtrace can be
logged.
2012-11-06 17:38:38 -06:00
Luke Imhoff 236db52d3d Add simplecov for code coverage
Conflicts:
	Gemfile.lock
2012-11-06 16:30:41 -06:00
Luke Imhoff de07ca5f07 Merge branch 'bug/wrong-file_changed-argument' of github.com:/rapid7/metasploit-framework into bug/wrong-file_changed-argument 2012-10-31 11:49:02 -05:00
Luke Imhoff 471ac6d15d Use typed_enable?(type) instead of protected enablement_by_type[type]
Msf::Modules::Loader::Archive#each_module_reference_name tried to check
the enabled types for the module_manager by accessing the
enabledment_by_type Hash, which is protected.  Instead, it should use
the public type_enabled? method.

Add specs to test all of Msf::Modules::Loader::Archive while testing
each_module_reference_name.  In order to properly test that modules
could be found in archives, I had to produce a fastlib archive, so there
is now a spec for FastLib.dump and FastLib.load.  Some specs are marked
pending as I found a bug in FastLib, which has a work-around.  The bug
is filed in PivotalTracker as
https://www.pivotaltracker.com/story/show/38730815 and the pending tests
include the URL also in their tags.
2012-10-31 11:43:28 -05:00
James Lee 4073bec136 Add missing require 2012-10-30 13:38:51 -05:00
Luke Imhoff 6c11b870da Check for payload in :type instead of :modification_time
Just had a brain fart when converting the hash key names and translated
:mtype to :modification_time instead of the correct :type.  Correct key
names are in
Msf::ModuleManager::Cache#module_info_by_path_from_database!.
2012-10-30 12:10:31 -05:00
Luke Imhoff 5709ffc42b Use Msf::Config.install_root instead of Msf.root
Msf::Config.install_root already existed, but I didn't know about it
until egypt pointed it out, so remove the new Msf.root and use
Msf::Config.install_root in the specs instead.
2012-10-30 10:46:02 -05:00
Luke Imhoff 055f95898d Merge branch 'master' into bug/wrong-file_changed-argument
Conflicts:
	lib/msf/core/modules/loader/base.rb
2012-10-24 15:25:49 -05:00
Luke Imhoff 69a8739d52 Pass module_path instead of parent_path to file_changed?
[Fixes #37630057]

Modules were always being detected as having file changes because the
parent_path directory, instead of the actual module_path, was being
passed to module_manager.file_changed?, which caused the modification
times to not match.

To ensure this change fixes the ambiguous module warnings, a full spec
for Msf::Core::Modules::Loader::Base has been written.

spec/msf has moved to spec/lib/msf to match conventional spec layout and
allow for the spec/support directory to not be confused as a lib
subdirectory being tested.
2012-10-24 15:11:53 -05:00
sinn3r f3bf69a162 Todb says spaces 2012-10-18 13:42:19 -05:00
James Lee 37522a4bf0 Remove debugging output 2012-10-18 11:47:21 -05:00