readclock.sh 411 B

123456789101112131415161718192021
  1. # SPDX-License-Identifier: BSD-3-Clause
  2. source helpers.sh
  3. cleanup() {
  4. rm -f clock.yaml
  5. }
  6. trap cleanup EXIT
  7. start_up
  8. tpm2 readclock > clock.yaml
  9. # validate we can get each portion of the YAML file
  10. yaml_get_kv clock.yaml time
  11. yaml_get_kv clock.yaml clock_info clock
  12. yaml_get_kv clock.yaml clock_info reset_count
  13. yaml_get_kv clock.yaml clock_info restart_count
  14. yaml_get_kv clock.yaml clock_info safe
  15. exit 0