fapi-provision_ecc.sh 751 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. set -e
  2. source helpers.sh
  3. start_up
  4. CRYPTO_PROFILE="ECC"
  5. setup_fapi $CRYPTO_PROFILE
  6. function cleanup {
  7. # Since clean up should already been done during normal run of the test, a
  8. # failure is expected here. Therefore, we need to pass a successful
  9. # execution in any case
  10. tss2 delete --path=/ || true
  11. shut_down
  12. }
  13. trap cleanup EXIT
  14. tss2 provision
  15. PROFILE_NAME=$( tss2 list --searchPath=/ --pathList=- | cut -d "/" -f2 )
  16. tss2 delete --path=/
  17. expect <<EOF
  18. # Test if still objects in path
  19. spawn tss2 list --searchPath=/
  20. set ret [wait]
  21. if {[lindex \$ret 2] || [lindex \$ret 3] != 1} {
  22. send_user "Still objects in path\n"
  23. exit 1
  24. }
  25. EOF
  26. if [ -s $PROFILE_NAME ];then
  27. echo "Directory still existing"
  28. exit 99
  29. fi
  30. exit 0