From a2b8e09fea044bccdbd471d9aab98ccc9f801ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sun, 18 Aug 2024 21:07:26 -0400 Subject: [PATCH] xdg-desktop-portal: disable bad test --- .../libraries/xdg-desktop-portal/default.nix | 3 +++ .../xdg-desktop-portal/trash-test.patch | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 pkgs/development/libraries/xdg-desktop-portal/trash-test.patch diff --git a/pkgs/development/libraries/xdg-desktop-portal/default.nix b/pkgs/development/libraries/xdg-desktop-portal/default.nix index a8477e370da0..b5c653d5eac7 100644 --- a/pkgs/development/libraries/xdg-desktop-portal/default.nix +++ b/pkgs/development/libraries/xdg-desktop-portal/default.nix @@ -60,6 +60,9 @@ stdenv.mkDerivation (finalAttrs: { # While upstream has `XDG_DESKTOP_PORTAL_DIR`, it is meant for tests and actually blocks # any configs from being loaded from anywhere else. ./nix-pkgdatadir-env.patch + + # test tries to read /proc/cmdline, which is not intended to be accessible in the sandbox + ./trash-test.patch ]; nativeBuildInputs = [ diff --git a/pkgs/development/libraries/xdg-desktop-portal/trash-test.patch b/pkgs/development/libraries/xdg-desktop-portal/trash-test.patch new file mode 100644 index 000000000000..3bfa88597281 --- /dev/null +++ b/pkgs/development/libraries/xdg-desktop-portal/trash-test.patch @@ -0,0 +1,18 @@ +diff --git a/tests/test_trash.py b/tests/test_trash.py +index d745cd2..173e3e5 100644 +--- a/tests/test_trash.py ++++ b/tests/test_trash.py +@@ -24,13 +24,6 @@ class TestTrash: + def test_version(self, portal_mock): + portal_mock.check_version(1) + +- def test_trash_file_fails(self, portal_mock): +- trash_intf = portal_mock.get_dbus_interface() +- with open("/proc/cmdline") as fd: +- result = trash_intf.TrashFile(fd.fileno()) +- +- assert result == 0 +- + def test_trash_file(self, portal_mock): + trash_intf = portal_mock.get_dbus_interface() +