01-known-values.sh 850 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. ### Constants
  3. # The scenario command requires a lot of memory, so valgrind is only enabled
  4. # if $USE_VALGRIND > 1.
  5. c_valgrind_min=2
  6. test_output="${s_basename}-stdout.txt"
  7. reference="${scriptdir}/verify-strings/test_scrypt.good"
  8. reference_small="${scriptdir}/verify-strings/test_scrypt_small.good"
  9. ### Actual command
  10. scenario_cmd() {
  11. # Run the binary which tests known input/output strings.
  12. setup_check "test_scrypt"
  13. (
  14. ${c_valgrind_cmd} "${bindir}/tests/verify-strings/test_scrypt" \
  15. "${SMALLMEM:-0}" 1> "${test_output}"
  16. echo $? > "${c_exitfile}"
  17. )
  18. # The generated values should match the known good values.
  19. setup_check "test_scrypt output against reference"
  20. if [ "${SMALLMEM:-0}" -gt "0" ]; then
  21. cmp -s "${test_output}" "${reference_small}"
  22. else
  23. cmp -s "${test_output}" "${reference}"
  24. fi
  25. echo $? > "${c_exitfile}"
  26. }