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

Feature/add config test scale #28

Closed
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
18 changes: 16 additions & 2 deletions bin/dmtest
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,14 @@ class Dispatcher
end
end

def run(opts, args)
def setup_config(opts)
setup_profile(opts.fetch(:profile, nil))
setup_test_scale(opts.fetch(:test_scale, nil))
end

def run(opts, args)
setup_config(opts)

suite = select_tests(opts)
runner = Test::Unit::UI::ThinTestRunner.new(suite, log_dir, Test::Unit::UI::VERBOSE)
runner.start
Expand All @@ -326,7 +332,8 @@ class Dispatcher
end

def list(opts, args)
setup_profile(opts.fetch(:profile, nil))
setup_config(opts)

suite = select_tests(opts)
print_suite('', suite, opts.member?(:tags))
end
Expand Down Expand Up @@ -390,6 +397,12 @@ EOF
$profile = cfg.profiles[sym]
end

def setup_test_scale(sym = nil)
cfg = get_config
sym ||= cfg.default_test_scale
$test_scale = sym
end

def get_config
txt = File.read(config_file)
c = DMTest::Config.new do
Expand Down Expand Up @@ -521,6 +534,7 @@ EOF
# end
#
# default_profile :ssd
# default_test_scale :normal
EOF
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/dmtest/command_line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@
multivalue_switch :name, :filter, '-n', '--name'
multivalue_switch :testcase, :filter, '-t'
value_switch :profile, :symbol, '--profile'
value_switch :test_scale, :symbol, '--test-scale'
value_switch :suite, :string, '--suite'
value_switch :port, :int, '--port'

command :help do
end

command :run do
switches :name, :profile, :suite, :testcase
switches :name, :profile, :test_scale, :suite, :testcase
end

command :list do
Expand Down
6 changes: 6 additions & 0 deletions lib/dmtest/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Config

def initialize(&block)
@profiles = {}
@default_test_scale = :normal
self.instance_eval(&block) if block
end

Expand All @@ -43,5 +44,10 @@ def default_profile(sym = nil)
@default_profile = sym unless sym.nil?
@default_profile
end

def default_test_scale(sym = nil)
@default_test_scale = sym unless sym.nil?
@default_test_scale
end
end
end
17 changes: 10 additions & 7 deletions lib/dmtest/tests/writeboost/tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ module WriteboostTests

attr_accessor :stack_maker

DEBUGMODE = false
RUBY = 'ruby-2.1.1.tar.gz'
RUBY_LOCATION = "http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz"

def debug_scale?
$test_scale == :debug
end

def grab_ruby
unless File.exist?(RUBY)
STDERR.puts "grabbing ruby archive from web"
Expand Down Expand Up @@ -186,7 +189,7 @@ def run_dbench(s, option)
end
end

@param[0] = DEBUGMODE ? 1 : 300
@param[0] = debug_scale? ? 1 : 300

opts = {
:backing_sz => gig(2),
Expand All @@ -207,7 +210,7 @@ def run_dbench(s, option)
end

def test_do_stress
@param[0] = DEBUGMODE ? 1 : 60
@param[0] = debug_scale? ? 1 : 60

opts = {
:cache_sz => meg(128),
Expand All @@ -232,7 +235,7 @@ def test_do_stress
# This actually deteriorates direct reads from the backing device.
# This test is to see how Writeboost deteriorates the block reads compared to backing device only.
def test_fio_read_overhead
@param[0] = DEBUGMODE ? 1 : 128
@param[0] = debug_scale? ? 1 : 128

def run_fio(dev, iosize)
ProcessControl.run("fio --name=test --filename=#{dev.path} --rw=randread --ioengine=libaio --direct=1 --size=#{@param[0]}m --ba=#{iosize}k --bs=#{iosize}k --iodepth=32")
Expand Down Expand Up @@ -280,7 +283,7 @@ def test_git_extract_cache_quick
# - How the effect changes according to the nr_max_batched_migration tunable?
def test_writeback_sorting_effect

@param[0] = DEBUGMODE ? 1 : 128
@param[0] = debug_scale? ? 1 : 128

def run_wb(s, batch_size)
s.cleanup_cache
Expand Down Expand Up @@ -317,7 +320,7 @@ def run_wb(s, batch_size)

# 4KB randwrite performance
def test_fio_randwrite_perf
@param[0] = DEBUGMODE ? 1 : 500
@param[0] = debug_scale? ? 1 : 500
s = @stack_maker.new(@dm, @data_dev, @metadata_dev, :cache_sz => meg(@param[0] + 100))
s.activate_support_devs do
s.cleanup_cache
Expand All @@ -332,7 +335,7 @@ def test_fio_randwrite_perf
end
end
def test_fio_cache_seqwrite # Baseline
@param[0] = DEBUGMODE ? 1 : 500
@param[0] = debug_scale? ? 1 : 500
s = @stack_maker.new(@dm, @data_dev, @metadata_dev, :cache_sz => meg(@param[0] + 100))
s.activate_support_devs do
system "fio --name=test --filename=#{s.cache_dev.path} --rw=write --ioengine=libaio --direct=1 --size=#{@param[0]}m --bs=256k --iodepth=32"
Expand Down