File: rbtest.conf

package info (click to toggle)
vboot-utils 0~20121212-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 26,472 kB
  • ctags: 3,862
  • sloc: ansic: 28,549; sh: 5,113; cpp: 2,098; makefile: 664; python: 350
file content (34 lines) | stat: -rw-r--r-- 1,325 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Rollback code exhaustive test.
#
# INSTRUCTIONS.  Put this file in /etc/init.  Move /etc/init/tcsd.conf to
# /etc/init/tcsd.confxxx to disable it.  Then boot with the device connected by
# wired ethernet.  The test will start and reboot the host after every cycle.
# Unplug the ethernet cable to stop testing.  If left alone, the test will stop
# at the first failure or when all the states have been tested.
#
# Reminder: rollback_index_test only works with TPM-agnostic firmware.

# Connecting to tcsd requires that "localhost" be reachable, so we wait for
# shill to start, but that's not enough, and in the while loop below we also
# wait for pinging to localhost to succeed.

start on started shill

script
  cable=""
  while [ "$cable" != "yes" ]; do
    cable=$(/usr/sbin/ethtool eth0 | grep Link | cut -f 3 -d ' ')
    logger "rbtest: cable is $cable"
    ping -c 1 localhost || cable=""
    sleep 2
  done
  # ideally we would like to issue a "stop tcsd", but this doesn't work
  # (upstart race?) so we must manually disable tcsd.conf
  ### stop tcsd
  logger "starting rbtest"
  /usr/bin/rollback_index_test > /tmp/rbtest.out 2>&1
end script