Added start and stop beef tasks to the rake tests
This commit is contained in:
24
rakefile
24
rakefile
@@ -30,7 +30,9 @@ end
|
||||
|
||||
desc "Run integration unit tests"
|
||||
task :integration => ["install"] do
|
||||
Rake::Task['beef_start'].invoke
|
||||
sh "cd test/integration;ruby -W0 ts_integration.rb"
|
||||
Rake::Task['beef_stop'].invoke
|
||||
end
|
||||
|
||||
desc "Run integration unit tests"
|
||||
@@ -50,6 +52,28 @@ task :install do
|
||||
sh "bundle > /dev/null"
|
||||
end
|
||||
|
||||
################################
|
||||
# BeEF environment set up
|
||||
|
||||
@beef_process_id = nil;
|
||||
|
||||
task :beef_start => 'beef' do
|
||||
printf "Starting BeEF (wait 10 seconds)..."
|
||||
@beef_process_id = IO.popen("./beef -x 2> /dev/null", "w+")
|
||||
delays = [2, 2, 1, 1, 1, 0.5, 0.5 , 0.5, 0.3, 0.2, 0.1, 0.1, 0.1, 0.05, 0.05]
|
||||
delays.each do |i| # delay for 10 seconds
|
||||
printf '.'
|
||||
sleep (i) # increase the . display rate
|
||||
end
|
||||
puts '.'
|
||||
end
|
||||
|
||||
task :beef_stop do
|
||||
puts "\nShutting down BeEF...\n"
|
||||
puts @beef_process_id.pid
|
||||
Process.kill 'INT', -Process.getpgrp
|
||||
end
|
||||
|
||||
################################
|
||||
# MSF environment set up
|
||||
|
||||
|
||||
Reference in New Issue
Block a user