[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master a2842a1: Don't use symbolic links in the test resource directory.
From: |
Philipp Stephani |
Subject: |
master a2842a1: Don't use symbolic links in the test resource directory. |
Date: |
Fri, 7 May 2021 12:39:27 -0400 (EDT) |
branch: master
commit a2842a11728336fc8110eedb5176ecfbe71bbc79
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>
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.
---
test/src/emacs-resources/seccomp-filter-exec.bpf | 1 -
test/src/emacs-resources/seccomp-filter.bpf | 1 -
test/src/emacs-tests.el | 14 ++++++++++----
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 5b0e997..0000000
--- a/test/src/emacs-resources/seccomp-filter-exec.bpf
+++ /dev/null
@@ -1 +0,0 @@
-../../../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 b3d603d..0000000
--- a/test/src/emacs-resources/seccomp-filter.bpf
+++ /dev/null
@@ -1 +0,0 @@
-../../../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 ee5586f..ac08e05 100644
--- a/test/src/emacs-tests.el
+++ b/test/src/emacs-tests.el
@@ -25,10 +25,13 @@
(require 'cl-lib)
(require 'ert)
-(require 'ert-x)
(require 'rx)
(require 'subr-x)
+(defconst emacs-tests--lib-src
+ (substitute-in-file-name "$EMACS_TEST_DIRECTORY/../lib-src/")
+ "Location of the lib-src directory.")
+
(ert-deftest emacs-tests/seccomp/absent-file ()
(skip-unless (string-match-p (rx bow "SECCOMP" eow)
system-configuration-features))
@@ -135,7 +138,8 @@ to `make-temp-file', which see."
system-configuration-features))
(let ((emacs
(expand-file-name invocation-name invocation-directory))
- (filter (ert-resource-file "seccomp-filter.bpf"))
+ (filter (expand-file-name "seccomp-filter.bpf"
+ emacs-tests--lib-src))
(process-environment nil))
(skip-unless (file-executable-p emacs))
(skip-unless (file-readable-p filter))
@@ -160,7 +164,8 @@ to `make-temp-file', which see."
system-configuration-features))
(let ((emacs
(expand-file-name invocation-name invocation-directory))
- (filter (ert-resource-file "seccomp-filter.bpf"))
+ (filter (expand-file-name "seccomp-filter.bpf"
+ emacs-tests--lib-src))
(process-environment nil))
(skip-unless (file-executable-p emacs))
(skip-unless (file-readable-p filter))
@@ -186,7 +191,8 @@ to `make-temp-file', which see."
(bwrap (executable-find "bwrap"))
(emacs
(expand-file-name invocation-name invocation-directory))
- (filter (ert-resource-file "seccomp-filter-exec.bpf"))
+ (filter (expand-file-name "seccomp-filter-exec.bpf"
+ emacs-tests--lib-src))
(process-environment nil))
(skip-unless bash)
(skip-unless bwrap)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master a2842a1: Don't use symbolic links in the test resource directory.,
Philipp Stephani <=