| 1 | #!/bin/sh |
| 2 | set -euC |
| 3 | |
| 4 | # check if this machine supports powertop |
| 5 | if ! powertop --csv --time=1 2>&1; then |
| 6 | echo "SKIP: machine does not support powertop" |
| 7 | exit 0 |
| 8 | fi |
| 9 | |
| 10 | OUT=`power-usage-report` |
| 11 | |
| 12 | check_log() { |
| 13 | if ! echo "$OUT" | grep -q "$1"; then |
| 14 | echo "$1 not found in log:" >&2 |
| 15 | echo "===================" >&2 |
| 16 | cat $LOG >&2 |
| 17 | echo "===================" >&2 |
| 18 | exit 1 |
| 19 | fi |
| 20 | } |
| 21 | |
| 22 | # this is just a simple smoketest, but guards against bugs like LP#1265142 |
| 23 | check_log "== Wakeups ==" |