~pwlars/ubuntu-test-cases/auto-offline-devices

« back to all changes in this revision

Viewing changes to tests/suspend-blocker/suspend-blocker/suspend-blocker.sh

  • Committer: paul.larson at canonical
  • Date: 2014-04-08 19:25:57 UTC
  • mto: This revision was merged to the branch mainline in revision 218.
  • Revision ID: paul.larson@canonical.com-20140408192557-x2q33m64o3occr4b
Add suspend-blocker test

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
set -ex
 
3
 
 
4
cleanup() {
 
5
        #In case anything goes wrong, try to leave the device attached
 
6
        ncd_usb.py -u http://qa-relay-control -b 0 -r 0 on
 
7
}
 
8
 
 
9
trap cleanup TERM INT EXIT
 
10
 
 
11
${TARGET_PREFIX} rm -f /var/log/kern.log
 
12
${TARGET_PREFIX} restart rsyslog
 
13
${TARGET_PREFIX} sudo -iu phablet start susblock
 
14
 
 
15
#Turn off the USB port for this device
 
16
ncd_usb.py -u http://qa-relay-control -b 0 -r 0 off 
 
17
sleep 1800
 
18
#Turn on the USB port for this device
 
19
ncd_usb.py -u http://qa-relay-control -b 0 -r 0 on
 
20
${TARGET_PREFIX} sudo -iu phablet stop susblock
 
21
${TARGET_PREFIX} /tmp/suspend-blocker/suspend-blocker -rbH -o /tmp/results/kern.json /var/log/kern.log
 
22
${TARGET_PREFIX} cp /var/log/kern.log /tmp/results