Merge lp:~asac/ubuntu-test-cases/default-systemsettle-test into lp:ubuntu-test-cases

Proposed by Alexander Sack
Status: Superseded
Proposed branch: lp:~asac/ubuntu-test-cases/default-systemsettle-test
Merge into: lp:ubuntu-test-cases
Diff against target: 346 lines (+256/-0)
16 files modified
ifconfig/tc_control (+14/-0)
install/tc_control (+13/-0)
master.run (+5/-0)
netstat/tc_control (+13/-0)
ping/tc_control (+13/-0)
pwd/tc_control (+10/-0)
pwd/test.sh (+7/-0)
route/tc_control (+13/-0)
systemsettle/systemsettle.sh (+95/-0)
systemsettle/tc_control (+10/-0)
ts_control (+3/-0)
tslist.run (+11/-0)
uname/tc_control (+13/-0)
unity8/tc_control (+10/-0)
update/tc_control (+13/-0)
vmstat/tc_control (+13/-0)
To merge this branch: bzr merge lp:~asac/ubuntu-test-cases/default-systemsettle-test
Reviewer Review Type Date Requested Status
Ubuntu Test Case Developers Pending
Review via email: mp+179914@code.launchpad.net

This proposal has been superseded by a proposal from 2013-08-13.

Commit message

add systemsettle test to default smoke test suite; we wait until system has settled to 99.25% average idle before continuing further testing.

Description of the change

be aware that the tc_control part is untested, while the script is. should be easy to adjust so please do during merge/commit at best.

To post a comment you must log in.
14. By Alexander Sack

systemsettle: add run-forever option for utah timeout support and improve toplog formatting

15. By Alexander Sack

systemsettle: improve tc_control action and expected_results wording

16. By Alexander Sack

systemsettle: refactor pass/success exit code logic into trap handler

Unmerged revisions

16. By Alexander Sack

systemsettle: refactor pass/success exit code logic into trap handler

15. By Alexander Sack

systemsettle: improve tc_control action and expected_results wording

14. By Alexander Sack

systemsettle: add run-forever option for utah timeout support and improve toplog formatting

13. By Alexander Sack

rename quiesce_ variables to idle_avg_

12. By Alexander Sack

add systemsettle to earliest sensible position in tslist.run

11. By Alexander Sack

systemsettle: clean up temp files

10. By Alexander Sack

add systemsettle test that waits for idle avg >= 99.25%

9. By Paul Larson

Add a smoke test for detecting presence of the UI on ubuntu-touch

8. By Paul Larson

Fix bug #1192166 - pwd test fails on touch images

7. By Paul Larson

ping something on the local network instead of an external host

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'ifconfig'
2=== added file 'ifconfig/tc_control'
3--- ifconfig/tc_control 1970-01-01 00:00:00 +0000
4+++ ifconfig/tc_control 2013-08-13 12:26:05 +0000
5@@ -0,0 +1,14 @@
6+description: make sure wlan0 exists
7+dependencies: none
8+action: |
9+ 1. ifconfig
10+ 2. Make sure there is a wlan0
11+expected_results: |
12+ 1. there is a wlan0 on the system
13+type: userland
14+timeout: 60
15+command: ifconfig; ifconfig | grep wlan0
16+run_as: phablet
17+#build_cmd:
18+#tc_setup:
19+#tc_cleanup:
20
21=== added directory 'install'
22=== added file 'install/tc_control'
23--- install/tc_control 1970-01-01 00:00:00 +0000
24+++ install/tc_control 2013-08-13 12:26:05 +0000
25@@ -0,0 +1,13 @@
26+description: apt-get install works
27+dependencies: openssh-server
28+action: |
29+ 1. apt-get install -y curl
30+expected_results: |
31+ 1. apt-get install can install a package and ends with exit code 0
32+type: userland
33+timeout: 120
34+command: apt-get install -y curl
35+run_as: root
36+#build_cmd:
37+#tc_setup:
38+tc_cleanup: apt-get remove -y curl
39
40=== added file 'master.run'
41--- master.run 1970-01-01 00:00:00 +0000
42+++ master.run 2013-08-13 12:26:05 +0000
43@@ -0,0 +1,5 @@
44+---
45+testsuites:
46+ - name: smoke_touch
47+ fetch_method: bzr # one of 'bzr', 'bzr-export', 'dev', 'git'
48+ fetch_location: lp:ubuntu-test-cases/touch
49
50=== added directory 'netstat'
51=== added file 'netstat/tc_control'
52--- netstat/tc_control 1970-01-01 00:00:00 +0000
53+++ netstat/tc_control 2013-08-13 12:26:05 +0000
54@@ -0,0 +1,13 @@
55+description: netstat -l lists all the services
56+dependencies: none
57+action: |
58+ 1. netstat -l
59+expected_results: |
60+ 1. netstat shows output and exists cleanly
61+type: userland
62+timeout: 60
63+command: netstat -l
64+run_as: phablet
65+#build_cmd:
66+#tc_setup:
67+#tc_cleanup:
68
69=== added directory 'ping'
70=== added file 'ping/tc_control'
71--- ping/tc_control 1970-01-01 00:00:00 +0000
72+++ ping/tc_control 2013-08-13 12:26:05 +0000
73@@ -0,0 +1,13 @@
74+description: ping -c 5 10.97.0.1
75+dependencies: None
76+action: |
77+ 1. ping -c 5 10.97.0.1
78+expected_results: |
79+ 1. ping ends without an error
80+type: userland
81+timeout: 60
82+command: ping -c 5 10.97.0.1
83+run_as: phablet
84+#build_cmd:
85+#tc_setup:
86+#tc_cleanup:
87
88=== added directory 'pwd'
89=== added file 'pwd/tc_control'
90--- pwd/tc_control 1970-01-01 00:00:00 +0000
91+++ pwd/tc_control 2013-08-13 12:26:05 +0000
92@@ -0,0 +1,10 @@
93+description: pwd works
94+dependencies: none
95+action: |
96+ 1. cd to /tmp and verify which is the current directory
97+expected_results: |
98+ 1. Current directory is /tmp
99+type: userland
100+timeout: 60
101+command: ./test.sh
102+run_as: phablet
103
104=== added file 'pwd/test.sh'
105--- pwd/test.sh 1970-01-01 00:00:00 +0000
106+++ pwd/test.sh 2013-08-13 12:26:05 +0000
107@@ -0,0 +1,7 @@
108+#!/bin/bash
109+echo pwd is: $(pwd)
110+echo Changing to /tmp...
111+cd /tmp
112+echo Checking that cd worked...
113+echo directory is now $(pwd), should be /tmp
114+/usr/bin/test $(pwd) == '/tmp'
115
116=== added directory 'route'
117=== added file 'route/tc_control'
118--- route/tc_control 1970-01-01 00:00:00 +0000
119+++ route/tc_control 2013-08-13 12:26:05 +0000
120@@ -0,0 +1,13 @@
121+description: route shows wlan0 routes
122+dependencies: none
123+action: |
124+ 1. route | grep wlan0
125+expected_results: |
126+ 1. route shows wlan0 routes
127+type: userland
128+timeout: 60
129+command: route | grep wlan0
130+run_as: phablet
131+#build_cmd:
132+#tc_setup:
133+#tc_cleanup:
134
135=== added directory 'systemsettle'
136=== added file 'systemsettle/systemsettle.sh'
137--- systemsettle/systemsettle.sh 1970-01-01 00:00:00 +0000
138+++ systemsettle/systemsettle.sh 2013-08-13 12:26:05 +0000
139@@ -0,0 +1,95 @@
140+#!/bin/bash
141+
142+calc () { awk "BEGIN{ print $* }" ;}
143+
144+cleanup () { rm -f $top_log $vmstat_log $vmstat_log.reduced; }
145+
146+if test -z "$1"; then
147+ echo "ERROR: you need to provide the average idle value"
148+ echo "Usage: systemsettle.sh <avg-idle>"
149+ echo " - e.g. systemsettle.sh 99.25"
150+ exit 129
151+fi
152+
153+# minimum average idle level required to succeed
154+idle_avg_min=$1
155+
156+# how many total attempts to settle the system
157+settle_max=10
158+
159+# measurement details: vmstat $vmstat_wait $vmstat_repeat
160+vmstat_wait=6
161+vmstat_repeat=10
162+
163+# how many samples to ignore
164+vmstat_ignore=1
165+
166+# tweak cut field by arch
167+if uname -m | grep -q armv7; then
168+ idle_pos=16
169+elif uname -m | grep -q i.86; then
170+ idle_pos=15
171+else
172+ echo "machine \'`uname -m`\' not supported"
173+ exit 128
174+fi
175+
176+# set and calc more runtime values
177+vmstat_tail=`calc $vmstat_repeat - $vmstat_ignore`
178+settle_count=0
179+idle_avg=0
180+
181+echo "System Settle run - quiesce the system"
182+echo "--------------------------------------"
183+echo
184+echo " + cmd: \'vmstat $vmstat_wait $vmstat_repeat\' ignoring first $vmstat_ignore (tail: $vmstat_tail)"
185+echo
186+
187+trap cleanup EXIT INT QUIT ILL KILL SEGV TERM
188+vmstat_log=`mktemp -t`
189+top_log=`mktemp -t`
190+
191+while test `calc $idle_avg '<' $idle_avg_min` = 1 -a "$settle_count" -lt "$settle_max"; do
192+ echo Starting settle run $settle_count:
193+
194+ # get vmstat
195+ vmstat $vmstat_wait $vmstat_repeat | tee $vmstat_log
196+ cat $vmstat_log | tail -n $vmstat_tail > $vmstat_log.reduced
197+
198+ # log top output for potential debugging
199+ echo "TOP DUMP (after settle run: $settle_count)" >> $top_log
200+ echo "========================" >> $top_log
201+ top -n 1 -b >> $top_log
202+ echo >> $top_log
203+
204+ # calc average of idle field for this measurement
205+ sum=0
206+ count=0
207+ while read line; do
208+ idle=`echo $line | sed -e 's/\s\s*/ /g' | cut -d ' ' -f 15`
209+ sum=`calc $sum + $idle`
210+ count=`calc $count + 1`
211+ done < $vmstat_log.reduced
212+
213+ idle_avg=`calc $sum.0 / $count.0`
214+ settle_count=`calc $settle_count + 1`
215+
216+ echo
217+ echo "Measurement:"
218+ echo " + idle level: $idle_avg"
219+ echo " + idle sum: $sum / count: $count"
220+ echo
221+done
222+
223+if test `calc $idle_avg '<' $idle_avg_min` = 1; then
224+ echo "System failed to settle to target idle level ($idle_avg_min)"
225+ echo " + check out the following top log taken at each retry:"
226+ cat $top_log
227+ echo
228+ echo "system did not settle. FAILED."
229+ exit 1
230+else
231+ echo "system settled. SUCCESS"
232+ exit 0
233+fi
234+
235
236=== added file 'systemsettle/tc_control'
237--- systemsettle/tc_control 1970-01-01 00:00:00 +0000
238+++ systemsettle/tc_control 2013-08-13 12:26:05 +0000
239@@ -0,0 +1,10 @@
240+description: check if system settles to idle average > 99.25%
241+dependencies: none
242+action: |
243+ 1. run systemsettle.sh to wait for system to become idle
244+expected_results: |
245+ 1. run systemsettle.sh succeeds
246+type: userland
247+timeout: 720
248+command: ./systemsettle.sh 99.25
249+run_as: root
250
251=== added file 'ts_control'
252--- ts_control 1970-01-01 00:00:00 +0000
253+++ ts_control 2013-08-13 12:26:05 +0000
254@@ -0,0 +1,3 @@
255+#build_cmd: echo building
256+#ts_setup: echo setting up
257+#ts_cleanup: echo cleaning up
258
259=== added file 'tslist.run'
260--- tslist.run 1970-01-01 00:00:00 +0000
261+++ tslist.run 2013-08-13 12:26:05 +0000
262@@ -0,0 +1,11 @@
263+- test: pwd
264+- test: uname
265+- test: vmstat
266+- test: systemsettle
267+- test: netstat
268+- test: ifconfig
269+- test: route
270+- test: ping
271+- test: update
272+- test: install
273+- test: unity8
274
275=== added directory 'uname'
276=== added file 'uname/tc_control'
277--- uname/tc_control 1970-01-01 00:00:00 +0000
278+++ uname/tc_control 2013-08-13 12:26:05 +0000
279@@ -0,0 +1,13 @@
280+description: uname shows an ubuntu-phablet image installed
281+dependencies: CHANGE_ME
282+action: |
283+ 1. uname -a|grep ubuntu-phablet
284+expected_results: |
285+ 1. ubuntu-phablet is installed as expected
286+type: userland
287+timeout: 60
288+command: uname -a | grep ubuntu-phablet
289+run_as: phablet
290+#build_cmd:
291+#tc_setup:
292+#tc_cleanup:
293
294=== added directory 'unity8'
295=== added file 'unity8/tc_control'
296--- unity8/tc_control 1970-01-01 00:00:00 +0000
297+++ unity8/tc_control 2013-08-13 12:26:05 +0000
298@@ -0,0 +1,10 @@
299+description: check for unity8 process
300+dependencies: None
301+action: |
302+ 1. pgrep unity8
303+expected_results: |
304+ 1. pgrep exits with 0, indicating it found a matching process
305+type: userland
306+timeout: 60
307+command: /usr/bin/pgrep unity8
308+run_as: phablet
309
310=== added directory 'update'
311=== added file 'update/tc_control'
312--- update/tc_control 1970-01-01 00:00:00 +0000
313+++ update/tc_control 2013-08-13 12:26:05 +0000
314@@ -0,0 +1,13 @@
315+description: apt-get update works
316+dependencies: apt
317+action: |
318+ 1. apt-get update
319+expected_results: |
320+ 1. apt-get update works
321+type: userland
322+timeout: 120
323+command: apt-get update
324+run_as: root
325+#build_cmd:
326+#tc_setup:
327+#tc_cleanup:
328
329=== added directory 'vmstat'
330=== added file 'vmstat/tc_control'
331--- vmstat/tc_control 1970-01-01 00:00:00 +0000
332+++ vmstat/tc_control 2013-08-13 12:26:05 +0000
333@@ -0,0 +1,13 @@
334+description: Execute vmstat and capture output
335+dependencies: none
336+action: |
337+ 1. vmstat
338+expected_results: |
339+ 1. vmstat finishes without an error
340+type: userland
341+timeout: 60
342+command: vmstat
343+run_as: phablet
344+#build_cmd:
345+#tc_setup:
346+#tc_cleanup:

Subscribers

People subscribed via source and target branches