Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1392812pxb; Thu, 28 Oct 2021 02:51:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxnPVp/0QIZ3gLK20fc5QwCmQV9YaqhQydXk8szt0vVXTn4T5z+84pm/uq9cASsS3uVlrk X-Received: by 2002:a17:906:c7c1:: with SMTP id dc1mr4188830ejb.6.1635414672330; Thu, 28 Oct 2021 02:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635414672; cv=none; d=google.com; s=arc-20160816; b=y3BZKXf8b7uDSlmMCupjTTTnzP9BGBhH8QKgQNVbz7TEtIZg8o+3sOMTulVdtsdAOc tiyf2b8QNUHk2aYvCbAc/K5cW3ZiSrK1+wmv1C0AZ6/nY5fDkJ4DaHJMpKrkyDUNBgOA WP2LJ2OVwQFaHVCUdqICPnq3tcH23creIg1E2VugpO59OAHqSpRjbhwBK3YdZc9SkQI/ mv3Sgdpt87q/a6/QuCl6ZOWiDrCDrxedlnWGWEI4GZce0Cwve+BS6ozgtPbXhI2wy3zx 9irMBT8OXcIeLy/X54SjwQuW0fWjJkoAy5wUkju1xZFtzKtq6IssE5jY9tLRokHJi2M7 +aCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r3QcDl+qrCs7DfRcj3nDkgEldBtCcz4guF3zRxr4yw0=; b=UKcjrS6u1ygaU+OJ1IeSjTjApEKScZ4KmQrIUNIFQawW1rPJzFMyq/a1ur+UPyjclT QBcux4rSzh498qzP5DC1aSYfwLDPn6yUopp+czITOHAHfMcASXk966Gmurb/jkIPqVG2 meucH9pjRzpKT7w06kqlE+tg4OSOINzjMP7wWU3pATWFESgph52eR2PZBjAunF8FDRgz ja11VfJ81Z+YhoZHsnIwc+Ugg2JKwc16faAiFUVFvq6tuhryGbGh7OJUSBc1IchF0sLG BF+pJLP719opJi4iN0iKY2wIv8RcRCYOqRVc1SNk6COeitWduFM+vTZcJUzGTRa32qeM ZxcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=V1tUt0C+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hc35si3892559ejc.537.2021.10.28.02.50.47; Thu, 28 Oct 2021 02:51:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=V1tUt0C+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230222AbhJ1Ju7 (ORCPT + 99 others); Thu, 28 Oct 2021 05:50:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbhJ1Juv (ORCPT ); Thu, 28 Oct 2021 05:50:51 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42709C061227 for ; Thu, 28 Oct 2021 02:48:24 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id m22so9174221wrb.0 for ; Thu, 28 Oct 2021 02:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r3QcDl+qrCs7DfRcj3nDkgEldBtCcz4guF3zRxr4yw0=; b=V1tUt0C+yOFlv1l6b4PrP7zPJM4iHTVUGYIiH5UnTUEaG0AniQhwCxz1BJDgWfiTOr UWi1hgVhvCQQv+5lrpnBpaoMDmriNh1Q342XoCjlM/oJg/9lolw1gbl7XDwAeJrHzO2K ujDlfcvNKS6rSwtYQGaw7+zuEOlPJGPxpyYPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r3QcDl+qrCs7DfRcj3nDkgEldBtCcz4guF3zRxr4yw0=; b=QSHIWiOaW4vb14IwWgoJ2WnKt4YF922IEcGER2dGa197nTiI13/u3ETMNrN/qrSChc 8rVXAG5G0NGwGSGFoTtDCNNQktKbDXZd4Flp5QHWRc8nKSaAgggLpI7e9qqSTLd31Kpb A9B/ARwES2dMwxoL/TGQrM9ZgVM6J5S1aVFIZzD7IHD++ZZBCYd0+Ywb9E+wj1lxZ+Qq 8wBUXHgXGLsAjs1aYUfDA31yA0s3z7v1oq20KIaUQP7R0S6/QrJntz2G2AiuiB5y+AWO X8GZaFAEw/E6rd6IYQkOhfNOWv1kQBeK3grusz/G4L08/JCbYOjpqscNC0wFZChz6pPe WepA== X-Gm-Message-State: AOAM531T4ikpO8PmS+oqBUJLJwz8STXD3e1P5uaHDGn0vlSKsZ4ZBCtA D7ZfHqTjHKgTbH6RQBNZbRYfvA== X-Received: by 2002:adf:ee43:: with SMTP id w3mr4157256wro.198.1635414502859; Thu, 28 Oct 2021 02:48:22 -0700 (PDT) Received: from altair.lan (2.f.6.6.b.3.3.0.3.a.d.b.6.0.6.0.f.f.6.2.a.5.a.7.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:7a5a:26ff:606:bda3:33b:66f2]) by smtp.googlemail.com with ESMTPSA id i6sm3378029wry.71.2021.10.28.02.48.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 02:48:22 -0700 (PDT) From: Lorenz Bauer To: viro@zeniv.linux.org.uk, Shuah Khan , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: mszeredi@redhat.com, gregkh@linuxfoundation.org, Lorenz Bauer , linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next v3 3/4] selftests: bpf: convert test_bpffs to ASSERT macros Date: Thu, 28 Oct 2021 10:47:23 +0100 Message-Id: <20211028094724.59043-4-lmb@cloudflare.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211028094724.59043-1-lmb@cloudflare.com> References: <20211028094724.59043-1-lmb@cloudflare.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove usage of deprecated CHECK macros. Signed-off-by: Lorenz Bauer --- .../selftests/bpf/prog_tests/test_bpffs.c | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_bpffs.c b/tools/testing/selftests/bpf/prog_tests/test_bpffs.c index 172c999e523c..533e3f3a459a 100644 --- a/tools/testing/selftests/bpf/prog_tests/test_bpffs.c +++ b/tools/testing/selftests/bpf/prog_tests/test_bpffs.c @@ -29,43 +29,43 @@ static int read_iter(char *file) static int fn(void) { - int err, duration = 0; + int err; err = unshare(CLONE_NEWNS); - if (CHECK(err, "unshare", "failed: %d\n", errno)) + if (!ASSERT_OK(err, "unshare")) goto out; err = mount("", "/", "", MS_REC | MS_PRIVATE, NULL); - if (CHECK(err, "mount /", "failed: %d\n", errno)) + if (!ASSERT_OK(err, "mount /")) goto out; err = umount(TDIR); - if (CHECK(err, "umount " TDIR, "failed: %d\n", errno)) + if (!ASSERT_OK(err, "umount " TDIR)) goto out; err = mount("none", TDIR, "tmpfs", 0, NULL); - if (CHECK(err, "mount", "mount root failed: %d\n", errno)) + if (!ASSERT_OK(err, "mount tmpfs")) goto out; err = mkdir(TDIR "/fs1", 0777); - if (CHECK(err, "mkdir "TDIR"/fs1", "failed: %d\n", errno)) + if (!ASSERT_OK(err, "mkdir " TDIR "/fs1")) goto out; err = mkdir(TDIR "/fs2", 0777); - if (CHECK(err, "mkdir "TDIR"/fs2", "failed: %d\n", errno)) + if (!ASSERT_OK(err, "mkdir " TDIR "/fs2")) goto out; err = mount("bpf", TDIR "/fs1", "bpf", 0, NULL); - if (CHECK(err, "mount bpffs "TDIR"/fs1", "failed: %d\n", errno)) + if (!ASSERT_OK(err, "mount bpffs " TDIR "/fs1")) goto out; err = mount("bpf", TDIR "/fs2", "bpf", 0, NULL); - if (CHECK(err, "mount bpffs " TDIR "/fs2", "failed: %d\n", errno)) + if (!ASSERT_OK(err, "mount bpffs " TDIR "/fs2")) goto out; err = read_iter(TDIR "/fs1/maps.debug"); - if (CHECK(err, "reading " TDIR "/fs1/maps.debug", "failed\n")) + if (!ASSERT_OK(err, "reading " TDIR "/fs1/maps.debug")) goto out; err = read_iter(TDIR "/fs2/progs.debug"); - if (CHECK(err, "reading " TDIR "/fs2/progs.debug", "failed\n")) + if (!ASSERT_OK(err, "reading " TDIR "/fs2/progs.debug")) goto out; out: umount(TDIR "/fs1"); -- 2.32.0