rbtest.conf 1.3 KB

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