06-progress-output.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/bin/sh
  2. ### Constants
  3. c_valgrind_min=1
  4. out_v="${s_basename}-v.stderr"
  5. out_pb="${s_basename}-pb.stderr"
  6. out_vpb_1k="${s_basename}-vpb-1k.stderr"
  7. out_vpb_20k="${s_basename}-vpb-20k.stderr"
  8. tmp="${s_basename}-tmp"
  9. scenario_cmd() {
  10. # Check tarsnap --dry-run -c -v
  11. setup_check "check -v"
  12. ${c_valgrind_cmd} ./tarsnap --no-default-config \
  13. --dry-run -c -C "${scriptdir}" \
  14. -v \
  15. shared_test_functions.sh \
  16. shared_valgrind_functions.sh \
  17. 2> "${out_v}"
  18. echo $? > "${c_exitfile}"
  19. # Check output of tarsnap --dry-run -c -v
  20. setup_check "check -v output"
  21. cmp "${out_v}" "${scriptdir}/06-progress-output-v.good"
  22. echo $? > "${c_exitfile}"
  23. # Check tarsnap --dry-run -c --progress-bytes 1k
  24. setup_check "check --progress-bytes 1k"
  25. ${c_valgrind_cmd} ./tarsnap --no-default-config \
  26. --dry-run -c -C "${scriptdir}" \
  27. --progress-bytes 1k \
  28. shared_test_functions.sh \
  29. shared_valgrind_functions.sh \
  30. 2> "${out_pb}"
  31. echo $? > "${c_exitfile}"
  32. # Trim bytes from ${out_pb}
  33. cut -f 1-3 -d " " "${out_pb}" > "${tmp}"
  34. mv "${tmp}" "${out_pb}"
  35. # Check output of tarsnap --dry-run -c --progress-bytes 1k
  36. setup_check "check --progress-bytes 1k output"
  37. cmp "${out_pb}" "${scriptdir}/06-progress-output-pb.good"
  38. echo $? > "${c_exitfile}"
  39. # Check tarsnap --dry-run -c -v --progress-bytes 1k
  40. setup_check "check -v --progress-bytes 1k"
  41. ${c_valgrind_cmd} ./tarsnap --no-default-config \
  42. --dry-run -c -C "${scriptdir}" \
  43. -v --progress-bytes 1k \
  44. shared_test_functions.sh \
  45. shared_valgrind_functions.sh \
  46. 2> "${out_vpb_1k}"
  47. echo $? > "${c_exitfile}"
  48. # Trim bytes from ${out_vpb_1k}
  49. cut -f 1-3 -d " " "${out_vpb_1k}" > "${tmp}"
  50. mv "${tmp}" "${out_vpb_1k}"
  51. # Check output of tarsnap --dry-run -c -v --progress-bytes 1k
  52. setup_check "check -v --progress-bytes 1k output"
  53. cmp "${out_vpb_1k}" "${scriptdir}/06-progress-output-vpb-1k.good"
  54. echo $? > "${c_exitfile}"
  55. # Check tarsnap --dry-run -c -v --progress-bytes 20k
  56. setup_check "check -v --progress-bytes 20k"
  57. ${c_valgrind_cmd} ./tarsnap --no-default-config \
  58. --dry-run -c -C "${scriptdir}" \
  59. -v --progress-bytes 20k \
  60. shared_test_functions.sh \
  61. shared_valgrind_functions.sh \
  62. 2> "${out_vpb_20k}"
  63. echo $? > "${c_exitfile}"
  64. # Trim bytes from ${out_vpb_20k}
  65. cut -f 1-3 -d " " "${out_vpb_20k}" > "${tmp}"
  66. mv "${tmp}" "${out_vpb_20k}"
  67. # Check output of tarsnap --dry-run -c -v --progress-bytes 20k
  68. setup_check "check -v --progress-bytes 20k output"
  69. cmp "${out_vpb_20k}" "${scriptdir}/06-progress-output-vpb-20k.good"
  70. echo $? > "${c_exitfile}"
  71. }