From unknown Tue Aug 19 05:12:48 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#41606] [PATCH] tests: Allow passing on systems without support for swap devices. Resent-From: Simon South Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 29 May 2020 18:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41606 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41606@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159077670411542 (code B ref -1); Fri, 29 May 2020 18:26:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 May 2020 18:25:04 +0000 Received: from localhost ([127.0.0.1]:56207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jejgm-000306-9x for submit@debbugs.gnu.org; Fri, 29 May 2020 14:25:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:41158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jejgY-0002zS-DT for submit@debbugs.gnu.org; Fri, 29 May 2020 14:25:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jejgY-0002Jf-5t for guix-patches@gnu.org; Fri, 29 May 2020 14:24:50 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:36922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jejgX-0003Xq-66 for guix-patches@gnu.org; Fri, 29 May 2020 14:24:49 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id BF552A23C0 for ; Fri, 29 May 2020 18:24:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo05-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo05-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t0F-32cWEwaF for ; Fri, 29 May 2020 18:24:47 +0000 (UTC) Received: from mercury.simonsouth.net (unknown [108.162.141.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 76635A23BD for ; Fri, 29 May 2020 18:24:47 +0000 (UTC) From: Simon South Date: Fri, 29 May 2020 14:24:46 -0400 Message-ID: <87y2palhu9.fsf@mercury.simonsouth.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.68.200.34; envelope-from=simon@simonsouth.net; helo=mailout.easymail.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/29 14:24:47 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain The attached patch allows Guix's test suite to pass (and thus, the "guix" package to be built) on systems that lack support for swap devices; that is, systems that not only do not have a swap device enabled but do not have even support for memory paging built into the kernel (e.g. Linux built without CONFIG_SWAP). This might be the case for a small home server, for example, on which the workload is predictable but memory is otherwise at a premium. On these systems the "swapon" and "swapoff" syscalls return ENOSYS ("Function not implemented"). The patch modifies the relevant tests in tests/syscalls.scm to accept this as a valid return value. -- Simon South simon@simonsouth.net --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-tests-Allow-passing-on-systems-without-support-for-s.patch >From 39507094be62417f76ebd18a0724966ededc7166 Mon Sep 17 00:00:00 2001 From: Simon South Date: Fri, 29 May 2020 13:53:46 -0400 Subject: [PATCH] tests: Allow passing on systems without support for swap devices. * tests/syscalls.scm ("swapon", "swapoff"): Accept ENOSYS as a valid result. --- tests/syscalls.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 3823de7c1e..2dc56b8af9 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -73,21 +73,21 @@ ;; Note: 'utimensat' does not change 'ctime'. (list (stat:mtime st) (stat:atime st))))) -(test-assert "swapon, ENOENT/EPERM" +(test-assert "swapon, ENOSYS/ENOENT/EPERM" (catch 'system-error (lambda () (swapon "/does-not-exist") #f) (lambda args - (memv (system-error-errno args) (list EPERM ENOENT))))) + (memv (system-error-errno args) (list EPERM ENOENT ENOSYS))))) -(test-assert "swapoff, ENOENT/EINVAL/EPERM" +(test-assert "swapoff, ENOSYS/ENOENT/EINVAL/EPERM" (catch 'system-error (lambda () (swapoff "/does-not-exist") #f) (lambda args - (memv (system-error-errno args) (list EPERM EINVAL ENOENT))))) + (memv (system-error-errno args) (list EPERM EINVAL ENOENT ENOSYS))))) (test-assert "mkdtemp!" (let* ((tmp (or (getenv "TMPDIR") "/tmp")) -- 2.26.2 --=-=-=-- From unknown Tue Aug 19 05:12:48 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Simon South Subject: bug#41606: closed (Re: [bug#41606] [PATCH] tests: Allow passing on systems without support for swap devices.) Message-ID: References: <878sh5yiqn.fsf@gnu.org> <87y2palhu9.fsf@mercury.simonsouth.net> X-Gnu-PR-Message: they-closed 41606 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 41606@debbugs.gnu.org Date: Tue, 02 Jun 2020 08:29:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1591086541-4895-1" This is a multi-part message in MIME format... ------------=_1591086541-4895-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #41606: [PATCH] tests: Allow passing on systems without support for swap de= vices. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 41606@debbugs.gnu.org. --=20 41606: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D41606 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1591086541-4895-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 41606-done) by debbugs.gnu.org; 2 Jun 2020 08:28:26 +0000 Received: from localhost ([127.0.0.1]:37826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jg2Ha-0001GB-HF for submit@debbugs.gnu.org; Tue, 02 Jun 2020 04:28:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jg2HY-0001Fz-ML for 41606-done@debbugs.gnu.org; Tue, 02 Jun 2020 04:28:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40532) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg2HT-0001IE-4t; Tue, 02 Jun 2020 04:28:19 -0400 Received: from [2a01:e0a:fa:a50:a896:aee9:1571:f8a1] (port=50950 helo=meru) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jg2HS-0007Sx-M7; Tue, 02 Jun 2020 04:28:18 -0400 From: Mathieu Othacehe To: Simon South Subject: Re: [bug#41606] [PATCH] tests: Allow passing on systems without support for swap devices. References: <87y2palhu9.fsf@mercury.simonsouth.net> Date: Tue, 02 Jun 2020 10:28:16 +0200 In-Reply-To: <87y2palhu9.fsf@mercury.simonsouth.net> (Simon South's message of "Fri, 29 May 2020 14:24:46 -0400") Message-ID: <878sh5yiqn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41606-done Cc: 41606-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Simon, > On these systems the "swapon" and "swapoff" syscalls return ENOSYS > ("Function not implemented"). The patch modifies the relevant tests in > tests/syscalls.scm to accept this as a valid return value. This looks good to me. I added a copyright line for you and pushed. Thanks, Mathieu ------------=_1591086541-4895-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 29 May 2020 18:25:04 +0000 Received: from localhost ([127.0.0.1]:56207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jejgm-000306-9x for submit@debbugs.gnu.org; Fri, 29 May 2020 14:25:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:41158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jejgY-0002zS-DT for submit@debbugs.gnu.org; Fri, 29 May 2020 14:25:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jejgY-0002Jf-5t for guix-patches@gnu.org; Fri, 29 May 2020 14:24:50 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:36922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jejgX-0003Xq-66 for guix-patches@gnu.org; Fri, 29 May 2020 14:24:49 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id BF552A23C0 for ; Fri, 29 May 2020 18:24:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo05-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo05-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t0F-32cWEwaF for ; Fri, 29 May 2020 18:24:47 +0000 (UTC) Received: from mercury.simonsouth.net (unknown [108.162.141.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 76635A23BD for ; Fri, 29 May 2020 18:24:47 +0000 (UTC) From: Simon South To: guix-patches@gnu.org Subject: [PATCH] tests: Allow passing on systems without support for swap devices. Date: Fri, 29 May 2020 14:24:46 -0400 Message-ID: <87y2palhu9.fsf@mercury.simonsouth.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.68.200.34; envelope-from=simon@simonsouth.net; helo=mailout.easymail.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/29 14:24:47 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain The attached patch allows Guix's test suite to pass (and thus, the "guix" package to be built) on systems that lack support for swap devices; that is, systems that not only do not have a swap device enabled but do not have even support for memory paging built into the kernel (e.g. Linux built without CONFIG_SWAP). This might be the case for a small home server, for example, on which the workload is predictable but memory is otherwise at a premium. On these systems the "swapon" and "swapoff" syscalls return ENOSYS ("Function not implemented"). The patch modifies the relevant tests in tests/syscalls.scm to accept this as a valid return value. -- Simon South simon@simonsouth.net --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-tests-Allow-passing-on-systems-without-support-for-s.patch >From 39507094be62417f76ebd18a0724966ededc7166 Mon Sep 17 00:00:00 2001 From: Simon South Date: Fri, 29 May 2020 13:53:46 -0400 Subject: [PATCH] tests: Allow passing on systems without support for swap devices. * tests/syscalls.scm ("swapon", "swapoff"): Accept ENOSYS as a valid result. --- tests/syscalls.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 3823de7c1e..2dc56b8af9 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -73,21 +73,21 @@ ;; Note: 'utimensat' does not change 'ctime'. (list (stat:mtime st) (stat:atime st))))) -(test-assert "swapon, ENOENT/EPERM" +(test-assert "swapon, ENOSYS/ENOENT/EPERM" (catch 'system-error (lambda () (swapon "/does-not-exist") #f) (lambda args - (memv (system-error-errno args) (list EPERM ENOENT))))) + (memv (system-error-errno args) (list EPERM ENOENT ENOSYS))))) -(test-assert "swapoff, ENOENT/EINVAL/EPERM" +(test-assert "swapoff, ENOSYS/ENOENT/EINVAL/EPERM" (catch 'system-error (lambda () (swapoff "/does-not-exist") #f) (lambda args - (memv (system-error-errno args) (list EPERM EINVAL ENOENT))))) + (memv (system-error-errno args) (list EPERM EINVAL ENOENT ENOSYS))))) (test-assert "mkdtemp!" (let* ((tmp (or (getenv "TMPDIR") "/tmp")) -- 2.26.2 --=-=-=-- ------------=_1591086541-4895-1--