summaryrefslogtreecommitdiff
path: root/test/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2021-09-26 10:32:15 +0200
committerMichael Albinus <michael.albinus@gmx.de>2021-09-26 10:32:15 +0200
commit27d8726ae29a1441dba776d7d3d0685ef85a3fdf (patch)
treec0e57d82fb57f115663c7c7c23c904888c1530b8 /test/lisp/net
parent50798267f262d50bbe6cf755d19c2f6e08299695 (diff)
downloademacs-27d8726ae29a1441dba776d7d3d0685ef85a3fdf.tar.gz
emacs-27d8726ae29a1441dba776d7d3d0685ef85a3fdf.tar.bz2
emacs-27d8726ae29a1441dba776d7d3d0685ef85a3fdf.zip
Adapt Tramp's make-process for macOS.
* 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.
Diffstat (limited to 'test/lisp/net')
-rw-r--r--test/lisp/net/tramp-tests.el22
1 files changed, 18 insertions, 4 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 358f87d84c9..26a3ac7e964 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -52,6 +52,7 @@
(require 'vc-git)
(require 'vc-hg)
+(declare-function tramp-check-remote-uname "tramp-sh")
(declare-function tramp-find-executable "tramp-sh")
(declare-function tramp-get-remote-chmod-h "tramp-sh")
(declare-function tramp-get-remote-gid "tramp-sh")
@@ -4585,6 +4586,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(while (< (- (point-max) (point-min))
(length "66\n6F\n6F\n0D\n0A\n"))
(while (accept-process-output proc 0 nil t))))
+ (if (tramp--test-macos-p)
+ (tramp--test-message
+ "process-connection-type %s\n%s"
+ process-connection-type (pp-to-string (buffer-string)))
(should
(string-match-p
(if (memq process-connection-type '(nil pipe))
@@ -4592,7 +4597,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
;; flag is FALSE. See telnet(1) man page.
"66\n6F\n6F\n0D\\(\n00\\)?\n0A\n"
"66\n6F\n6F\n0A\\(\n00\\)?\n0A\n")
- (buffer-string))))
+ (buffer-string)))))
;; Cleanup.
(ignore-errors (delete-process proc)))))
@@ -4850,6 +4855,10 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
(while (< (- (point-max) (point-min))
(length "66\n6F\n6F\n0D\n0A\n"))
(while (accept-process-output proc 0 nil t))))
+ (if (tramp--test-macos-p)
+ (tramp--test-message
+ "process-connection-type %s\n%s"
+ process-connection-type (pp-to-string (buffer-string)))
(should
(string-match-p
(if (memq (or connection-type process-connection-type)
@@ -4858,7 +4867,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
;; flag is FALSE. See telnet(1) man page.
"66\n6F\n6F\n0D\\(\n00\\)?\n0A\n"
"66\n6F\n6F\n0A\\(\n00\\)?\n0A\n")
- (buffer-string))))
+ (buffer-string)))))
;; Cleanup.
(ignore-errors (delete-process proc)))))))))
@@ -6099,8 +6108,7 @@ If optional METHOD is given, it is checked first."
Several special characters do not work properly there."
;; We must refill the cache. `file-truename' does it.
(file-truename tramp-test-temporary-file-directory)
- (string-match-p
- "^HP-UX" (tramp-get-connection-property tramp-test-vec "uname" "")))
+ (tramp-check-remote-uname tramp-test-vec "^HP-UX"))
(defun tramp--test-ksh-p ()
"Check, whether the remote shell is ksh.
@@ -6111,6 +6119,12 @@ a $'' syntax."
(string-match-p
"ksh$" (tramp-get-connection-property tramp-test-vec "remote-shell" "")))
+(defun tramp--test-macos-p ()
+ "Check, whether the remote host runs macOS."
+ ;; We must refill the cache. `file-truename' does it.
+ (file-truename tramp-test-temporary-file-directory)
+ (tramp-check-remote-uname tramp-test-vec "Darwin"))
+
(defun tramp--test-mock-p ()
"Check, whether the mock method is used.
This does not support external Emacs calls."