From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id B68298015C for ; Wed, 9 Sep 2026 21:37:06 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 689LZsZ8024073; Thu, 10 Sep 2026 00:35:55 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 689LZsZ8024073 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="C7jaFFPm" Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 689LZhNY024031 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 10 Sep 2026 00:35:43 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 689LZhNY024031 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-4855e47d062so4206168f8f.1 for ; Wed, 09 Sep 2026 14:35:43 -0700 (PDT) X-Gm-Message-State: AFuF++mQE1yaxaFmsbcGRqHb91WPNlTSX6LM2UehT24aujTysonMtcnO uVv7cADD9v1tPzgR+uuiRMGCvXIEvRwW4mC3IuG4hhXqC1l0+PQR35WxxFs8LQ4rfmFNS69rWVM 0Ih9WCv0HOFYkYth8bvnyuTktPJZbdX/2bCKnvOwGhFLq3Mep5f+oxw== X-Gm-Gg: AYBFou2ltLuD1qu99dQPuQHa8L7yrqGzCj9ZRDbOJ2GcdHDb4UFtuZ0VDR220/pFEwN FRIamlPxgBO1bNl+LhJpyYO9Ryj1GMPEWMdUM3eUGM/IqFIP5egHT6hxzpIvTXO2mpewrZco5Ke GTwjStUc69UAoxDlNXDxjjwgLCXmNMkNg4weLreSKTBalUIC4AZeT3KovcE/L/1KxxrP9QRPuE4 ovRm094bN9tw0Od2uI8KT+1HBhsb5mwy+VTLeiuQ+iYWl04zHqiA168U1Oy7B+oKRStrCFAcVKt ZS51OjBGF2Eu7lxlYJ7qIFNPGOmMAhZiyq0Umlin6XINpp64ZW+vtBj37UcrD6jrDYm0aUSwofn Pmidd6PxBSttegBZYsjXwwwa66ebQ X-Received: by 2002:a05:6000:993:b0:485:9099:e20e with SMTP id ffacd0b85a97d-4859099e3f4mr28396161f8f.16.1788989743148; Wed, 09 Sep 2026 14:35:43 -0700 (PDT) X-Received: by 2002:a05:6000:993:b0:485:9099:e20e with SMTP id ffacd0b85a97d-4859099e3f4mr28396137f8f.16.1788989742721; Wed, 09 Sep 2026 14:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1788989742; cv=none; d=google.com; s=arc-20260327; b=T2PwycagLjoX+rPY2Od0dacoR0kalovpxxroPHnDPpYdOzIAIhX0sqeCOtR1dWs1R4 FuI0AGdrSKG3AdNsGUQMtU/ONorwxa7tUyjeVmNOidzlcShFprW9W+Rec6t9VKcksN5q NqPvbWVX6wRGrKHhW741/7Rr9ULzeOqNkW6jez6+MAd2uQTTPDeV8cvC4426emGEGLca YpZpsWRcE9XG2bgxlCX1I20u8gXjzYuG7Z4qXBcGW/FQnldcL20Uv64cyX5sDQ16P+8T FZU0uJ4bInruhOfQqpOHCUgxYYgEFrQWKu++TCU3KQzKwKLuJfPUhFENdMKFyhaASxDS UknQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=T66QySwC5oSWm7TuNyqkC3qYytWnUQ7Gao9QnEqv6s8=; fh=QQvtjDaAlLft5IR2jnjma4lVp8TaaKU12WD0fWdFifQ=; b=VIVO6rhi6uvqPK3hlZ7nrzJut9WGZh4DIK6CJg/IVc2KMhFBb2OHN881BHJdJjb7d2 kbawyyfFsmk+c8D0s2jdrxHPJcNe3FCc8mNR7aEPshU3yo1P+ovp1KhmMNXD6hfkbOR7 ypZEjotBhLDdctMnUnz4QelfHcTEs/GDgDbPFwbpwx1J+bal92aikbAlMjG2IWDBy27P 2LHtDEGHYagQGvi1xBED16KQdmhJ33AQpLAxiVKUWPpUmX6t8vWfC04bRkEM3fH3c/Ln LuTFGiHDrT0PrkZQ/23BLkcEaNPEyJS6ngmxfbNTgE4lmtX6tVZ7dgk/BRd9wGcK2iJx vFKg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=C7jaFFPm; spf=pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vladimir.riabchun@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-485885db82asi36989996f8f.371.2026.09.09.14.35.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 14:35:42 -0700 (PDT) Received-SPF: pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=C7jaFFPm; spf=pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vladimir.riabchun@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=T66QySwC5oSWm7TuNyqkC3qYytWnUQ7Gao9QnEqv6s8=; b=C7jaFFPmMDz3 OOgxOaUhXgxw0R4H7VZ4rAsit1zbAEdaNJ41u6pCYgTn+8Oxyz59CMFHpSALrYGCtwtxUKWEJxwxL KN3r3LS686Jb9JYsjVLxmlrF/csBIrNA7cF0vLVnk1Z0X5XvuGsCwcy/4ZTwQ7JBg8phful15FyN6 i5lXZYCWYzqc5TG3E9cyr7N5t4h60msLNMIKKY9GkN+EQGpa0RgdOXGATiOT91bR/og1C1rE9FQn8 UAEhNmnYZYW8dSZY5PRbFYIB0AVrsKQHBAyK8RvrC4PLy4/tTc8QVsyeGEs59sLMONnyZ3lt2XKg+ r0QTbLIwhedsQnnWTf7HkQ==; Received: from [130.117.225.5] (helo=dev012.aci.vzint.dev) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4Pug-00DVmc-0a; Wed, 09 Sep 2026 23:35:41 +0200 From: Vladimir Riabchun To: devel@openvz.org Date: Wed, 9 Sep 2026 21:35:25 +0000 Message-ID: X-Mailer: git-send-email 2.47.1 In-Reply-To: References: MIME-Version: 1.0 X-OZ-Fwd: true Subject: [Devel] [PATCH VZ10 v8 3/7] selftests/ve: Update ve_ns_owner_test X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org Mount accounting interface has changed, now it shows the number of available mounts. https://virtuozzo.atlassian.net/browse/VSTOR-135520 Feature: per-ve failcounters Signed-off-by: Vladimir Riabchun --- tools/testing/selftests/ve/ve_ns_owner_test.c | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tools/testing/selftests/ve/ve_ns_owner_test.c b/tools/testing/selftests/ve/ve_ns_owner_test.c index 82c31dff4b1b..c3fa7d7b7f9c 100644 --- a/tools/testing/selftests/ve/ve_ns_owner_test.c +++ b/tools/testing/selftests/ve/ve_ns_owner_test.c @@ -18,7 +18,7 @@ * with a new netns and mntns, the parent reads the new ve's counters * via cgroupfs and asserts they reflect the just-created namespaces: * - ve.netns_avail_nr drops by exactly one (the new netns); - * - ve.mnt_nr is strictly greater than zero (mounts copied into the + * - ve.mnt_avail_nr drops by some value >= 1 (mounts copied into the * new mntns are accounted to the new ve). * * We never assert against the parent ve's counters: those are shared @@ -50,6 +50,7 @@ * any spurious accounting against the parent ve would overflow it. */ #define VE_NETNS_MAX 3 +#define VE_MOUNTS_MAX 4096 /* * Synchronisation across the clone() boundary: child does its setup, @@ -106,7 +107,7 @@ static int clone_child_func(void *arg) /* * Before fix: * - clone path: ve.netns_avail_nr stays at VE_NETNS_MAX and - * ve.mnt_nr stays at 0 because copy_net_ns()/copy_mnt_ns() + * ve.mnt_avail_nr stays at VE_MOUNTS_MAX because copy_net_ns()/copy_mnt_ns() * charged the parent ve via get_exec_env(). * - unshare path: the syscall itself returned -EINVAL, so this * check was unreachable. @@ -117,16 +118,16 @@ static int clone_child_func(void *arg) static void check_new_ve_owner(struct __test_metadata *_metadata, int cgv2_fd, int ctid) { - unsigned long long avail, mnt; - char path[PATH_MAX]; + unsigned long long avail_netns, avail_mnt; + char path[64]; snprintf(path, sizeof(path), "%d/ve.netns_avail_nr", ctid); - ASSERT_EQ(read_u64_at(cgv2_fd, path, &avail), 0); - EXPECT_EQ(avail, VE_NETNS_MAX - 1); + ASSERT_EQ(read_u64_at(cgv2_fd, path, &avail_netns), 0); + EXPECT_EQ(avail_netns, VE_NETNS_MAX - 1); - snprintf(path, sizeof(path), "%d/ve.mnt_nr", ctid); - ASSERT_EQ(read_u64_at(cgv2_fd, path, &mnt), 0); - EXPECT_GT(mnt, 0); + snprintf(path, sizeof(path), "%d/ve.mnt_avail_nr", ctid); + ASSERT_EQ(read_u64_at(cgv2_fd, path, &avail_mnt), 0); + EXPECT_LT(avail_mnt, VE_MOUNTS_MAX); } FIXTURE(ve_ns_owner) @@ -137,7 +138,7 @@ FIXTURE(ve_ns_owner) FIXTURE_SETUP(ve_ns_owner) { - unsigned long long initial_mnt_nr; + unsigned long long initial_mnt_avail_nr; char val[16]; char path[PATH_MAX]; @@ -174,13 +175,13 @@ FIXTURE_SETUP(ve_ns_owner) /* * The new ve cgroup has not been entered by anything yet, so its - * mnt_nr counter must start at 0. Each test below verifies that - * the clone/unshare populates the new mntns under this ve, i.e. - * mnt_nr rises strictly above zero. + * mnt_avail_nr counter should be VE_MOUNTS_MAX. Each test below + * verifies that the clone/unshare populates the new mntns + * under this ve, i.e. mnt_avail_nr strictly decreases. */ - snprintf(path, sizeof(path), "%d/ve.mnt_nr", self->ctid); - ASSERT_EQ(read_u64_at(self->cgv2_fd, path, &initial_mnt_nr), 0); - ASSERT_EQ(initial_mnt_nr, 0); + snprintf(path, sizeof(path), "%d/ve.mnt_avail_nr", self->ctid); + ASSERT_EQ(read_u64_at(self->cgv2_fd, path, &initial_mnt_avail_nr), 0); + ASSERT_EQ(initial_mnt_avail_nr, VE_MOUNTS_MAX); }; FIXTURE_TEARDOWN(ve_ns_owner) -- 2.47.1 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel