From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sPzFLRpU0V7YbAAA0tVLHw (envelope-from ) for ; Fri, 29 May 2020 18:27:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UJidKRpU0V6oVAAA1q6Kng (envelope-from ) for ; Fri, 29 May 2020 18:27:38 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 57E5D9400AF for ; Fri, 29 May 2020 18:27:38 +0000 (UTC) Received: from localhost ([::1]:41854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jejjF-0003oi-9Y for larch@yhetil.org; Fri, 29 May 2020 14:27:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jejhj-0002hn-2U for guix-patches@gnu.org; Fri, 29 May 2020 14:26:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jejhi-0003x8-NV for guix-patches@gnu.org; Fri, 29 May 2020 14:26:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jejhi-00031T-JN for guix-patches@gnu.org; Fri, 29 May 2020 14:26:02 -0400 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 X-Spam-Score: -2.3 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: uo/FlGB8McFW --=-=-= 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 --=-=-=--