aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorPhilipp Stephani2021-05-07 18:36:57 +0200
committerPhilipp Stephani2021-05-07 18:36:57 +0200
commita2842a11728336fc8110eedb5176ecfbe71bbc79 (patch)
tree219365ced7e07236a0d81b0a06e9f1767f664a25 /test/src
parent9457d4f20f1f3da8450924cfe1f776fdd04261bb (diff)
downloademacs-a2842a11728336fc8110eedb5176ecfbe71bbc79.tar.gz
emacs-a2842a11728336fc8110eedb5176ecfbe71bbc79.zip
Don't use symbolic links in the test resource directory.
This doesn't work on Windows. Instead, use the EMACS_TEST_DIRECTORY environment variable to find the BPF files. * test/src/emacs-tests.el (emacs-tests--lib-src): New constant. (emacs-tests/seccomp/allows-stdout) (emacs-tests/seccomp/forbids-subprocess) (emacs-tests/bwrap/allows-stdout): Use it.
Diffstat (limited to 'test/src')
l---------test/src/emacs-resources/seccomp-filter-exec.bpf1
l---------test/src/emacs-resources/seccomp-filter.bpf1
-rw-r--r--test/src/emacs-tests.el14
3 files changed, 10 insertions, 6 deletions
diff --git a/test/src/emacs-resources/seccomp-filter-exec.bpf b/test/src/emacs-resources/seccomp-filter-exec.bpf
deleted file mode 120000
index 5b0e9978221..00000000000
--- a/test/src/emacs-resources/seccomp-filter-exec.bpf
+++ /dev/null
@@ -1 +0,0 @@
1../../../lib-src/seccomp-filter-exec.bpf \ No newline at end of file
diff --git a/test/src/emacs-resources/seccomp-filter.bpf b/test/src/emacs-resources/seccomp-filter.bpf
deleted file mode 120000
index b3d603d0aeb..00000000000
--- a/test/src/emacs-resources/seccomp-filter.bpf
+++ /dev/null
@@ -1 +0,0 @@
1../../../lib-src/seccomp-filter.bpf \ No newline at end of file
diff --git a/test/src/emacs-tests.el b/test/src/emacs-tests.el
index ee5586fbaf4..ac08e055b55 100644
--- a/test/src/emacs-tests.el
+++ b/test/src/emacs-tests.el
@@ -25,10 +25,13 @@
25 25
26(require 'cl-lib) 26(require 'cl-lib)
27(require 'ert) 27(require 'ert)
28(require 'ert-x)
29(require 'rx) 28(require 'rx)
30(require 'subr-x) 29(require 'subr-x)
31 30
31(defconst emacs-tests--lib-src
32 (substitute-in-file-name "$EMACS_TEST_DIRECTORY/../lib-src/")
33 "Location of the lib-src directory.")
34
32(ert-deftest emacs-tests/seccomp/absent-file () 35(ert-deftest emacs-tests/seccomp/absent-file ()
33 (skip-unless (string-match-p (rx bow "SECCOMP" eow) 36 (skip-unless (string-match-p (rx bow "SECCOMP" eow)
34 system-configuration-features)) 37 system-configuration-features))
@@ -135,7 +138,8 @@ to `make-temp-file', which see."
135 system-configuration-features)) 138 system-configuration-features))
136 (let ((emacs 139 (let ((emacs
137 (expand-file-name invocation-name invocation-directory)) 140 (expand-file-name invocation-name invocation-directory))
138 (filter (ert-resource-file "seccomp-filter.bpf")) 141 (filter (expand-file-name "seccomp-filter.bpf"
142 emacs-tests--lib-src))
139 (process-environment nil)) 143 (process-environment nil))
140 (skip-unless (file-executable-p emacs)) 144 (skip-unless (file-executable-p emacs))
141 (skip-unless (file-readable-p filter)) 145 (skip-unless (file-readable-p filter))
@@ -160,7 +164,8 @@ to `make-temp-file', which see."
160 system-configuration-features)) 164 system-configuration-features))
161 (let ((emacs 165 (let ((emacs
162 (expand-file-name invocation-name invocation-directory)) 166 (expand-file-name invocation-name invocation-directory))
163 (filter (ert-resource-file "seccomp-filter.bpf")) 167 (filter (expand-file-name "seccomp-filter.bpf"
168 emacs-tests--lib-src))
164 (process-environment nil)) 169 (process-environment nil))
165 (skip-unless (file-executable-p emacs)) 170 (skip-unless (file-executable-p emacs))
166 (skip-unless (file-readable-p filter)) 171 (skip-unless (file-readable-p filter))
@@ -186,7 +191,8 @@ to `make-temp-file', which see."
186 (bwrap (executable-find "bwrap")) 191 (bwrap (executable-find "bwrap"))
187 (emacs 192 (emacs
188 (expand-file-name invocation-name invocation-directory)) 193 (expand-file-name invocation-name invocation-directory))
189 (filter (ert-resource-file "seccomp-filter-exec.bpf")) 194 (filter (expand-file-name "seccomp-filter-exec.bpf"
195 emacs-tests--lib-src))
190 (process-environment nil)) 196 (process-environment nil))
191 (skip-unless bash) 197 (skip-unless bash)
192 (skip-unless bwrap) 198 (skip-unless bwrap)