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
1=== modified file 'systemsettle/systemsettle-after/tc_control'
2--- systemsettle/systemsettle-after/tc_control 2013-08-23 16:39:08 +0000
3+++ systemsettle/systemsettle-after/tc_control 2013-08-23 16:39:08 +0000
4@@ -6,4 +6,4 @@
5 1. When doing nothing, system calms down to at least 99% idle level
6 type: userland
7 timeout: 120
8-command: ../systemsettle.sh -c5 -d2 -p 97.5
9+command: ../systemsettle.sh -c5 -d2 -p 97.5 -l _after
10
11=== modified file 'systemsettle/systemsettle-before/tc_control'
12--- systemsettle/systemsettle-before/tc_control 2013-08-23 16:39:08 +0000
13+++ systemsettle/systemsettle-before/tc_control 2013-08-23 16:39:08 +0000
14@@ -6,4 +6,4 @@
15 1. When doing nothing, system calms down to at least 99% idle level
16 type: userland
17 timeout: 120
18-command: ../systemsettle.sh -c5 -d2 -p 97.5
19+command: ../systemsettle.sh -c5 -d2 -p 97.5 -l _before
20
21=== modified file 'systemsettle/systemsettle.sh'
22--- systemsettle/systemsettle.sh 2013-08-23 16:39:08 +0000
23+++ systemsettle/systemsettle.sh 2013-08-23 16:39:08 +0000
24@@ -3,29 +3,17 @@
25 # Configuration variables:
26 # TARGET_PREFIX - Allows this to be run from the host, by providings something
27 # like TARGET_PREFIX="adb shell"
28+# UTAH_PROBE_DIR - optionally where to save log files so utah will grab them
29
30 set -e
31
32+[ -z $UTAH_PROBE_DIR ] && UTAH_PROBE_DIR="/tmp"
33+
34 # default exit code storage
35 dump_error=1
36
37 calc () { awk "BEGIN{ print $* }" ;}
38
39-cleanup () {
40- if ! test "$dump_error" = 0; then
41- echo "Check out the following top log taken at each retry:"
42-
43- echo
44- # dumb toplog indented
45- while read line; do
46- echo " $line"
47- done < $top_log
48- # dont rerun this logic in case we get multiple signals
49- dump_error=0
50- fi
51- rm -f $top_log $top_log.reduced
52-}
53-
54 function show_usage() {
55 echo "Usage:"
56 echo " $0 [options]"
57@@ -37,10 +25,11 @@
58 echo " -i top measurements to ignore from each loop (Default: 1)"
59 echo " -m maximum loops of top before giving up if minimum idle"
60 echo " percent is not reached (Default: 10)"
61+ echo " -l label to include for the top_log file"
62 exit 129
63 }
64
65-while getopts "h?rp:c:d:i:m:" opt; do
66+while getopts "h?rp:c:d:i:m:l:" opt; do
67 case "$opt" in
68 h|\?) show_usage
69 ;;
70@@ -56,6 +45,8 @@
71 ;;
72 m) settle_max=$OPTARG
73 ;;
74+ l) top_log_label=$OPTARG
75+ ;;
76 esac
77 done
78
79@@ -69,6 +60,8 @@
80 # how many total attempts to settle the system
81 settle_max=${settle_max:-10}
82
83+top_log="$UTAH_PROBE_DIR/top$top_log_label.log"
84+
85 # set and calc more runtime values
86 top_tail=`calc $top_repeat - $top_ignore`
87 settle_count=0
88@@ -83,11 +76,9 @@
89 echo " top_ignore = '$top_ignore'"
90 echo " settle_max = '$settle_max'"
91 echo " run_forever = '$settle_prefix' (- = yes)"
92+echo " log files = $top_log $top_log.reduced"
93 echo
94
95-trap cleanup EXIT INT QUIT ILL KILL SEGV TERM
96-top_log=`mktemp -t`
97-
98 while test `calc $idle_avg '<' $idle_avg_min` = 1 -a "$settle_prefix$settle_count" -lt "$settle_max"; do
99 echo -n "Starting system idle measurement (run: $settle_count) ... "
100

Subscribers

People subscribed via source and target branches