Changes: Fix performance tests

RevBy: Nimika Keshri
pull/1/head
Dmitry Rozenshtein 14 years ago
parent 58a52fafc8
commit ca93b45dfc

2
debian/changelog vendored

@ -1,6 +1,6 @@
applauncherd (2.0.1) unstable; urgency=low applauncherd (2.0.1) unstable; urgency=low
* * Changes: Fix performance tests
-- Olli Leppanen <olli.leppanen@nokia.com> Thu, 15 Sep 2011 16:05:02 +0300 -- Olli Leppanen <olli.leppanen@nokia.com> Thu, 15 Sep 2011 16:05:02 +0300

6
debian/control vendored

@ -138,7 +138,7 @@ Description: Tests related to bugs and new features for applauncherd
Package: applauncherd-libmeegotouch-perf-tests Package: applauncherd-libmeegotouch-perf-tests
Priority: extra Priority: extra
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, applauncherd-testapps, applauncherd-testscripts Depends: ${shlibs:Depends}, ${misc:Depends}, applauncherd-testapps, applauncherd-testscripts, sysstat
XB-Maemo-CI-Packages: applauncherd XB-Maemo-CI-Packages: applauncherd
XB-Maemo-CI-Stage: fast XB-Maemo-CI-Stage: fast
Description: applauncherd performance tests for libmeegotouch applications Description: applauncherd performance tests for libmeegotouch applications
@ -146,7 +146,7 @@ Description: applauncherd performance tests for libmeegotouch applications
Package: applauncherd-qml-perf-tests Package: applauncherd-qml-perf-tests
Priority: extra Priority: extra
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, applauncherd-testapps, applauncherd-testscripts Depends: ${shlibs:Depends}, ${misc:Depends}, applauncherd-testapps, applauncherd-testscripts, sysstat
XB-Maemo-CI-Packages: applauncherd XB-Maemo-CI-Packages: applauncherd
XB-Maemo-CI-Stage: fast XB-Maemo-CI-Stage: fast
Description: applauncherd performance tests for qml applications Description: applauncherd performance tests for qml applications
@ -154,7 +154,7 @@ Description: applauncherd performance tests for qml applications
Package: applauncherd-reference-perf-tests Package: applauncherd-reference-perf-tests
Priority: extra Priority: extra
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, applauncherd-testapps, applauncherd-testscripts Depends: ${shlibs:Depends}, ${misc:Depends}, applauncherd-testapps, applauncherd-testscripts, sysstat
XB-Maemo-CI-Packages: applauncherd XB-Maemo-CI-Packages: applauncherd
XB-Maemo-CI-Stage: fast XB-Maemo-CI-Stage: fast
Description: applauncherd performance tests for libmeegotouch applications without launcher Description: applauncherd performance tests for libmeegotouch applications without launcher

@ -256,7 +256,8 @@ int main(int argc, char **argv)
int repeat = 1; int repeat = 1;
while (repeat) { while (repeat) {
usleep(50000); //usleep(50000);
usleep(5000);
image = XGetImage(dpy, rootw, pixel_x, pixel_y, 1, 1, AllPlanes, ZPixmap); image = XGetImage(dpy, rootw, pixel_x, pixel_y, 1, 1, AllPlanes, ZPixmap);
pixel = XGetPixel(image, 0, 0); pixel = XGetPixel(image, 0, 0);

@ -50,6 +50,23 @@ class TC_PerformanceTests < Test::Unit::TestCase
puts message puts message
end end
def waitload(treshold)
pLoad = 100;
counter = 1;
print_debug("Wait system load < #{treshold}")
pLoad_part = []
#if system is loaded during long time then this loop iterates forever and the whole testcase will be stoped by testrunner on timeout
while (pLoad > treshold)
for i in 0..4
pLoad_part.push( (100 - %x[sar -u 1 1|grep Average:|awk '{print $8}'].to_f)/100 ) #since in per cent
end
pLoad = pLoad_part.max
print_debug("#{counter} Pload: #{pLoad}")
counter = counter + 1
pLoad_part.clear
end
end
def get_pid(app) def get_pid(app)
pid = `pgrep #{app}`.split(/\s/).collect { |x| x.strip() }.delete_if { |x| x.empty? } pid = `pgrep #{app}`.split(/\s/).collect { |x| x.strip() }.delete_if { |x| x.empty? }
print_debug("The Pid of #{app} is #{pid}") print_debug("The Pid of #{app} is #{pid}")
@ -263,23 +280,27 @@ class TC_PerformanceTests < Test::Unit::TestCase
if @options[:command] != nil if @options[:command] != nil
# Check that the average system load is under 0.3 # Check that the average system load is under 0.3
print_debug("Check the avarage system load is under 0.3") #print_debug("Check the avarage system load is under 0.3")
system "/usr/bin/waitloadavg.rb -l 0.3 -p 1.0 -t 100 -d" #system "/usr/bin/waitloadavg.rb -l 0.3 -p 1.0 -t 100"
start_command ="`#{PIXELCHANGED_BINARY} -t 101x4 -t 845x473 -q >> #{PIXELCHANGED_LOG} &`; #{FALA_GETTIME_BINARY} \"Started from command line\" >> #{PIXELCHANGED_LOG}; #{@options[:command]} &" start_command ="`#{PIXELCHANGED_BINARY} -t 101x4 -t 845x473 -q >> #{PIXELCHANGED_LOG} &`; #{FALA_GETTIME_BINARY} \"Started from command line\" >> #{PIXELCHANGED_LOG}; #{@options[:command]} &"
print_debug ("start command: #{start_command}") print_debug ("start command: #{start_command}")
#Check the system load is under 0.1
waitload(0.1)
system start_command system start_command
sleep (4) sleep (4)
else else
#Check the system load is under 0.1
waitload(0.1)
@pos = `#{GET_COORDINATES_SCRIPT} -a #{@options[:application]}` @pos = `#{GET_COORDINATES_SCRIPT} -a #{@options[:application]}`
@pos = @pos.split("\n")[-1] @pos = @pos.split("\n")[-1]
print_debug ("Co-ordinates: #{@pos}") print_debug ("Co-ordinates: #{@pos}")
x_val = Integer(@pos.split("x")[0]) x_val = Integer(@pos.split("x")[0])
y_val = Integer(@pos.split("x")[1]) y_val = Integer(@pos.split("x")[1])
print_debug("Check the avarage system load is under 0.3") #print_debug("Check the avarage system load is under 0.3")
system "/usr/bin/waitloadavg.rb -l 0.3 -p 1.0 -t 50 -d" #system "/usr/bin/waitloadavg.rb -l 0.3 -p 1.0 -t 100"
cmd = 0 cmd = 0
if (x_val >= 0 && x_val <= 420) if (x_val >= 0 && x_val <= 420)
if (y_val >= 240 && y_val <= 480) if (y_val >= 240 && y_val <= 480)
@ -296,6 +317,8 @@ class TC_PerformanceTests < Test::Unit::TestCase
end end
print_debug("pixel changed command is : #{cmd}") print_debug("pixel changed command is : #{cmd}")
#Check the system load is under 0.1
waitload(0.1)
system cmd system cmd
sleep (4) sleep (4)
# Raise meegotouchhome to the top. # Raise meegotouchhome to the top.

Loading…
Cancel
Save