Skip to content

Commit

Permalink
working on a first pass at cucumber for framework
Browse files Browse the repository at this point in the history
  • Loading branch information
darkbushido committed Aug 13, 2014
1 parent fc65a45 commit c82ba34
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ group :development, :test do
gem 'rspec', '>= 2.12', '< 3.0.0'
# Define `rake spec`. Must be in development AND test so that its available by default as a rake test when the
# environment is development
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'

gem 'cucumber'

gem 'aruba'

end

group :pcap do
Expand Down
16 changes: 16 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,31 @@ GEM
arel (3.0.3)
arel-helpers (2.0.1)
activerecord (>= 3.1.0, < 5)
aruba (0.6.0)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
bcrypt (3.1.7)
builder (3.0.4)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
cucumber (1.2.1)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.11.0)
json (>= 1.4.6)
diff-lcs (1.2.5)
erubis (2.7.0)
factory_girl (4.4.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.4.1)
factory_girl (~> 4.4.0)
railties (>= 3.0.0)
ffi (1.9.3)
fivemat (1.2.1)
gherkin (2.11.6)
json (>= 1.7.6)
hike (1.2.3)
i18n (0.6.11)
journey (1.0.4)
Expand Down Expand Up @@ -157,6 +171,8 @@ PLATFORMS

DEPENDENCIES
activerecord (>= 3.0.0, < 4.0.0)
aruba
cucumber
factory_girl (>= 4.1.0)
factory_girl_rails
fivemat (= 1.2.1)
Expand Down
12 changes: 12 additions & 0 deletions Rakefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ require 'metasploit/framework/require'
Metasploit::Framework::Require.optionally_active_record_railtie

Metasploit::Framework::Application.load_tasks


begin
require 'cucumber'
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = 'features --format pretty'
end
rescue LoadError
puts "cucumber not in bundle, so can't set up feature tasks. " \
"To run features ensure to install the development and test groups."
end
20 changes: 20 additions & 0 deletions features/msfconsole.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Feature: test msfconsole

Scenario: This works
When I run `msfconsole` interactively
And I type "help"
And I type "exit"
Then the output should contain:
"""
Commands
"""

Scenario: stuff
When I run `msfconsole` interactively
And I type "use exploit/windows/smb/ms08_067_netapi"
And I type "set RHOST w2k3sp2-x86-u.vuln.lax.rapid7.com"
And I type "set PAYLOAD windows/meterpreter/bind_tcp"
And I type "run"
And I type "exit"
And I type "exit"
Then the output should match /Meterpreter session \d+ opened/
11 changes: 11 additions & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'aruba/cucumber'
paths = [
File.expand_path(File.join(File.dirname(__FILE__))),
File.expand_path(File.join(File.dirname(__FILE__), %w(.. ..))),
ENV['PATH']
]
ENV['PATH'] = paths.join(File::PATH_SEPARATOR)
#"#{File.expand_path(File.join(File.dirname(__FILE__)))}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
Before do
@aruba_timeout_seconds = 60
end
2 changes: 2 additions & 0 deletions features/support/stty
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exit 0

0 comments on commit c82ba34

Please sign in to comment.