Commit Graph

84 Commits

Author SHA1 Message Date
Dean Welch 764a87fda8 nil check and fix mock 2024-01-30 17:51:40 +00:00
h00die ec8ee2814a fix spelling in spec folder 2024-01-07 13:42:50 -05:00
cgranleese-r7 dfe030cc99 Update payload size warnings to errors on CI 2023-08-04 13:56:31 +01:00
adfoster-r7 5b18475457 Extract rspec wait for expect helper 2023-06-14 19:10:05 +01:00
Dean Welch c143124344 Add feature to set the status of ticket/ccache via klist 2023-01-25 13:28:43 +00:00
dwelch-r7 a82c936613 Land #16373, Add initial ruby 3.1 support 2022-04-07 16:44:02 +01:00
adfoster-r7 76ede9ef8f Add ruby 3.1 support 2022-03-24 21:59:02 +00:00
Spencer McIntyre b41389c1dd Recalculate for tests 2022-03-21 17:44:10 -04:00
adfoster-r7 c0ba4bd619 Add kubernetes enum module 2021-10-21 11:01:25 +01:00
Alan Foster 112f43f798 Consolidate module argument parsing for ensuring consistency 2021-09-02 13:00:02 +01:00
Alan Foster e5241b412a Add tests for aux and exploit cmd_check and cmd_run 2021-07-08 17:32:52 +01:00
dwelch-r7 bad5ccbc49 Remove msf/base requires 2021-01-05 14:59:46 +00:00
Jeffrey Martin 66f04a95b7 better enforcement of binary mode on test fixtures 2020-10-01 14:29:10 -05:00
christopher lee 9c7db375bf Fix broken tests after latest merge with master 2018-04-26 16:39:56 -05:00
christopher lee e97693d056 Cleanup 2018-04-26 16:01:15 -05:00
christopher lee 3aed6d6666 Initial 2018-04-02 08:08:23 -05:00
christopher lee d5978803eb Fix all failing rspec for goliath 2018-01-19 15:16:19 -06:00
Tod Beardsley 1deacad2be Add a print_bad alias for print_error
Came up on Twitter, where Justin may have been trolling a little:

https://twitter.com/jstnkndy/status/798671298302017536

We have a `print_good` method, but not a `print_bad`, which seems a
little weird for Ruby -- opposite methods should be intuitive as Justin
is implying.

Anyway, I went with alias_method, thanks to the compelling argument at

https://github.com/bbatsov/ruby-style-guide#alias-method

...since Metasploit is all about the singleton, and didn't want to risk
some unexpected scoping thing.

Also dang, we define the `print_` methods like fifty billion times!
Really should fix that some day.
2016-11-15 19:20:42 -06:00
David Maloney c6656e4031 example_group and hook_scope conversions
not strictly required, these conversions keep us
up to date with latest rspec conventions and best practices
which will prevent use from having to convert them when they become
deprecated later
2015-12-31 16:56:13 -06:00
Greg Mikeska 2fc0c0b326 switch expect stubs
in ui_driver shared context to allows
2015-12-10 21:47:22 -06:00
jvazquez-r7 2beb42a734 Use msf_data attribute 2015-12-10 21:47:22 -06:00
jvazquez-r7 bc80bf7fdb use Msf::StringIO on client_spec 2015-12-10 21:47:22 -06:00
jvazquez-r7 3d0fcdf84d Add set_msf_data 2015-12-10 21:47:22 -06:00
jvazquez-r7 2041149d54 Use Msf::StringIO in connection_spec 2015-12-10 21:47:22 -06:00
jvazquez-r7 4872628ff5 Try to make it generic 2015-12-10 21:47:22 -06:00
jvazquez-r7 236c28b6fb Add shared context 2015-12-10 21:47:22 -06:00
Luke Imhoff 337be4355d Fix Msf::DBManager spec upgrade problems
MSP-13484
2015-12-10 21:47:22 -06:00
Luke Imhoff 2534b18f4c .stub -> expect().to receive
MSP-13484
2015-12-10 21:47:22 -06:00
Luke Imhoff fc9ca84da5 shared_context -> RSpec.shared_context
MSP-13484

shared_context must be qualified as global patching is disabled in
spec_helper.
2015-12-10 21:47:22 -06:00
Jon Hart 0f9032100d Stub print_status to allow testing of workspace...
and other things that may use print_status rather than print line
2015-08-28 11:10:35 -07:00
Tod Beardsley db474adc7b Remove the helper as well.
See #3807.

Again, happy to have working tests that actually test validity. But,
these ain't them.
2014-12-18 13:28:04 -06:00
Luke Imhoff 8925db2ec1 Remove thread cleaner from Msf::Simple::Framework shared context
MSP-11605

The `framework` from 'Msf::Simple::Framework' shared context is not
guaranteed to make threads with `framework.threads` anymore, so the
cleaner shouldn't allows be present in 'Msf::Simple::Framework'.
2014-11-14 09:14:13 -06:00
Luke Imhoff 69e726e2c9 Fail if 'Msf::Framework#threads cleaner' is unnecessary
MSP-11605

The 'Msf::Framework#threads cleaner' shared context fails with a
RuntimeError if `framework.threads?` is false, which would indicate that
cleaning is unnecessary.  This change stops 'Msf::Framework#threads
cleaner' from accessing `framework.threads`, which would create threads
only to immediately clean them up.
2014-11-13 14:22:40 -06:00
Luke Imhoff eede74be1e Extract 'Msf::Framework#threads cleaner'
MSP-11147

Extract from 'Msf::Simple::Framework' the `after(:each)` that kills and joins
threads from `framework.threads` into 'Msf::Framework#threads cleaner`.
2014-11-11 11:49:48 -06:00
Luke Imhoff b0f1b2a1f7 Merge branch 'master' into feature/MSP-11130/metasploit-framework-spec-constants
MSP-11130

Conflicts:
	Rakefile
2014-11-04 10:10:12 -06:00
Luke Imhoff ff0391cdc7 Fix derive_module_ancestor_names
MSP-11130

Wrap :reference_name in an Array since :ancestor_reference_names is
expected to be an Array.
2014-11-04 09:40:55 -06:00
Luke Imhoff 9ea1240cbb Default modules_path
MSP-11130

Default `:modules_path` to use the `#modules_path` left for
'Msf::Simple::Framework#modules#loading''s `#load_and_create_module`.
2014-11-03 11:06:49 -06:00
Luke Imhoff 0296d1784d Derive ancestor reference names from reference name
MSP-11130

For 'Msf::Simple::Framework#modules loading''s load_and_create_modules,
don't require `:ancestor_reference_names` when the `:module_type` is not
payload as the one ancestor reference name will be the same as
`:reference_name`.
2014-11-03 10:59:01 -06:00
Luke Imhoff d97bc52d8a Complete documentation for 'Msf::Simple::Framework::Modules loading'
MSP-11130
2014-11-03 09:47:29 -06:00
Luke Imhoff f0001eb9e6 Extract 'Msf::Simple::Framework#modules loading'
MSP-11130

'Msf::Simple::Framework#modules loading' defines
`#load_and_create_module`, which takes the :ancestor_reference_names,
:modules_path, :module_type, and :reference_name of the module whose
ancestors to load and the reference name to create. A default modules
path, the first 'modules' path for the Rails application is available in
in the `#modules_path` let.
2014-11-03 08:59:06 -06:00
Luke Imhoff 892aeaf727 Metasploit::Framework::Spec::Constants cleaner
MSP-11130

Shared context will calls `Metasploit::Framework::Spec::Constants.clean
after each example.
2014-10-29 11:31:17 -05:00
Joe Vennix c6bbc5bccf Merge branch 'landing-4055' into upstream-master 2014-10-28 11:18:20 -05:00
Joshua Smith 34f29f218c really resolve merge conflicts 2014-10-23 21:51:33 -05:00
Luke Imhoff 48d6880f1d Add docs for untested payload testing
MSP-11145

Add docs to rake task, shared examples, and share contexts for how to
use all 3 together.
2014-10-23 11:17:05 -05:00
Luke Imhoff a7317cb86c Extract 'untested payloads' shared context
MSP-11145

Detects if payloads are untested when using the 'payload can be
instantiated' shared examples.
2014-10-23 09:55:14 -05:00
Joshua Smith 1fa26e2afb cleans up a bunch of spec msftidy issues 2014-08-26 15:24:08 -05:00
Brandon Turner 91bb0b6e10 Merge tag '2014072301' into staging/electro-release
Conflicts:
	Gemfile.lock
	modules/post/windows/gather/credentials/gpp.rb

This removes the active flag in the gpp.rb module.  According to Lance,
the active flag is no longer used.
2014-08-06 15:58:12 -05:00
HD Moore 4ff211ec8d Fix the spec to allow for 1 or more spaces between 2014-06-30 13:18:43 -05:00
navs ccf967fdfe added support to msfpayload to use elf so payload target 2014-06-19 00:59:49 -05:00
Luke Imhoff 5ae5448005 Join killed threads to ensure cleanup
MSP-9653
2014-06-05 12:40:24 -05:00