Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit specifying a different To domain to the test target #40

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ gem 'classy_enum'

gem 'thin'

gem 'sippy_cup', '~> 0.6.0'
gem 'sippy_cup', '~> 0.7.2'
gem 'net-ssh'

gem 'rails_12factor'
Expand Down
9 changes: 6 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ GEM
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
sippy_cup (0.6.0)
activesupport (~> 3.0)
sippy_cup (0.7.2)
activesupport (>= 3.0)
nokogiri (~> 1.6.0)
packetfu
psych (~> 2.0.1)
Expand Down Expand Up @@ -355,7 +355,7 @@ DEPENDENCIES
sidekiq
simple_form
sinatra (>= 1.3.0)
sippy_cup (~> 0.6.0)
sippy_cup (~> 0.7.2)
slim (>= 1.1.0)
state_machine
test-unit
Expand All @@ -365,3 +365,6 @@ DEPENDENCIES
turbo-sprockets-rails3
uglifier (>= 1.0.3)
webmock

BUNDLED WITH
1.10.3
4 changes: 2 additions & 2 deletions app/models/test_run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class TestRun < ActiveRecord::Base
attr_accessible :target, :target_id
attr_accessible :receiver_scenario, :receiver_scenario_id
attr_accessible :registration_scenario, :registration_scenario_id
attr_accessible :to_user, :from_user, :advertise_address, :sipp_options
attr_accessible :to, :from_user, :advertise_address, :sipp_options
belongs_to :profile
belongs_to :scenario
belongs_to :receiver_scenario, class_name: "Scenario"
Expand Down Expand Up @@ -50,7 +50,7 @@ def duplicate
target_id: self.target.id,
description: self.description,
from_user: self.from_user,
to_user: self.to_user,
to: self.to,
advertise_address: self.advertise_address,
sipp_options: self.sipp_options,
)
Expand Down
2 changes: 1 addition & 1 deletion app/services/test_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def execute_runner
number_of_calls: @test_run.profile.max_calls,
calls_per_second: @test_run.profile.calls_per_second,
max_concurrent: @test_run.profile.max_concurrent,
to_user: @test_run.to_user,
to: @test_run.to,
transport_mode: @test_run.profile.transport_type.to_s,
vmstat_buffer: @vmstat_buffer,
advertise_address: @test_run.advertise_address,
Expand Down
2 changes: 1 addition & 1 deletion app/views/test_runs/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
%span#target_display.help-inline.instructions.ajax_display_data
.row-fluid
.span12
= f.input :to_user, label: 'SIP destination (user portion)'
= f.input :to, label: 'SIP destination (user portion or full address)'
= f.input :from_user, label: 'SIP source (user portion)'
= f.input :advertise_address, label: 'SIP advertise address'
= f.label :sipp_options, label: 'SIPp command line options in SippyCup (YAML) format'
Expand Down
4 changes: 2 additions & 2 deletions app/views/test_runs/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
%dt
Target:
= link_to @test_run.target_name, @test_run.target
%dd= "SIP user: #{@test_run.to_user}"
%dd= "Address: #{@test_run.target.address}"
%dd= "SIP user / address: #{@test_run.to}"
%dd= "Host: #{@test_run.target.address}"

%dt Logs:
%dd= link_to "Errors Report", @test_run.errors_report_file_url
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20150713191812_add_to_domain_to_test_runs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddToDomainToTestRuns < ActiveRecord::Migration
def change
rename_column :test_runs, :to_user, :to
end
end
2 changes: 1 addition & 1 deletion spec/factories/test_run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
scenario { FactoryGirl.build(:scenario) }
profile { FactoryGirl.build(:profile) }
target { FactoryGirl.build(:target) }
to_user '+14044754840'
to '+14044754840'
from_user 'sippppp'
advertise_address '10.5.5.1'
sipp_options 'p: "101"'
Expand Down
4 changes: 2 additions & 2 deletions spec/models/test_run_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@
it "should duplicate the test run" do
test_run = FactoryGirl.create :test_run, user: FactoryGirl.build(:user), scenario: FactoryGirl.build(:scenario),
profile: FactoryGirl.build(:profile), target: FactoryGirl.build(:target), name: "TestRun",
from_user: 'foobar', to_user: 'doodah', advertise_address: '127.0.0.1', sipp_options: 'p: "101"'
from_user: 'foobar', to: 'doodah', advertise_address: '127.0.0.1', sipp_options: 'p: "101"'
new_tr = test_run.duplicate
new_tr.user.should == test_run.user
new_tr.scenario.should == test_run.scenario
new_tr.profile.should == test_run.profile
new_tr.target.should == test_run.target
new_tr.name.should == "TestRun Retry 1"
new_tr.from_user.should == 'foobar'
new_tr.to_user.should == 'doodah'
new_tr.to.should == 'doodah'
new_tr.advertise_address.should == '127.0.0.1'
new_tr.sipp_options.should == 'p: "101"'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/services/test_runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
calls_per_second: test_run.profile.calls_per_second,
max_concurrent: test_run.profile.max_concurrent,
transport_mode: test_run.profile.transport_type.to_s,
to_user: '+14044754840',
to: '+14044754840',
from_user: 'sippppp',
advertise_address: '10.5.5.1',
options: {'p' => '101'},
Expand Down
Binary file removed vendor/cache/sippy_cup-0.6.0.gem
Binary file not shown.
Binary file added vendor/cache/sippy_cup-0.7.2.gem
Binary file not shown.