From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 4GqWDxRGfGebaQAAqHPOHw:P1 (envelope-from ) for ; Mon, 06 Jan 2025 21:07:32 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 4GqWDxRGfGebaQAAqHPOHw (envelope-from ) for ; Mon, 06 Jan 2025 22:07:32 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=ZlzutWay; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b=tzy5GXXo; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736197651; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=pYfku+eEOO9PGafJfDc32HFq0ch6tsW+NRAT0IU6zg0=; b=fnv8dpSjROWXNHVWCW7pRb5pmcfP1+NLThDW5K+CMWAcd8Dz+wVVny+ULukARnBRBHCfHb l10uvBFSXouQJY9IBFjY+XOxh0Gz4yqufxt1glafLJ8nj7iGGpuRB09k3KMJpOsWlkQVvM 3Edp8Ue/phI/Icy0TwWIriULR7QyvyxJe8BawvmAX08mpTFRzVtxdyhlZl0XDoEmSpdoJx k5R1WHsrueBm2R1E2KM3qvWPusrm6iAS1jSeC55NmE7H7bZt3g/LStzbtpavUiHel7AxT8 TfDl3Dcyz4YnjXQWIyKCJzlp2SR+JPsbyz/qidrUNtBUUn487pToPmxn7/ebAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=ZlzutWay; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b=tzy5GXXo; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736197651; a=rsa-sha256; cv=none; b=GbstYqklsheyd2K8eWNv1KQJpsAJ0zGnxy7TMibVQchgf03ZWRjoMSM/HfvK4lrhHsigds fp4/Ct47o+6M+S8guuRMYZIx4wt0IML3xAuh3eTBbiIWO3PGtJZS4GReJA78cdwxvFcAE0 7Wq8pIJP9NVHzhDbeiHOKHUoRhHRnmkbxhi6qQQ4xkj7OFgPaPHx78yGaqmzbUUjoILL1y dv8Pt7QOa/o+bxsny6QppXS+irwTNJcuAiqY1IUvWva2FSMP1ATtFCwUuCbwDL+m5H1n2F 5WCmFOt3sNwZ1LODqbJqx92hHwRupAJg1Znr/jgm/O2dHTCVY8nyiAMvASQ8aQ== 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 A675782EFD for ; Mon, 06 Jan 2025 22:07:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUuJV-0004ll-OF; Mon, 06 Jan 2025 16:07:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUuJT-0004l6-A4 for guix-patches@gnu.org; Mon, 06 Jan 2025 16:07:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tUuJT-0001hC-1u for guix-patches@gnu.org; Mon, 06 Jan 2025 16:07:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=pYfku+eEOO9PGafJfDc32HFq0ch6tsW+NRAT0IU6zg0=; b=ZlzutWayyYrCpPT4+m9rjiZbDLynse5QMeE+Qrla1wSeJlTd+7ElW/vxy4ZEnNDP2XJGUlczunaMABb+NtnAJEzK5L8LJv5M3yTohaEyKdi5OfgQ0QrmwVynOY+y6XHtuBYAlwTFgd3h8BoQxu8PKyhoEPUoTcmte3MuGYl+5PLyIaBupPAVUt0Zj2oOuPMmTrQ7bst+9LmJHUb3L6fiYCJVL/AyJz/xS3AT66nw5drPqJ1v0s2B/z9Qk2tp9s1BMzKdkyuTgRmdVqpd/V8ECMfArjQqyi+tjDKV1NymY2RmA24kEogeebdOYdKYyZp4XCV7GjZeASEiMXcKE3/1VQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUuJS-0003E0-Rz for guix-patches@gnu.org; Mon, 06 Jan 2025 16:07:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75203] [PATCH v2 1/2] services: tests: Add delay for rootless Podman system test. References: <1881b153-9191-4322-8c71-195b5eef5651@autistici.org> In-Reply-To: <1881b153-9191-4322-8c71-195b5eef5651@autistici.org> Resent-From: Giacomo Leidi Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Jan 2025 21:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75203 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 75203@debbugs.gnu.org Cc: Giacomo Leidi Received: via spool by 75203-submit@debbugs.gnu.org id=B75203.173619757312279 (code B ref 75203); Mon, 06 Jan 2025 21:07:02 +0000 Received: (at 75203) by debbugs.gnu.org; 6 Jan 2025 21:06:13 +0000 Received: from localhost ([127.0.0.1]:40655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUuIe-0003Bn-7p for submit@debbugs.gnu.org; Mon, 06 Jan 2025 16:06:12 -0500 Received: from confino.investici.org ([93.190.126.19]:44895) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUuIc-0003Be-Se for 75203@debbugs.gnu.org; Mon, 06 Jan 2025 16:06:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1736197569; bh=pYfku+eEOO9PGafJfDc32HFq0ch6tsW+NRAT0IU6zg0=; h=From:To:Cc:Subject:Date:From; b=tzy5GXXoUzAFjZH9TcYMS5Mdhmelgzh0guQHJq5YQUM7jnJevnRJUyT60q/S7P8ef gkWnxi5L4gEN5hqL6jtiGAdK4EFTkvoekzt9/EW3ja3XjC5n7aQU8C8l7P+xJC/fa6 AoyWT9eVRgflnaVx8LYCim6NXP6Jf6SI0PPn+2jQ= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4YRmtn3KpGz10wr; Mon, 6 Jan 2025 21:06:09 +0000 (UTC) Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4YRmtn2KtWz10x3; Mon, 6 Jan 2025 21:06:08 +0000 (UTC) Date: Mon, 6 Jan 2025 22:05:51 +0100 Message-ID: X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Giacomo Leidi X-ACL-Warn: , Giacomo Leidi via Guix-patches From: Giacomo Leidi via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -6.29 X-Spam-Score: -6.29 X-Migadu-Queue-Id: A675782EFD X-Migadu-Scanner: mx10.migadu.com X-TUID: MsuPARSU9lLI * gnu/tests/containers.scm (run-rootless-podman-test): Add 60 seconds long delay before tests are actually run. Change-Id: Ifcf70f7258f9e0886bf829884d7daedc9803352b --- gnu/tests/containers.scm | 113 +++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 53 deletions(-) diff --git a/gnu/tests/containers.scm b/gnu/tests/containers.scm index ba2fb22df6..69cd311c82 100644 --- a/gnu/tests/containers.scm +++ b/gnu/tests/containers.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2024 Giacomo Leidi +;;; Copyright © 2024, 2025 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -97,17 +97,65 @@ (define (run-rootless-podman-test oci-tarball) (test-runner-current (system-test-runner #$output)) (test-begin "rootless-podman") - - (test-assert "service started" - (marionette-eval - '(begin - (use-modules (gnu services herd)) - (match (start-service 'cgroups2-fs-owner) - (#f #f) - ;; herd returns (running #f), likely because of one shot, - ;; so consider any non-error a success. - (('service response-parts ...) #t))) - marionette)) + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (wait-for-service 'file-system-/sys/fs/cgroup)) + marionette) + + (test-assert "services started successfully and /sys/fs/cgroup has correct permissions" + (begin + (define (run-test) + (marionette-eval + `(begin + (use-modules (ice-9 popen) + (ice-9 match) + (ice-9 rdelim)) + + (define (read-lines file-or-port) + (define (loop-lines port) + (let loop ((lines '())) + (match (read-line port) + ((? eof-object?) + (reverse lines)) + (line + (loop (cons line lines)))))) + + (if (port? file-or-port) + (loop-lines file-or-port) + (call-with-input-file file-or-port + loop-lines))) + + (define slurp + (lambda args + (let* ((port (apply open-pipe* OPEN_READ args)) + (output (read-lines port)) + (status (close-pipe port))) + output))) + (let* ((bash + ,(string-append #$bash "/bin/bash")) + (response1 + (slurp bash "-c" + (string-append "ls -la /sys/fs/cgroup | " + "grep -E ' \\./?$' | awk '{ print $4 }'"))) + (response2 (slurp bash "-c" + (string-append "ls -l /sys/fs/cgroup/cgroup" + ".{procs,subtree_control,threads} | " + "awk '{ print $4 }' | sort -u")))) + (list (string-join response1 "\n") (string-join response2 "\n")))) + marionette)) + ;; Allow services to come up on slower machines + (let loop ((attempts 0)) + (if (= attempts 60) + (error "Services didn't come up after more than 60 seconds") + (if (equal? '("cgroup" "cgroup") + (run-test)) + #t + (begin + (sleep 1) + (format #t "Services didn't come up yet, retrying with attempt ~a~%" + (+ 1 attempts)) + (loop (+ 1 attempts)))))))) (test-equal "/sys/fs/cgroup/cgroup.subtree_control content is sound" (list "cpu" "cpuset" "memory" "pids") @@ -144,47 +192,6 @@ (define (run-rootless-podman-test oci-tarball) (sort-list (string-split (first response1) #\space) string