fapi-get-platform-certificates_ecc.sh 784 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. set -e
  2. source helpers.sh
  3. start_up
  4. CRYPTO_PROFILE="ECC"
  5. setup_fapi $CRYPTO_PROFILE
  6. PATH=${abs_builddir}/tools/fapi:$PATH
  7. function cleanup {
  8. tss2 delete --path=/
  9. shut_down
  10. }
  11. trap cleanup EXIT
  12. CERTIFICATES_OUTPUT_FILE=$TEMP_DIR/certificates_output.file
  13. tss2 provision
  14. expect <<EOF
  15. # Try with missing certificates
  16. spawn tss2 getplatformcertificates
  17. set ret [wait]
  18. if {[lindex \$ret 2] || [lindex \$ret 3] != 1} {
  19. Command has not failed as expected\n"
  20. exit 1
  21. }
  22. EOF
  23. expect <<EOF
  24. # Try normal command; should fail since no certificates present
  25. spawn tss2 getplatformcertificates --certificates=$CERTIFICATES_OUTPUT_FILE \
  26. --force
  27. set ret [wait]
  28. if {[lindex \$ret 2] || [lindex \$ret 3] != 1} {
  29. Command has not failed as expected\n"
  30. exit 1
  31. }
  32. EOF
  33. exit 0