* lisp/net/tramp-sh.el (tramp-check-remote-uname): New defun.
(tramp-sh-handle-file-ownership-preserved-p)
(tramp-sh-handle-make-process, tramp-find-executable)
(tramp-find-shell, tramp-get-remote-stat): Use it. (Bug#50748)
* test/lisp/net/tramp-tests.el (tramp-check-remote-uname): Declare.
(tramp-test29-start-file-process, tramp-test30-make-process):
Instrument for macOS.
(tramp--test-hpux-p): Adapt function.
(tramp--test-macos-p): New defun.