1# Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5# Rollback code exhaustive test. 6# 7# INSTRUCTIONS. Put this file in /etc/init. Move /etc/init/tcsd.conf to 8# /etc/init/tcsd.confxxx to disable it. Then boot with the device connected by 9# wired ethernet. The test will start and reboot the host after every cycle. 10# Unplug the ethernet cable to stop testing. If left alone, the test will stop 11# at the first failure or when all the states have been tested. 12# 13# Reminder: rollback_index_test only works with TPM-agnostic firmware. 14 15# Connecting to tcsd requires that "localhost" be reachable, so we wait for 16# shill to start, but that's not enough, and in the while loop below we also 17# wait for pinging to localhost to succeed. 18 19start on started shill 20 21script 22 cable="" 23 while [ "$cable" != "yes" ]; do 24 cable=$(/usr/sbin/ethtool eth0 | grep Link | cut -f 3 -d ' ') 25 logger "rbtest: cable is $cable" 26 ping -c 1 localhost || cable="" 27 sleep 2 28 done 29 # ideally we would like to issue a "stop tcsd", but this doesn't work 30 # (upstart race?) so we must manually disable tcsd.conf 31 ### stop tcsd 32 logger "starting rbtest" 33 /usr/bin/rollback_index_test > /tmp/rbtest.out 2>&1 34end script 35