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 8F2808018A for ; Tue, 15 Sep 2026 17:24:39 +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 68FHNQ23006480; Tue, 15 Sep 2026 20:23:27 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68FHNQ23006480 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="gGMuY4tV" 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 68FHN4qZ006417 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 15 Sep 2026 20:23:04 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68FHN4qZ006417 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-48701401090so1538120f8f.3 for ; Tue, 15 Sep 2026 10:23:04 -0700 (PDT) X-Gm-Message-State: AFuF++n/Xyzap81yT0p2UOXkXOMDJA8Rig6dwsBQY8U1remYyVVCOYwd Hb9T8RevI7yYpul257F3jpn/MTrlwFF7GvgXTwzMOV8iGbCr5Xy1whseB/lgA7OFGV6M/BA0HRA yg42xksdW4h80sJZLBtUoTxuv5oGSp7Vpe6TpD4WXyQYCHcOq5oFH7A== X-Gm-Gg: AYBFou2tZJd9lx152IUm5EF7lIG7EHPTQAA4MvH2+WCX7XdvdB4nrZ98ucnvfHDN3Ay UeOHtO7SRm1c0xhTyxKSQnHn5Vm8eJ+vouxbOiVAcs5SewiFGNQAypvgu8SETK8StB4HznAIdBn RDsUaH+FnVMXgMxqTcGIUlTz8Uho6tOzt3QmYdu42ZrwA7TjObTgTE4j+0EjsqLOzIh4P5Ota+E qrTtfxr373Fwx5RyAsYAFjnJi4Q4gQeyRcBPOLb8t4u/AgcBmglsZPFuSXRs+1nBq7wD8PPxm1G 85Dsz5hFaDFS5izE54IrCFsvLeBgpDiDecSDd+IR3UoAQRUCXb0/koDh28PozmqSxfY9q/Av63+ xm7t2FzLrv/tk4jshJPzLJG/xqZRE/g== X-Received: by 2002:adf:e00a:0:20b0:487:381:efb0 with SMTP id ffacd0b85a97d-4870381f119mr14423986f8f.14.1789492984401; Tue, 15 Sep 2026 10:23:04 -0700 (PDT) X-Received: by 2002:adf:e00a:0:20b0:487:381:efb0 with SMTP id ffacd0b85a97d-4870381f119mr14423926f8f.14.1789492983895; Tue, 15 Sep 2026 10:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1789492983; cv=none; d=google.com; s=arc-20260327; b=b/rN/ZaBWZh3Y8kRQpiG28DvJSb0+ADKFkLX/5FDwiJf0fmsJh0VjpgBbwzANubOVN W1u61ED6cIeRYYtFqs92g1iWNKVrTVvzzEC7BcpOgLTDMj2m/JYy09GPRSvag0/3L1lk xkUYxJKZZNK46W0x2PVd0bNC34aUGSvkNFFFjjMMvW7fNdGles4K63wZ1vhjK3MuYJ9a sEJj2HR5GyOQKpC6lAvTz/CZWix+lMVIsBUR7CCj/NctjpMjlHgO7OEbfG51/tvAGt7+ wkz1l/e4ysl9+x2J69+vweB0tqFPaemQgg+55B/kw6SrCX9ABIP06ux9elygvH0ts/1u IRXg== 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=qPz5eJ+V9zOXe4OOJrR2BDz4U5ehw7Evulet1OEUN4JmmxCd+SBDghWpPMgA6TmtB+ PweLXbFsCC8zwxBbuJemhzx8QiXkI/nehugzV+coLTAJHj5QUF0MarazepNm2RZ5bhd1 lXBUJoI56hHFw3KLlJCssfVXtBc5rhgSKeQhTvs0KHAvbGYXjv7mEWpV0frhEae7EeyN MZLBxh7U0/mFm2bm5xRDuXewGoEjKXkdDpO3jkooZ9ew8+H3QXB0H0uRFeQ8KzXFOcJ5 XRBEgufphtr6L5vrqmvlAsbxb+pMMgJWjFP747gU1W7BW/XMEtcmB2I8WZaOvrUyk784 v7vg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=gGMuY4tV; 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-4870bf4378fsi378184f8f.203.2026.09.15.10.23.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 10:23:03 -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=gGMuY4tV; 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=gGMuY4tVZWzs d/IBqQODIdD10ugojl0PLaKPRACofHVLuVkP+7URfMsBuAkCsIT8+uq7p4WUtZTigkizJTupNQAlR iGfE7pvoh+IrGuEzFaK5QbuiDdGmHCJBNBjbcPivBfBoFpVfmsfILiDGViwSmHsqwOPnkfJ0CENjr F1Ht2w+Ve0Fs8TYtwvxgjXCieywQYmjFPmoEv1oLLrka1N9H/KaimV/FkYy0N1jyo3hL9jURCdChv 1sCffV9sAdeQCKPbQJF101RKNeDgdQjiXpzEZ5e+yMxiEPIWaYO7WOpOnMx+DI7EiBKJs0foRPwib k1c1E+85fOXGdylggYxM8A==; 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 1x6WpK-00GSrt-1Z; Tue, 15 Sep 2026 19:22:53 +0200 From: Vladimir Riabchun To: devel@openvz.org Date: Tue, 15 Sep 2026 17:22:31 +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 v9 3/8] 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