trusted-keys.exp: fix error detection

The check_keyctl_result() procedure doesn't deal with all error cases
properly. For example the following error is not reported:

 # keyctl add trusted kmk "new 32" @u
 [    7.293607] trusted-key-tee optee-ta-f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c: key shm register failed
 add_key: Invalid argument
 #

To make things simpler, rely on the exit status of the commands sent to
the guest. The || shell construct is used to trigger the display of an
error message ("FAILED"). To avoid having the message in the command
themselves, which would make the parsing more complex, a shell function
is introduced ("fail"). Then all the check_keyctl_result() procedure
needs to do is wait for the next prompt ("# "), while dealing with
errors (the "FAILED" word appearing anywhere), key ID (parsing is
unchanged), and timeouts (which I have reduced to 5 seconds, more than
enough for any operation in this test suite).

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
1 file changed
tree: 5d0a47af60279da427f56825e0195677099cda5e
  1. .github/
  2. br-ext/
  3. fvp/
  4. imx/
  5. kconfigs/
  6. qemu_v8/
  7. rpi3/
  8. ti/
  9. versal/
  10. zynqmp/
  11. .gitignore
  12. am43xx.mk
  13. am57xx.mk
  14. common.mk
  15. dra7xx.mk
  16. fvp-psa-sp.mk
  17. fvp.mk
  18. get_clang.sh
  19. hikey.mk
  20. hikey960.mk
  21. imx.mk
  22. juno.mk
  23. poplar.mk
  24. qemu-check.exp
  25. qemu.mk
  26. qemu_v8.mk
  27. README.md
  28. rpi3.mk
  29. soc_term.py
  30. stm32mp1.mk
  31. synquacer.mk
  32. toolchain.mk
  33. trusted-keys.exp
  34. trusted-services.mk
  35. verdin.mk
  36. versal.mk
  37. zynqmp.mk
README.md

OP-TEE build.git

This git contains makefiles etc to be able to build a full OP-TEE developer setup for the OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io. The pages that used to be here in this git can be found under build and Device specific information at he new location for the OP-TEE documentation.

// OP-TEE core maintainers