diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-04-20 02:25:04 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-04-20 02:25:04 -0700 |
commit | 47d5feb3175a8cd1dfb515c0f552eb50d2edad47 (patch) | |
tree | bc8b333fdb5fb31c9ba9ed606c20bb85f438e9ba /tests/018/chmod.tl | |
parent | e57078521f985202ba261acdff9a87044dd49572 (diff) | |
download | txr-47d5feb3175a8cd1dfb515c0f552eb50d2edad47.tar.gz txr-47d5feb3175a8cd1dfb515c0f552eb50d2edad47.tar.bz2 txr-47d5feb3175a8cd1dfb515c0f552eb50d2edad47.zip |
openbsd: fix tests.
* tests/014/socket-basic.tl (%iters%): Also reduce to 2000 on
OpenBSD, to avoid the default limit on UDP datagram size.
* tests/017/glob-carray.tl: Use the BSD-style struct glob-t
on OpenBSD also.
* tests/017/glob-zarray.tl: Likewise.
* tests/018/chmod.tl (os): New global variable.
(test-sticky): s-isvtx not allowed for non-root user on
OpenBSD, so we falsify this variable.
* tests/common.tl (os-symbol): Add OpenBSD case, producing
:openbsd keyword symbol.
(libc): Let's just use (dlopen nil) for any platform that isn't
Cygwin or Cygnal.
Diffstat (limited to 'tests/018/chmod.tl')
-rw-r--r-- | tests/018/chmod.tl | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/tests/018/chmod.tl b/tests/018/chmod.tl index 04b63fe7..cadfb077 100644 --- a/tests/018/chmod.tl +++ b/tests/018/chmod.tl @@ -7,7 +7,9 @@ (with-stream (s (open-file tgt "w"))) (umask #o022) -(defvarl test-sticky (progn +(defvarl os (os-symbol) + +(defvarl test-sticky (unless (eq os :openbsd) (chmod tgt s-isvtx) (let ((st (stat tgt))) (plusp (logand s-isvtx st.mode))))) @@ -33,29 +35,28 @@ (error "failed to set mode with ~s: expected ~s, actual ~s" mode expected (enc-perm m))))))) -(let ((os (os-symbol))) - (cht "------------" "a+strwx" "sgtrwxrwxrwx") - (cht "------------" "+strwx" "sgtrwxr-xr-x") - (cht "------------" "u+s" "s-----------") - (cht "------------" "g+s" "-g----------") - (cht "------------" "+t" "--t---------") - (cht "sgtrwxrwxrwx" "=" "------------") - ;; These tests don't work on Cygwin 3.1.7, Windows 10. - ;; They worked on Cygwin 2.5 on Windows 7. - (unless (eq os :cygwin) - (cht "sgtrwxrwxrwx" "u=" "-gt---rwxrwx") - (cht "sgtrwxrwxrwx" "g=" "s-trwx---rwx") - (cht "sgtrwxrwxrwx" "o=" "sg-rwxrwx---")) - (cht "------------" "u+s,g+s" "sg----------") - (cht "------------" "u+r,g+r,o+r,+t,+s" "sgtr--r--r--") - (cht "------------" "+rwx,g-r+w,o-r+w" "---rwx-wx-wx") - (cht "---------rwx" "u=rwsx" "s--rwx---rwx") - (unless (eq os :cygwin) - (cht "---------rwx" "u=rwsx,g=rwx,go-x" "s--rwxrw-rw-") - (cht "---------rwx" "g=o,g-w+s,u=g,o-x" "-g-r-xr-xrw-")) - (cht "---------rwx" "o=o" "---------rwx") - (cht "-----x------" "a+X" "-----x--x--x") - (cht "-----x------" "=,a+X" "------------") - (cht "-----x------" "a-x+X" "------------") - (cht "------------" "u+x-X" "------------") - (cht "------------" "o+x=o" "-----------x")) +(cht "------------" "a+strwx" "sgtrwxrwxrwx") +(cht "------------" "+strwx" "sgtrwxr-xr-x") +(cht "------------" "u+s" "s-----------") +(cht "------------" "g+s" "-g----------") +(cht "------------" "+t" "--t---------") +(cht "sgtrwxrwxrwx" "=" "------------") +;; These tests don't work on Cygwin 3.1.7, Windows 10. +;; They worked on Cygwin 2.5 on Windows 7. +(unless (eq os :cygwin) + (cht "sgtrwxrwxrwx" "u=" "-gt---rwxrwx") + (cht "sgtrwxrwxrwx" "g=" "s-trwx---rwx") + (cht "sgtrwxrwxrwx" "o=" "sg-rwxrwx---")) +(cht "------------" "u+s,g+s" "sg----------") +(cht "------------" "u+r,g+r,o+r,+t,+s" "sgtr--r--r--") +(cht "------------" "+rwx,g-r+w,o-r+w" "---rwx-wx-wx") +(cht "---------rwx" "u=rwsx" "s--rwx---rwx") +(unless (eq os :cygwin) + (cht "---------rwx" "u=rwsx,g=rwx,go-x" "s--rwxrw-rw-") + (cht "---------rwx" "g=o,g-w+s,u=g,o-x" "-g-r-xr-xrw-")) +(cht "---------rwx" "o=o" "---------rwx") +(cht "-----x------" "a+X" "-----x--x--x") +(cht "-----x------" "=,a+X" "------------") +(cht "-----x------" "a-x+X" "------------") +(cht "------------" "u+x-X" "------------") +(cht "------------" "o+x=o" "-----------x")) |