Merge lp:~doanac/ubuntu-test-cases/system-settle-verbosity into lp:ubuntu-test-cases/smoke-touch-apps

Proposed by Andy Doan
Status: Merged
Approved by: Max Brustkern
Approved revision: 94
Merged at revision: 83
Proposed branch: lp:~doanac/ubuntu-test-cases/system-settle-verbosity
Merge into: lp:ubuntu-test-cases/smoke-touch-apps
Prerequisite: lp:~doanac/ubuntu-test-cases/target-host-testing
Diff against target: 99 lines (+12/-21)
3 files modified
systemsettle/systemsettle-after/tc_control (+1/-1)
systemsettle/systemsettle-before/tc_control (+1/-1)
systemsettle/systemsettle.sh (+10/-19)
To merge this branch: bzr merge lp:~doanac/ubuntu-test-cases/system-settle-verbosity
Reviewer Review Type Date Requested Status
Max Brustkern (community) Approve
Review via email: mp+181868@code.launchpad.net

Description of the change

This reduces the verbosity of the system settle test while still retaining all the key information.

REQUIRES the merge and deployment of: https://code.launchpad.net/~doanac/utah/probes-from-host/+merge/181698

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

I find it odd that the labels include a prepended underscore rather than the log file assuming an underscore and putting the label after that, but that's not really worth changing. Seems reasonable to me.

Revision history for this message
Andy Doan (doanac) wrote :

On 08/23/2013 11:58 AM, Max Brustkern wrote:
> I find it odd that the labels include a prepended underscore rather than the log file assuming an underscore and putting the label after that, but that's not really worth changing. Seems reasonable to me.

I wasn't a huge fan of that. But by doing it this way, you could have a
plain "system-settle" test that didn't require a label at all

Revision history for this message
Max Brustkern (nuclearbob) wrote :

> On 08/23/2013 11:58 AM, Max Brustkern wrote:
> > I find it odd that the labels include a prepended underscore rather than the
> log file assuming an underscore and putting the label after that, but that's
> not really worth changing. Seems reasonable to me.
>
> I wasn't a huge fan of that. But by doing it this way, you could have a
> plain "system-settle" test that didn't require a label at all

That's a good point. Works for me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'systemsettle/systemsettle-after/tc_control'
--- systemsettle/systemsettle-after/tc_control 2013-08-23 16:39:08 +0000
+++ systemsettle/systemsettle-after/tc_control 2013-08-23 16:39:08 +0000
@@ -6,4 +6,4 @@
6 1. When doing nothing, system calms down to at least 99% idle level6 1. When doing nothing, system calms down to at least 99% idle level
7type: userland7type: userland
8timeout: 1208timeout: 120
9command: ../systemsettle.sh -c5 -d2 -p 97.59command: ../systemsettle.sh -c5 -d2 -p 97.5 -l _after
1010
=== modified file 'systemsettle/systemsettle-before/tc_control'
--- systemsettle/systemsettle-before/tc_control 2013-08-23 16:39:08 +0000
+++ systemsettle/systemsettle-before/tc_control 2013-08-23 16:39:08 +0000
@@ -6,4 +6,4 @@
6 1. When doing nothing, system calms down to at least 99% idle level6 1. When doing nothing, system calms down to at least 99% idle level
7type: userland7type: userland
8timeout: 1208timeout: 120
9command: ../systemsettle.sh -c5 -d2 -p 97.59command: ../systemsettle.sh -c5 -d2 -p 97.5 -l _before
1010
=== modified file 'systemsettle/systemsettle.sh'
--- systemsettle/systemsettle.sh 2013-08-23 16:39:08 +0000
+++ systemsettle/systemsettle.sh 2013-08-23 16:39:08 +0000
@@ -3,29 +3,17 @@
3# Configuration variables:3# Configuration variables:
4# TARGET_PREFIX - Allows this to be run from the host, by providings something4# TARGET_PREFIX - Allows this to be run from the host, by providings something
5# like TARGET_PREFIX="adb shell"5# like TARGET_PREFIX="adb shell"
6# UTAH_PROBE_DIR - optionally where to save log files so utah will grab them
67
7set -e8set -e
89
10[ -z $UTAH_PROBE_DIR ] && UTAH_PROBE_DIR="/tmp"
11
9# default exit code storage12# default exit code storage
10dump_error=113dump_error=1
1114
12calc () { awk "BEGIN{ print $* }" ;}15calc () { awk "BEGIN{ print $* }" ;}
1316
14cleanup () {
15 if ! test "$dump_error" = 0; then
16 echo "Check out the following top log taken at each retry:"
17
18 echo
19 # dumb toplog indented
20 while read line; do
21 echo " $line"
22 done < $top_log
23 # dont rerun this logic in case we get multiple signals
24 dump_error=0
25 fi
26 rm -f $top_log $top_log.reduced
27}
28
29function show_usage() {17function show_usage() {
30 echo "Usage:"18 echo "Usage:"
31 echo " $0 [options]"19 echo " $0 [options]"
@@ -37,10 +25,11 @@
37 echo " -i top measurements to ignore from each loop (Default: 1)"25 echo " -i top measurements to ignore from each loop (Default: 1)"
38 echo " -m maximum loops of top before giving up if minimum idle"26 echo " -m maximum loops of top before giving up if minimum idle"
39 echo " percent is not reached (Default: 10)"27 echo " percent is not reached (Default: 10)"
28 echo " -l label to include for the top_log file"
40 exit 12929 exit 129
41}30}
4231
43while getopts "h?rp:c:d:i:m:" opt; do32while getopts "h?rp:c:d:i:m:l:" opt; do
44 case "$opt" in33 case "$opt" in
45 h|\?) show_usage34 h|\?) show_usage
46 ;;35 ;;
@@ -56,6 +45,8 @@
56 ;;45 ;;
57 m) settle_max=$OPTARG46 m) settle_max=$OPTARG
58 ;;47 ;;
48 l) top_log_label=$OPTARG
49 ;;
59 esac50 esac
60done51done
6152
@@ -69,6 +60,8 @@
69# how many total attempts to settle the system60# how many total attempts to settle the system
70settle_max=${settle_max:-10}61settle_max=${settle_max:-10}
7162
63top_log="$UTAH_PROBE_DIR/top$top_log_label.log"
64
72# set and calc more runtime values65# set and calc more runtime values
73top_tail=`calc $top_repeat - $top_ignore`66top_tail=`calc $top_repeat - $top_ignore`
74settle_count=067settle_count=0
@@ -83,11 +76,9 @@
83echo " top_ignore = '$top_ignore'"76echo " top_ignore = '$top_ignore'"
84echo " settle_max = '$settle_max'"77echo " settle_max = '$settle_max'"
85echo " run_forever = '$settle_prefix' (- = yes)"78echo " run_forever = '$settle_prefix' (- = yes)"
79echo " log files = $top_log $top_log.reduced"
86echo80echo
8781
88trap cleanup EXIT INT QUIT ILL KILL SEGV TERM
89top_log=`mktemp -t`
90
91while test `calc $idle_avg '<' $idle_avg_min` = 1 -a "$settle_prefix$settle_count" -lt "$settle_max"; do82while test `calc $idle_avg '<' $idle_avg_min` = 1 -a "$settle_prefix$settle_count" -lt "$settle_max"; do
92 echo -n "Starting system idle measurement (run: $settle_count) ... "83 echo -n "Starting system idle measurement (run: $settle_count) ... "
9384

Subscribers

People subscribed via source and target branches