This patch allows us to skip tests that require PTRACE_ATTACH in situations where PTRACE_ATTACH is only allowed when CAP_SYS_PTRACE is held (i.e., for root, by default.) Reported at . --- elfutils-0.161/tests/run-deleted.sh 2015-04-11 16:38:33.028556235 +0200 +++ elfutils-0.161/tests/run-deleted.sh 2015-04-11 16:46:15.012442185 +0200 @@ -17,6 +17,15 @@ . $srcdir/backtrace-subr.sh +# Check whether the Yama policy allows us to use PTRACE_ATTACH. +if [ -f /proc/sys/kernel/yama/ptrace_scope ] +then + if [ `cat /proc/sys/kernel/yama/ptrace_scope` -ne 0 ] + then + exit 77 + fi +fi + tempfiles deleted deleted-lib.so cp -p ${abs_builddir}/deleted ${abs_builddir}/deleted-lib.so . --- elfutils-0.161/tests/vdsosyms.c 2015-04-11 16:40:20.633461110 +0200 +++ elfutils-0.161/tests/vdsosyms.c 2015-04-11 16:45:06.611866677 +0200 @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include ELFUTILS_HEADER(dwfl) @@ -68,6 +70,7 @@ module_callback (Dwfl_Module *mod, void int main (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused))) { + static const char ptrace_scope_file[] = "/proc/sys/kernel/yama/ptrace_scope"; static char *debuginfo_path; static const Dwfl_Callbacks proc_callbacks = { @@ -76,6 +79,20 @@ main (int argc __attribute__ ((unused)), .find_elf = dwfl_linux_proc_find_elf, }; + + /* Check whether the Yama policy allows us to use PTRACE_ATTACH. */ + int ptrace_scope = open (ptrace_scope_file, O_RDONLY); + if (ptrace_scope >= 0) + { + char buf[10]; + int count = read (ptrace_scope, buf, sizeof buf); + assert (count > 0); + if (buf[0] != '0') + /* We're not allowed, so skip this test. */ + return 77; + close (ptrace_scope); + } + Dwfl *dwfl = dwfl_begin (&proc_callbacks); if (dwfl == NULL) error (2, 0, "dwfl_begin: %s", dwfl_errmsg (-1)); '10' name='q' value=''/>
AgeCommit message (Collapse)Author
2020-11-06tests: docker-system: Increase VM memory.Ludovic Courtès
The test was failing with ENOSPC. * gnu/tests/docker.scm (run-docker-system-test)[vm]: Increase 'memory-size'. (%test-docker-system): Change 'locale-libcs' for the OS passed to 'system-docker-image'.
2020-07-17tests: docker-system: Use guile-3.0.Jakub Kądziołka
This helps find the (json) module in the virtual machine. * gnu/tests/docker.scm (build-tarball&run-docker-test, run-docker-system-test): Replace guile-2.2 with guile-3.0.
2020-03-09tests: docker-system: Increase memory requirement.Ludovic Courtès
The system image would no longer fit in memory, starting from commit 8c7eb58453870f380a077c7cfd8dafa97bb8e13f. * gnu/tests/docker.scm (run-docker-system-test): Set 'memory-size' to 3500.
2019-11-09tests: Update references to the now-deprecated 'guile-json' variable.Ludovic Courtès
* gnu/tests/docker.scm (build-tarball&run-docker-test): Refer to 'guile-json-3' instead of 'guile-json'. * gnu/tests/singularity.scm (build-tarball&run-singularity-test): Likewise.
2019-08-27pack: Create /tmp in Docker images.Ludovic Courtès
Fixes <https://bugs.gnu.org/37161>. * guix/scripts/pack.scm (docker-image)[build]: Add a 'directory' entry for "/tmp" to DIRECTIVES. * tests/pack.scm ("docker-image + localstatedir"): Test the presence of /tmp. * gnu/tests/docker.scm (run-docker-test)["Load docker image and run it"]: Test the presence and permission bits of "/tmp".
2019-07-04pack: 'docker' backend records the profile's search paths.Ludovic Courtès
* guix/docker.scm (config): Add #:environment parameter and honor it. (build-docker-image): Likewise, and pass it to 'config'. * guix/scripts/pack.scm (docker-image): Import (guix profiles) and (guix search-paths). Call 'profile-search-paths' and pass #:environment to 'build-docker-image'. * gnu/tests/docker.scm (run-docker-test)["Load docker image and run it"]: Add example that expects (json) to be available. * gnu/tests/docker.scm (build-tarball&run-docker-test): Replace %BOOTSTRAP-GUILE by GUILE-2.2 and GUILE-JSON in the environment.