From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CA8F4921BA for ; Tue, 19 May 2026 11:03:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779188630; cv=none; b=tUhcaXtVlKP5c1bab9iy2Uk6wFwDsKQ9CAUTNfxmorDCgYcM2hS9aMEqKmDPY8PKQY0uwVhxwsJPajJBTb1WlPGssuRkKoxBP5r5CtsmMCREO9OaanfOzqAUKmftJxEipQ2hhx6hG4DfSfKFhO4a5aJHHRlR3cn8ez/dqRKUFyg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779188630; c=relaxed/simple; bh=FcSAjejPxHuoxCQ/CxflnTKhs9/av/kDsn4Gbquc6C0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pAiH0F79LsWwY48kY165KLx1eHU7kskUn+ShsbsyoxoU2jKVguHQDKoyXq3/LpSmjek1e+h0I8r1U1SuADSdPfbQ9cN2uYdq5nDryKXRg5pWnyEPLjgTTFZBHn8ZFu7+KqgGNzuYQNAUwhsUJF4uo/hWiLlv766ivnRIy6JkpE0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=CrotYkdF; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CrotYkdF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779188627; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=49QC6crLbZrOXu5S070F5olmXh1MP3UwKnlYmGn/HPU=; b=CrotYkdFaPKVRmV/xW73AIfqXFlEZ24ePWLNpZEuM51pumQwTfufRy4i/JsRKilbnXLvvd ZJcinmYmxZmrXqvMcErq7w1bZkm31f+2kvIss6bR+n/MIJwKZpbRswBcURYXWKEmcdtooc 48jAoDqm+koCiHnOOcyD6aWTHMPSbmE= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-DjnvCnx2OpWaRfMulCbizw-1; Tue, 19 May 2026 07:03:46 -0400 X-MC-Unique: DjnvCnx2OpWaRfMulCbizw-1 X-Mimecast-MFC-AGG-ID: DjnvCnx2OpWaRfMulCbizw_1779188624 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D306018002D6; Tue, 19 May 2026 11:03:44 +0000 (UTC) Received: from [192.168.1.153] (headnet01.pony-001.prod.iad2.dc.redhat.com [10.2.32.101]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A6F3230001A2; Tue, 19 May 2026 11:03:42 +0000 (UTC) From: Albert Esteve Date: Tue, 19 May 2026 13:03:14 +0200 Subject: [PATCH v4 4/4] selftests: cgroup: handle vmtest-dmem -b to test locally built kernel Precedence: bulk X-Mailing-List: cgroups@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260519-kunit_cgroups-v4-4-f6c2f498fae4@redhat.com> References: <20260519-kunit_cgroups-v4-0-f6c2f498fae4@redhat.com> In-Reply-To: <20260519-kunit_cgroups-v4-0-f6c2f498fae4@redhat.com> To: Tejun Heo , Johannes Weiner , =?utf-8?q?Michal_Koutn=C3=BD?= , Shuah Khan Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org, Albert Esteve , mripard@kernel.org, echanude@redhat.com X-Developer-Signature: v=1; a=ed25519-sha256; t=1779188611; l=3200; i=aesteve@redhat.com; s=20260303; h=from:subject:message-id; bh=FcSAjejPxHuoxCQ/CxflnTKhs9/av/kDsn4Gbquc6C0=; b=50t6wVduStcbC+TAc1utwkksKyYrx+uQSlpG/QlSC3nDTExbimzX/qEMTnTK39ruTZnmEK5KA 18ivyqewOFWCtlWJPWcd1PXiYRRwv/5f0010VV6I/CJYNWX9tQ8zyzZ X-Developer-Key: i=aesteve@redhat.com; a=ed25519; pk=YSFz6sOHd2L45+Fr8DIvHTi6lSIjhLZ5T+rkxspJt1s= X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Currently vmtest-dmem.sh relies on the host's running kernel or a pre-built one when booting the virtme-ng VM, with no option to configure and build a local kernel tree directly. This adds friction to the development cycle: the user must manually run vng --kconfig with the correct config fragment, build the kernel, and pass the result to the script. Add a -b flag that automates this workflow. When set, handle_build() configures the kernel using vng --kconfig with the selftest config fragment, builds it with make -j$(nproc), and run_vm() passes the local tree to vng --run so the VM boots the freshly built kernel. Signed-off-by: Eric Chanudet Signed-off-by: Albert Esteve --- tools/testing/selftests/cgroup/vmtest-dmem.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/vmtest-dmem.sh b/tools/testing/selftests/cgroup/vmtest-dmem.sh index b395b7153f635..415c1722b08e7 100755 --- a/tools/testing/selftests/cgroup/vmtest-dmem.sh +++ b/tools/testing/selftests/cgroup/vmtest-dmem.sh @@ -15,6 +15,7 @@ readonly KERNEL_CHECKOUT="$(realpath "${SCRIPT_DIR}"/../../../../)" source "${SCRIPT_DIR}"/../kselftest/ktap_helpers.sh +BUILD=0 QEMU="qemu-system-$(uname -m)" VERBOSE=0 SHELL_MODE=0 @@ -26,6 +27,7 @@ function usage() { cat </dev/null + vng --kconfig --config "${SCRIPT_DIR}"/config || \ + fail "failed to generate .config for kernel source tree (${KERNEL_CHECKOUT})" + make O= KBUILD_OUTPUT= -j"$(nproc)" || \ + fail "failed to build kernel from source tree (${KERNEL_CHECKOUT})" + popd &>/dev/null +} + # Run vng with common flags. Extra arguments are appended by the caller: # --exec