Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

strace-DDD.test 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/sh -efu
  2. #
  3. # Check -DDD option.
  4. #
  5. # Copyright (c) 2019 Dmitry V. Levin <ldv@altlinux.org>
  6. # All rights reserved.
  7. #
  8. # SPDX-License-Identifier: GPL-2.0-or-later
  9. . "${srcdir=.}/init.sh"
  10. check_prog sed
  11. status_file=/proc/self/status
  12. [ -f "$status_file" ] ||
  13. framework_skip_ "$status_file is not available"
  14. stat_file=/proc/self/stat
  15. [ -f "$stat_file" ] ||
  16. framework_skip_ "$stat_file is not available"
  17. set -- -enone -esignal=none ../tracer_ppid_pgid_sid
  18. run_strace "$@" > "$OUT"
  19. read -r ppid pgid sid < "$OUT" &&
  20. [ "$ppid" -gt 1 ] &&
  21. [ "$pgid" -ge 0 ] &&
  22. [ "$sid" -ge 0 ] || {
  23. cat < "$OUT" > "$LOG"
  24. dump_log_and_fail_with "$STRACE $args: unexpected output"
  25. }
  26. match_diff
  27. pgid0="$pgid"
  28. sid0="$sid"
  29. run_strace -D "$@" > "$OUT"
  30. read -r ppid pgid sid < "$OUT" &&
  31. [ "$ppid" -eq 1 ] &&
  32. [ "$pgid" = "$pgid0" ] &&
  33. [ "$sid" = "$sid0" ] || {
  34. cat < "$OUT" > "$LOG"
  35. dump_log_and_fail_with "$STRACE $args: unexpected output"
  36. }
  37. match_diff
  38. run_strace -DD "$@" > "$OUT"
  39. read -r ppid pgid sid < "$OUT" &&
  40. [ "$ppid" -eq 1 ] &&
  41. [ "$pgid" -gt 1 ] &&
  42. [ "$pgid" != "$pgid0" ] &&
  43. [ "$pgid" != "$sid" ] &&
  44. [ "$sid" = "$sid0" ] || {
  45. cat < "$OUT" > "$LOG"
  46. dump_log_and_fail_with "$STRACE $args: unexpected output"
  47. }
  48. match_diff
  49. run_strace -DDD "$@" > "$OUT"
  50. read -r ppid pgid sid < "$OUT" &&
  51. [ "$ppid" -eq 1 ] &&
  52. [ "$pgid" -gt 1 ] &&
  53. [ "$pgid" != "$pgid0" ] &&
  54. [ "$sid" = "$pgid" ] &&
  55. [ "$sid" != "$sid0" ] || {
  56. cat < "$OUT" > "$LOG"
  57. dump_log_and_fail_with "$STRACE $args: unexpected output"
  58. }
  59. match_diff