Changes: Changed to use xkill isntead of pkill in perf tests

RevBy:Juha Lintula
pull/1/head
Olli Leppanen 15 years ago
parent 10c7b5cef5
commit 64a8aa8cb6

@ -70,10 +70,13 @@ appOnTop = sut.application()
system("initctl stop xsession/mprogressindicator")
while appOnTop.attribute('objectName') != 'meegotouchhome'
fullName = appOnTop.attribute('FullName')
# Killing the topmost application with xkill
system "DISPLAY=:0 xkill &"
sleep(0.5)
sut.tap_screen(50, 50)
# fullName = appOnTop.attribute('FullName')
# puts "Now killing #{fullName} from the top"
system "pkill #{fullName}"
# system "pkill #{fullName}"
appOnTop = sut.application()
end
@ -97,7 +100,7 @@ if @meegoHome.test_object_exists?("LauncherButton", :text => appName)
ypos = @meegoHome.LauncherButton(:name => "LauncherButton", :text => appName).attribute('y')
@pos = "#{xpos}x#{ypos}"
print @pos
puts @pos
exit 0
else
#icon does not

@ -53,6 +53,11 @@ class TC_PerformanceTests < Test::Unit::TestCase
options[:application] = app
end
options[:binary] = nil
opts.on( '-b', '--binary BINARY', 'Name of the application binary which is used when killing the application' ) do|binary|
options[:binary] = binary
end
options[:command] = nil
opts.on( '-c', '--command_line COMMAND', 'Start application from witc COMMAND from command line instead of grid.' ) do|command|
options[:command] = command
@ -63,6 +68,11 @@ class TC_PerformanceTests < Test::Unit::TestCase
options[:limit] = milliseconds.to_i
end
options[:pre_step] = nil
opts.on( '-p', '--pre_step PRE_STEP', 'Command to be executed everytime before starting the application' ) do|pre_step|
options[:pre_step] = pre_step
end
opts.on( '-h', '--help', 'Display this screen' ) do
puts opts
exit 0
@ -79,10 +89,20 @@ class TC_PerformanceTests < Test::Unit::TestCase
exit 1
end
if @options[:binary] == nil
puts "Binary of the application not defined!"
exit 1
end
if @options[:command] != nil
puts "#{@options[:command]}"
end
if @options[:pre_step] != nil
puts "#{@options[:pre_step]}"
end
if $path.include?("scratchbox")
puts "Inside SB, Do Nothing to unlock"
else
@ -113,6 +133,7 @@ class TC_PerformanceTests < Test::Unit::TestCase
end
def open_Apps(appName)
#Remove the Log file if it exists
if FileTest.exists?(PIXELCHANGED_LOG)
system "rm #{PIXELCHANGED_LOG}"
@ -122,6 +143,14 @@ class TC_PerformanceTests < Test::Unit::TestCase
if @options[:command] != nil
puts "#{GET_COORDINATES_SCRIPT} -g"
system "#{GET_COORDINATES_SCRIPT} -g"
sleep (1)
# execute the optional command if available
if @options[:pre_step] != nil
puts "pre_step: #{@options[:pre_step]}"
system "#{@options[:pre_step]}"
end
# Check the avarage system load is under 0.3
system "/usr/bin/waitloadavg.rb -l 0.3 -p 1.0 -t 120 -d"
@ -129,19 +158,30 @@ class TC_PerformanceTests < Test::Unit::TestCase
puts "start command: #{start_command}"
system "#{start_command}"
sleep (4)
puts "pkill \"#{@options[:command]}\""
system "pkill \"#{@options[:command]}\""
puts "pkill \"#{@options[:binary]}\""
system "pkill \"#{@options[:binary]}\""
else
@pos = `#{GET_COORDINATES_SCRIPT} -a #{@options[:application]}`
puts "original: #{@pos}"
@pos = @pos.split("\n")[-1]
puts "current: #{@pos}"
# execute the optional command if available
if @options[:pre_step] != nil
puts "pre_step: #{@options[:pre_step]}"
system "#{@options[:pre_step]}"
end
puts @pos
sleep (2)
system "/usr/bin/waitloadavg.rb -l 0.3 -p 1.0 -t 120 -d"
puts "#{PIXELCHANGED_BINARY} -c #{@pos} -f #{PIXELCHANGED_LOG} -q"
system "#{PIXELCHANGED_BINARY} -c #{@pos} -f #{PIXELCHANGED_LOG} -q"
sleep (4)
system "pkill #{appName}"
# Kill the application from the top
# system "#{GET_COORDINATES_SCRIPT} -g"
system "pkill #{@options[:binary]}"
end
end

@ -29,14 +29,16 @@
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
</pre_steps>
<case name="Perf-Test-Grid-launcher" type="Performance" description="Measure startup time of the application using launcher" timeout="360" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/test-perf.rb name test_performance -- -a fala_wl &gt; /tmp/perf_grid_with_launcher.txt</step>
<case name="Perf-Test-Grid-plain" type="Performance" description="Measure startup time of the application without launcher" timeout="360" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/test-perf.rb name test_performance -- -a fala_wol -b "fala_wol" &gt; /tmp/perf_grid_without_launcher.txt</step>
</case>
<case name="Perf-Test-Grid-plain" type="Performance" description="Measure startup time of the application without launcher" timeout="360" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/test-perf.rb name test_performance -- -a fala_wol &gt; /tmp/perf_grid_without_launcher.txt</step>
<case name="Perf-Test-Grid-launcher" type="Performance" description="Measure startup time of the application using launcher" timeout="360" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/test-perf.rb name test_performance -- -a fala_wl -b "fala_wl" &gt; /tmp/perf_grid_with_launcher.txt</step>
</case>
<environments>
<scratchbox>false</scratchbox>
<hardware>true</hardware>
@ -55,10 +57,10 @@
</pre_steps>
<case name="Perf-Test-Command-launcher" type="Performance" description="Measure startup time of the application using launcher" timeout="360" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/test-perf.rb name test_performance -- -c /usr/bin/fala_wl &gt; /tmp/perf_commandline_with_launcher.txt</step>
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/test-perf.rb name test_performance -- -c /usr/bin/fala_wl -b "fala_wl" &gt; /tmp/perf_commandline_with_launcher.txt</step>
</case>
<case name="Perf-Test-Command-plain" type="Performance" description="Measure startup time of the application using launcher" timeout="360" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/test-perf.rb name test_performance -- -c /usr/bin/fala_wol &gt; /tmp/perf_commandline_without_launcher.txt</step>
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/test-perf.rb name test_performance -- -c /usr/bin/fala_wol -b "fala_wol" &gt; /tmp/perf_commandline_without_launcher.txt</step>
</case>
<environments>
<scratchbox>false</scratchbox>

Loading…
Cancel
Save