From patchwork Wed Jul 6 03:40:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Schwartz X-Patchwork-Id: 12907276 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95EF4CCA473 for ; Wed, 6 Jul 2022 03:41:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229682AbiGFDlf (ORCPT ); Tue, 5 Jul 2022 23:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbiGFDld (ORCPT ); Tue, 5 Jul 2022 23:41:33 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 859FF1D0EF for ; Tue, 5 Jul 2022 20:41:32 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id u20so12922473iob.8 for ; Tue, 05 Jul 2022 20:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=PuqrKgkF0BrpsdGgHmBbhhU4JgPZ23Ju60Td0HEhJIQ=; b=qUnJKGO1YW97Vu0zoFVtPEfKdXG4i2afrTY2Zq+34+Mp68oZUxq8T3EU0J5fglGDxX WCm8mT/Os19mRHDLcPZyBMbD6EaVhPa4+oBF53tH5V7SsxjSz8Z+F3+U5ry4fVRZRNyt Y7hd/pg81tt5BQRJvxLbJhCV0vSNJ7frHdJcxpfH16VKWZnY9rR6nhK9WW5j15lEXdOj M8nqxK3BartLRunQJlWBqq3UC29RrfsZ5SI6cscCd00D2yTEHHzSkZo1zOWKlOWyhTDR r+bSzLUIUy6r6HKLbUczUor1COG771NqkUgOsLa+6NzCGcKj1ZgjEuIvBp/zS8oINo1D QFKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PuqrKgkF0BrpsdGgHmBbhhU4JgPZ23Ju60Td0HEhJIQ=; b=EfIgef5ZRvMAXF1mj/+7MXXv2oGi61dmOy1Z0jQ7nx6HTXD3Yksr+ooWnm+EirV6WJ 3Gz3kxP+kOo8PMqAOJx9ufNo9lYuSEJdaaAUryiFgL64xdZEoMI8MTU/gutginyosAZK 2P7mmDcpvolJ/fMsg0nNwlIdvZr/HuAgpZmi/+RSp42xzHhbCcO8gA12Wvqr96pb5wti I5/0NIjzAnmaTUrhClyZmDZTm+FU+bc45EgOCgJ9f90tMhv41Ra1xjXlaWNz7T1m/eWq dM/RXsBTq0r1vlH48gocR4d7QXISLP4Jnai10GKDX7+dztSca6c8qYRMunIQ5N3egHXn zarw== X-Gm-Message-State: AJIora+YN1gwjotj2ylWDILZm2thT2vKDaqnUdzkXdPMZIRAS4DbU/Vt o2w9N/z0SGYGhL/y3RJ5glrfHeGUqLAgVdys X-Google-Smtp-Source: AGRyM1tczPE4sGwzSudLMzD9sQNEe3Y+CLgNMMNKxSI6LfSVovHwRqTawUfZTiY9pLdlMHlHxY17LA== X-Received: by 2002:a05:6638:3a07:b0:33d:1340:8ac4 with SMTP id cn7-20020a0566383a0700b0033d13408ac4mr20350954jab.113.1657078891536; Tue, 05 Jul 2022 20:41:31 -0700 (PDT) Received: from didactylos.localdomain ([2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) by smtp.gmail.com with ESMTPSA id z6-20020a05660217c600b006692192baf7sm16427854iox.25.2022.07.05.20.41.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 20:41:31 -0700 (PDT) From: Eli Schwartz To: io-uring@vger.kernel.org Subject: [PATCH liburing 1/6] tests: do not report an error message when return ret that might be a skip Date: Tue, 5 Jul 2022 23:40:53 -0400 Message-Id: <20220706034059.2817423-2-eschwartz93@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220706034059.2817423-1-eschwartz93@gmail.com> References: <20220706034059.2817423-1-eschwartz93@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org We are going to update these functions to distinguish between pass/skip, so ret might be nonzero but have handled its own non-error message. Signed-off-by: Eli Schwartz --- test/fallocate.c | 8 ++++++-- test/file-update.c | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/test/fallocate.c b/test/fallocate.c index 6cb57e0..a9bf6fd 100644 --- a/test/fallocate.c +++ b/test/fallocate.c @@ -230,7 +230,9 @@ int main(int argc, char *argv[]) ret = test_fallocate(&ring); if (ret) { - fprintf(stderr, "test_fallocate failed\n"); + if (ret != T_EXIT_SKIP) { + fprintf(stderr, "test_fallocate failed\n"); + } return ret; } @@ -242,7 +244,9 @@ int main(int argc, char *argv[]) ret = test_fallocate_rlimit(&ring); if (ret) { - fprintf(stderr, "test_fallocate_rlimit failed\n"); + if (ret != T_EXIT_SKIP) { + fprintf(stderr, "test_fallocate_rlimit failed\n"); + } return ret; } diff --git a/test/file-update.c b/test/file-update.c index 97db95a..b8039c9 100644 --- a/test/file-update.c +++ b/test/file-update.c @@ -165,7 +165,9 @@ int main(int argc, char *argv[]) ret = test_sqe_update(&r1); if (ret) { - fprintf(stderr, "test_sqe_update failed\n"); + if (ret != T_EXIT_SKIP) { + fprintf(stderr, "test_sqe_update failed\n"); + } return ret; } From patchwork Wed Jul 6 03:40:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Schwartz X-Patchwork-Id: 12907278 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01A7EC433EF for ; Wed, 6 Jul 2022 03:41:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230214AbiGFDlg (ORCPT ); Tue, 5 Jul 2022 23:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbiGFDle (ORCPT ); Tue, 5 Jul 2022 23:41:34 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D3881D0E6 for ; Tue, 5 Jul 2022 20:41:33 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id d3so12907605ioi.9 for ; Tue, 05 Jul 2022 20:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=xfD3SbcGC6vDn5t/EKU5Z6UJ22begM4XJyyDYZSUc2U=; b=VpmL2ptLoaKkm7kvQQ6PjzcTCKUz8+XBguPBg56VYfEG69aK8YTIa0OkgQ47Qe5E1m rbwXh0XZiV0rZ6/E5YRezr5ZRS6WaJmOODdrS8PpeSwwp/8VsDsM4i8hJUh+ord+v+oR b7RTgsGLVrgdVeVZTZu/AwSAUBTwN25hH/4vpw3PQNGZNO+Yay2P9zW7Tr3I4jKYDWyx OhDHzepDiv3BHC/Ezi4wMo04XeYLz/ZUExe9wdNGjIvnEjs6Vds28JZmQ55+KDHVN+h3 Gfde+JaYP/pBmPGt9KXo/BBZLAuev1qH538Dh8swApQOeaToWFnnpq74MZqrcCGqa76+ pttg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xfD3SbcGC6vDn5t/EKU5Z6UJ22begM4XJyyDYZSUc2U=; b=7D3wq7mmFuwMWdMjUvWrF/b2xkUvyoSWmcNFy1YA1QIq2Jl2SiEuZDSLYkcGzTryuc Xu/NhmR67u337bIm3aGCg91NosZtG5zjBx9C8wVJ8OZ4LQdV8nVJ53X+ylYCxPNek72+ fpZDPBGJ4neGtuPUL8A27ql6bll7ejMpTctP3Nn2+kBEvcafO/7CdX499NCdChO5SQCU vW6Mtau58Ote/Yl+5gofFo0VLFaD/XVkDR62a4TOGvmX72EzLVTovieSOW9OOzePuoxS XOU4Ob1Kp/1WzQQk1IXVviCvE0RbRtwpTGWAwZupBGdIk8TPRy4xmxIdITCxOtoWFWqa unCg== X-Gm-Message-State: AJIora+QCXxYZRNgcvRDFTp+5yDrb/bZZTk7UKl4O8VEDs/9FB8DRHj8 UXCJb7c2NuleH5ueyC04+A0EvFDPA2d1rfYC X-Google-Smtp-Source: AGRyM1uOHUHxiqoZ5M1FxY9UL5o0mlByKFdIZ2vzVGFcJbBrX1oxeK0yHg6H36LRE8Xk1t3f9Z9b9w== X-Received: by 2002:a05:6602:15d1:b0:678:60ee:88bc with SMTP id f17-20020a05660215d100b0067860ee88bcmr11524997iow.73.1657078892351; Tue, 05 Jul 2022 20:41:32 -0700 (PDT) Received: from didactylos.localdomain ([2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) by smtp.gmail.com with ESMTPSA id z6-20020a05660217c600b006692192baf7sm16427854iox.25.2022.07.05.20.41.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 20:41:31 -0700 (PDT) From: Eli Schwartz To: io-uring@vger.kernel.org Subject: [PATCH liburing 2/6] tests: handle some skips that used a goto to enter cleanup Date: Tue, 5 Jul 2022 23:40:54 -0400 Message-Id: <20220706034059.2817423-3-eschwartz93@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220706034059.2817423-1-eschwartz93@gmail.com> References: <20220706034059.2817423-1-eschwartz93@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org We cannot use the general cleanup-and-succeed here. These were improperly ported to the exitcode reporting. Signed-off-by: Eli Schwartz --- test/accept-test.c | 7 +++++-- test/fallocate.c | 10 ++++++---- test/files-exit-hang-poll.c | 6 ++++-- test/files-exit-hang-timeout.c | 6 ++++-- test/hardlink.c | 9 ++++++--- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/test/accept-test.c b/test/accept-test.c index a898360..99f6080 100644 --- a/test/accept-test.c +++ b/test/accept-test.c @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) if (!ret) { if (cqe->res == -EBADF || cqe->res == -EINVAL) { fprintf(stdout, "Accept not supported, skipping\n"); - goto out; + goto skip; } else if (cqe->res < 0) { fprintf(stderr, "cqe error %d\n", cqe->res); goto err; @@ -71,9 +71,12 @@ int main(int argc, char *argv[]) return T_EXIT_FAIL; } -out: io_uring_queue_exit(&ring); return T_EXIT_PASS; + +skip: + io_uring_queue_exit(&ring); + return T_EXIT_SKIP; err: io_uring_queue_exit(&ring); return T_EXIT_FAIL; diff --git a/test/fallocate.c b/test/fallocate.c index a9bf6fd..e804ca5 100644 --- a/test/fallocate.c +++ b/test/fallocate.c @@ -67,14 +67,15 @@ static int test_fallocate_rlimit(struct io_uring *ring) if (cqe->res == -EINVAL) { fprintf(stdout, "Fallocate not supported, skipping\n"); no_fallocate = 1; - goto out; + goto skip; } else if (cqe->res != -EFBIG) { fprintf(stderr, "Expected -EFBIG: %d\n", cqe->res); goto err; } io_uring_cqe_seen(ring, cqe); -out: return 0; +skip: + return T_EXIT_SKIP; err: return 1; } @@ -117,7 +118,7 @@ static int test_fallocate(struct io_uring *ring) if (cqe->res == -EINVAL) { fprintf(stdout, "Fallocate not supported, skipping\n"); no_fallocate = 1; - goto out; + goto skip; } if (cqe->res) { fprintf(stderr, "cqe->res=%d\n", cqe->res); @@ -136,8 +137,9 @@ static int test_fallocate(struct io_uring *ring) goto err; } -out: return 0; +skip: + return T_EXIT_SKIP; err: return 1; } diff --git a/test/files-exit-hang-poll.c b/test/files-exit-hang-poll.c index 432d89f..0c609f1 100644 --- a/test/files-exit-hang-poll.c +++ b/test/files-exit-hang-poll.c @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) } if (i == 99) { printf("Gave up on finding a port, skipping\n"); - goto out; + goto skip; } } @@ -123,7 +123,9 @@ int main(int argc, char *argv[]) return T_EXIT_FAIL; } -out: io_uring_queue_exit(&ring); return T_EXIT_PASS; +skip: + io_uring_queue_exit(&ring); + return T_EXIT_SKIP; } diff --git a/test/files-exit-hang-timeout.c b/test/files-exit-hang-timeout.c index a19afc6..318f0e1 100644 --- a/test/files-exit-hang-timeout.c +++ b/test/files-exit-hang-timeout.c @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) } if (i == 99) { printf("Gave up on finding a port, skipping\n"); - goto out; + goto skip; } } @@ -129,7 +129,9 @@ int main(int argc, char *argv[]) return T_EXIT_FAIL; } -out: io_uring_queue_exit(&ring); return T_EXIT_PASS; +skip: + io_uring_queue_exit(&ring); + return T_EXIT_SKIP; } diff --git a/test/hardlink.c b/test/hardlink.c index f2b8182..29395c3 100644 --- a/test/hardlink.c +++ b/test/hardlink.c @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) if (ret < 0) { if (ret == -EBADF || ret == -EINVAL) { fprintf(stdout, "linkat not supported, skipping\n"); - goto out; + goto skip; } fprintf(stderr, "linkat: %s\n", strerror(-ret)); goto err1; @@ -121,7 +121,11 @@ int main(int argc, char *argv[]) goto err2; } -out: + unlinkat(AT_FDCWD, linkname, 0); + unlinkat(AT_FDCWD, target, 0); + io_uring_queue_exit(&ring); + return T_EXIT_SKIP; +skip: unlinkat(AT_FDCWD, linkname, 0); unlinkat(AT_FDCWD, target, 0); io_uring_queue_exit(&ring); @@ -134,4 +138,3 @@ err: io_uring_queue_exit(&ring); return T_EXIT_FAIL; } - From patchwork Wed Jul 6 03:40:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Schwartz X-Patchwork-Id: 12907280 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEB52C43334 for ; Wed, 6 Jul 2022 03:41:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbiGFDlh (ORCPT ); Tue, 5 Jul 2022 23:41:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbiGFDlg (ORCPT ); Tue, 5 Jul 2022 23:41:36 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 952671CFD7 for ; Tue, 5 Jul 2022 20:41:34 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id y18so12937716iof.2 for ; Tue, 05 Jul 2022 20:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=3C36Tj5XIbUfaHZXrkQ1xIFb4jKi8m5ryOom/rSuOuY=; b=M6hlR/XlKZ7Y/pIRSGk3HTsxaMvH6LJU9oikLO7JJiaF/wrpQtcsVX5mICV94p+L7s IF/EQXidRXq1d0xUJ/DWFdrGi2AVtMLS1p4YRsI8N89mKvrfD07zH5IzJ5J0fHZNtGo7 DugTMgsVhkg/DhLj1N3dK9dKepGzRVRoqTIdRZn4Vg/PmkZdGe76aMwMw+57uvdsKySu Rjdq6JHWX8epOPXQIPy/PF9qnfpP1AL/P9hnytMLKGF9ipKzJutglAYkqYjz/DAgu9zJ XfRmT/BoO3HqXPwv4KX1D0Iw5Ubfbz8u2hegEUngsFjyDCquIssW56J3hutsi9aYlnPg n0cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3C36Tj5XIbUfaHZXrkQ1xIFb4jKi8m5ryOom/rSuOuY=; b=sfNMN7eZfTMpeYKyNCAKyDFwhXEwe3wJ4D+S6/1OyQXSXq9Z0ab+5fm1TLqwDuD7IW v82XR7eArozndT+goMHzW4VCeLSv8qi6K+/gyPahbJRZzD5PToPfXvRdYjVvkik8Ctci ubDoxCJG2ZMK+oz4Q7qTDKeMMBZwzf91cMPTxjuOEiOMmWtdKwbrqS1TNFVLQrGxQ8hx yzIsYgr6IWtfKSjqF+mBmSORAvOkeCq53BD82PvId1xOZpn4KAvOKnCtp29fFHpVErmg XPIml5eCwx6y3njuK6/CzRNS1cu8vrwoV17ScyE8dBnGJJ3nVd793k8NYe8FuPuLvLAa 3IhA== X-Gm-Message-State: AJIora8vcGYdWj1MA4bB8V1UgkO7waf6npUgsPGsBILWys1wSu7u76eS kX/w1BKj2uvc7XdljN0JtgcV7P6UhUnnpJKO X-Google-Smtp-Source: AGRyM1sXjexR2OPlYv18ub5jnwT3Sj4+7m1WqcN9auNWmte3PnuC+gI/rooxL2FZrA6SroNl38/G0Q== X-Received: by 2002:a02:228d:0:b0:333:ffe9:864b with SMTP id o135-20020a02228d000000b00333ffe9864bmr23368426jao.277.1657078893215; Tue, 05 Jul 2022 20:41:33 -0700 (PDT) Received: from didactylos.localdomain ([2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) by smtp.gmail.com with ESMTPSA id z6-20020a05660217c600b006692192baf7sm16427854iox.25.2022.07.05.20.41.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 20:41:32 -0700 (PDT) From: Eli Schwartz To: io-uring@vger.kernel.org Subject: [PATCH liburing 3/6] tests: more work on updating exit codes to use enum-based status reporting Date: Tue, 5 Jul 2022 23:40:55 -0400 Message-Id: <20220706034059.2817423-4-eschwartz93@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220706034059.2817423-1-eschwartz93@gmail.com> References: <20220706034059.2817423-1-eschwartz93@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Signed-off-by: Eli Schwartz --- test/accept-reuse.c | 2 +- test/accept.c | 8 ++++---- test/connect.c | 2 +- test/double-poll-crash.c | 4 ++-- test/fadvise.c | 2 +- test/file-register.c | 2 +- test/file-update.c | 4 ++-- test/files-exit-hang-timeout.c | 4 ++-- test/fixed-reuse.c | 2 +- test/io-cancel.c | 14 +++++++------- test/io_uring_enter.c | 8 ++++---- test/io_uring_register.c | 6 +++--- test/io_uring_setup.c | 7 ++++--- test/iopoll.c | 6 +++--- test/lfs-openat-write.c | 4 +++- test/link-timeout.c | 7 ++++--- test/link.c | 9 +++++---- test/madvise.c | 4 ++-- test/mkdir.c | 5 +++-- test/msg-ring.c | 13 +++++++------ test/multicqes_drain.c | 5 +++-- 21 files changed, 63 insertions(+), 55 deletions(-) diff --git a/test/accept-reuse.c b/test/accept-reuse.c index ff99da8..7822433 100644 --- a/test/accept-reuse.c +++ b/test/accept-reuse.c @@ -103,7 +103,7 @@ int main(int argc, char **argv) ret = listen(listen_fd, SOMAXCONN); if (ret < 0) { perror("listen"); - return 1; + return T_EXIT_FAIL; } memset(&sa, 0, sizeof(sa)); diff --git a/test/accept.c b/test/accept.c index 0463173..f0d84f4 100644 --- a/test/accept.c +++ b/test/accept.c @@ -510,7 +510,7 @@ static int test_accept_cancel(unsigned usecs, unsigned int nr, bool multishot) int fd, i, ret; if (multishot && no_accept_multi) - return 0; + return T_EXIT_SKIP; ret = io_uring_queue_init(32, &m_io_uring, 0); assert(ret >= 0); @@ -605,7 +605,7 @@ static int test_multishot_accept(int count, bool before, bool overflow) }; if (no_accept_multi) - return 0; + return T_EXIT_SKIP; ret = io_uring_queue_init(MAX_FDS + 10, &m_io_uring, 0); assert(ret >= 0); @@ -695,7 +695,7 @@ static int test_multishot_fixed_accept(void) }; if (no_accept_multi) - return 0; + return T_EXIT_SKIP; memset(fd, -1, sizeof(fd)); ret = io_uring_queue_init(MAX_FDS + 10, &m_io_uring, 0); @@ -742,7 +742,7 @@ int main(int argc, char *argv[]) return ret; } if (no_accept) - return 0; + return T_EXIT_SKIP; ret = test_accept(2, false); if (ret) { diff --git a/test/connect.c b/test/connect.c index d31bd05..b8f8f22 100644 --- a/test/connect.c +++ b/test/connect.c @@ -380,7 +380,7 @@ int main(int argc, char *argv[]) return T_EXIT_FAIL; } if (no_connect) - return 0; + return T_EXIT_SKIP; ret = test_connect(&ring); if (ret == -1) { diff --git a/test/double-poll-crash.c b/test/double-poll-crash.c index 0d6154b..a0cc985 100644 --- a/test/double-poll-crash.c +++ b/test/double-poll-crash.c @@ -123,10 +123,10 @@ int main(int argc, char *argv[]) mmap_ret = mmap((void *)0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); if (mmap_ret == MAP_FAILED) - return 0; + return T_EXIT_SKIP; mmap_ret = mmap((void *)0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); if (mmap_ret == MAP_FAILED) - return 0; + return T_EXIT_SKIP; intptr_t res = 0; *(uint32_t*)0x20000484 = 0; *(uint32_t*)0x20000488 = 0; diff --git a/test/fadvise.c b/test/fadvise.c index d259223..889f447 100644 --- a/test/fadvise.c +++ b/test/fadvise.c @@ -73,7 +73,7 @@ static int do_fadvise(struct io_uring *ring, int fd, off_t offset, off_t len, if (ret == -EINVAL || ret == -EBADF) { fprintf(stdout, "Fadvise not supported, skipping\n"); unlink(".fadvise.tmp"); - exit(0); + exit(T_EXIT_SKIP); } else if (ret) { fprintf(stderr, "cqe->res=%d\n", cqe->res); } diff --git a/test/file-register.c b/test/file-register.c index e713233..ae35c37 100644 --- a/test/file-register.c +++ b/test/file-register.c @@ -1034,7 +1034,7 @@ int main(int argc, char *argv[]) } if (no_update) - return 0; + return T_EXIT_SKIP; ret = test_additions(&ring); if (ret) { diff --git a/test/file-update.c b/test/file-update.c index b8039c9..57355ed 100644 --- a/test/file-update.c +++ b/test/file-update.c @@ -131,7 +131,7 @@ static int test_sqe_update(struct io_uring *ring) free(fds); if (ret == -EINVAL) { fprintf(stdout, "IORING_OP_FILES_UPDATE not supported, skipping\n"); - return 0; + return T_EXIT_SKIP; } return ret != 10; } @@ -171,5 +171,5 @@ int main(int argc, char *argv[]) return ret; } - return 0; + return T_EXIT_PASS; } diff --git a/test/files-exit-hang-timeout.c b/test/files-exit-hang-timeout.c index 318f0e1..45f01ea 100644 --- a/test/files-exit-hang-timeout.c +++ b/test/files-exit-hang-timeout.c @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) break; if (errno != EADDRINUSE) { fprintf(stderr, "bind: %s\n", strerror(errno)); - return 1; + return T_EXIT_FAIL; } if (i == 99) { printf("Gave up on finding a port, skipping\n"); @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) if (listen(sock_listen_fd, BACKLOG) < 0) { perror("Error listening on socket\n"); - return 1; + return T_EXIT_FAIL; } if (setup_io_uring()) diff --git a/test/fixed-reuse.c b/test/fixed-reuse.c index 8bcda4b..401251a 100644 --- a/test/fixed-reuse.c +++ b/test/fixed-reuse.c @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) return T_EXIT_FAIL; } if (!(p.features & IORING_FEAT_CQE_SKIP)) - return 0; + return T_EXIT_SKIP; memset(files, -1, sizeof(files)); ret = io_uring_register_files(&ring, files, ARRAY_SIZE(files)); diff --git a/test/io-cancel.c b/test/io-cancel.c index 13bf84f..dfe4e43 100644 --- a/test/io-cancel.c +++ b/test/io-cancel.c @@ -508,26 +508,26 @@ int main(int argc, char *argv[]) int i, ret; if (argc > 1) - return 0; + return T_EXIT_SKIP; if (test_dont_cancel_another_ring()) { fprintf(stderr, "test_dont_cancel_another_ring() failed\n"); - return 1; + return T_EXIT_FAIL; } if (test_cancel_req_across_fork()) { fprintf(stderr, "test_cancel_req_across_fork() failed\n"); - return 1; + return T_EXIT_FAIL; } if (test_cancel_inflight_exit()) { fprintf(stderr, "test_cancel_inflight_exit() failed\n"); - return 1; + return T_EXIT_FAIL; } if (test_sqpoll_cancel_iowq_requests()) { fprintf(stderr, "test_sqpoll_cancel_iowq_requests() failed\n"); - return 1; + return T_EXIT_FAIL; } t_create_file(fname, FILE_SIZE); @@ -548,8 +548,8 @@ int main(int argc, char *argv[]) } unlink(fname); - return 0; + return T_EXIT_PASS; err: unlink(fname); - return 1; + return T_EXIT_FAIL; } diff --git a/test/io_uring_enter.c b/test/io_uring_enter.c index ef00bf6..941c5b7 100644 --- a/test/io_uring_enter.c +++ b/test/io_uring_enter.c @@ -185,14 +185,14 @@ int main(int argc, char **argv) unsigned completed, dropped; if (argc > 1) - return 0; + return T_EXIT_SKIP; ret = io_uring_queue_init(IORING_MAX_ENTRIES, &ring, 0); if (ret == -ENOMEM) ret = io_uring_queue_init(IORING_MAX_ENTRIES_FALLBACK, &ring, 0); if (ret < 0) { perror("io_uring_queue_init"); - exit(1); + exit(T_EXIT_FAIL); } mask = *sq->kring_mask; @@ -254,8 +254,8 @@ int main(int argc, char **argv) } if (!status) - return 0; + return T_EXIT_PASS; fprintf(stderr, "FAIL\n"); - return -1; + return T_EXIT_FAIL; } diff --git a/test/io_uring_register.c b/test/io_uring_register.c index 05868e1..311bfdf 100644 --- a/test/io_uring_register.c +++ b/test/io_uring_register.c @@ -459,20 +459,20 @@ int main(int argc, char **argv) struct rlimit rlim; if (argc > 1) - return 0; + return T_EXIT_SKIP; /* setup globals */ pagesize = getpagesize(); ret = getrlimit(RLIMIT_MEMLOCK, &rlim); if (ret < 0) { perror("getrlimit"); - return 1; + return T_EXIT_PASS; } mlock_limit = rlim.rlim_cur; devnull = open("/dev/null", O_RDWR); if (devnull < 0) { perror("open /dev/null"); - exit(1); + exit(T_EXIT_FAIL); } /* invalid fd */ diff --git a/test/io_uring_setup.c b/test/io_uring_setup.c index 7752c97..3c50e2a 100644 --- a/test/io_uring_setup.c +++ b/test/io_uring_setup.c @@ -15,6 +15,7 @@ #include #include #include "liburing.h" +#include "helpers.h" #include "../syscall.h" @@ -130,7 +131,7 @@ main(int argc, char **argv) struct io_uring_params p; if (argc > 1) - return 0; + return T_EXIT_SKIP; memset(&p, 0, sizeof(p)); status |= try_io_uring_setup(0, &p, -1, EINVAL); @@ -179,8 +180,8 @@ main(int argc, char **argv) } if (!status) - return 0; + return T_EXIT_PASS; fprintf(stderr, "FAIL\n"); - return -1; + return T_EXIT_FAIL; } diff --git a/test/iopoll.c b/test/iopoll.c index f3c22d6..51b192f 100644 --- a/test/iopoll.c +++ b/test/iopoll.c @@ -323,7 +323,7 @@ int main(int argc, char *argv[]) char *fname; if (probe_buf_select()) - return 1; + return T_EXIT_FAIL; if (argc > 1) { fname = argv[1]; @@ -364,9 +364,9 @@ int main(int argc, char *argv[]) if (fname != argv[1]) unlink(fname); - return 0; + return T_EXIT_PASS; err: if (fname != argv[1]) unlink(fname); - return 1; + return T_EXIT_FAIL; } diff --git a/test/lfs-openat-write.c b/test/lfs-openat-write.c index 6bbf78d..b413a11 100644 --- a/test/lfs-openat-write.c +++ b/test/lfs-openat-write.c @@ -14,6 +14,8 @@ #include #include +#include "helpers.h" + static const int RSIZE = 2; static const int OPEN_FLAGS = O_RDWR | O_CREAT; static const mode_t OPEN_MODE = S_IRUSR | S_IWUSR; @@ -100,7 +102,7 @@ int main(int argc, char *argv[]) int dfd, ret; if (argc > 1) - return 0; + return T_EXIT_SKIP; dfd = open("/tmp", O_RDONLY | O_DIRECTORY); if (dfd < 0) diff --git a/test/link-timeout.c b/test/link-timeout.c index ad638e9..5e56d5a 100644 --- a/test/link-timeout.c +++ b/test/link-timeout.c @@ -12,6 +12,7 @@ #include #include "liburing.h" +#include "helpers.h" static int test_fail_lone_link_timeouts(struct io_uring *ring) { @@ -1011,12 +1012,12 @@ int main(int argc, char *argv[]) int ret; if (argc > 1) - return 0; + return T_EXIT_SKIP; ret = io_uring_queue_init(8, &ring, 0); if (ret) { printf("ring setup failed\n"); - return 1; + return T_EXIT_FAIL; } ret = test_timeout_link_chain1(&ring); @@ -1103,5 +1104,5 @@ int main(int argc, char *argv[]) return ret; } - return 0; + return T_EXIT_PASS; } diff --git a/test/link.c b/test/link.c index 41d3899..3c8d991 100644 --- a/test/link.c +++ b/test/link.c @@ -11,6 +11,7 @@ #include #include "liburing.h" +#include "helpers.h" static int no_hardlink; @@ -435,19 +436,19 @@ int main(int argc, char *argv[]) int ret; if (argc > 1) - return 0; + return T_EXIT_SKIP; ret = io_uring_queue_init(8, &ring, 0); if (ret) { printf("ring setup failed\n"); - return 1; + return T_EXIT_FAIL; } ret = io_uring_queue_init(8, &poll_ring, IORING_SETUP_IOPOLL); if (ret) { printf("poll_ring setup failed\n"); - return 1; + return T_EXIT_FAIL; } ret = test_single_link(&ring); @@ -492,5 +493,5 @@ int main(int argc, char *argv[]) return ret; } - return 0; + return T_EXIT_PASS; } diff --git a/test/madvise.c b/test/madvise.c index b85aba8..8848143 100644 --- a/test/madvise.c +++ b/test/madvise.c @@ -187,9 +187,9 @@ int main(int argc, char *argv[]) if (fname != argv[1]) unlink(fname); io_uring_queue_exit(&ring); - return 0; + return T_EXIT_PASS; err: if (fname != argv[1]) unlink(fname); - return 1; + return T_EXIT_FAIL; } diff --git a/test/mkdir.c b/test/mkdir.c index 363fe1e..6b3497c 100644 --- a/test/mkdir.c +++ b/test/mkdir.c @@ -10,6 +10,7 @@ #include #include "liburing.h" +#include "helpers.h" static int do_mkdirat(struct io_uring *ring, const char *fn) { @@ -59,7 +60,7 @@ int main(int argc, char *argv[]) struct io_uring ring; if (argc > 1) - return 0; + return T_EXIT_SKIP; ret = io_uring_queue_init(8, &ring, 0); if (ret) { @@ -104,5 +105,5 @@ err1: unlinkat(AT_FDCWD, fn, AT_REMOVEDIR); err: io_uring_queue_exit(&ring); - return 1; + return T_EXIT_FAIL; } diff --git a/test/msg-ring.c b/test/msg-ring.c index 48c4a64..aec498d 100644 --- a/test/msg-ring.c +++ b/test/msg-ring.c @@ -12,6 +12,7 @@ #include #include "liburing.h" +#include "helpers.h" static int no_msg; @@ -183,22 +184,22 @@ int main(int argc, char *argv[]) int ret; if (argc > 1) - return 0; + return T_EXIT_SKIP; ret = io_uring_queue_init(8, &ring, 0); if (ret) { fprintf(stderr, "ring setup failed: %d\n", ret); - return 1; + return T_EXIT_FAIL; } ret = io_uring_queue_init(8, &ring2, 0); if (ret) { fprintf(stderr, "ring setup failed: %d\n", ret); - return 1; + return T_EXIT_FAIL; } ret = io_uring_queue_init(8, &pring, IORING_SETUP_IOPOLL); if (ret) { fprintf(stderr, "ring setup failed: %d\n", ret); - return 1; + return T_EXIT_FAIL; } ret = test_own(&ring); @@ -208,7 +209,7 @@ int main(int argc, char *argv[]) } if (no_msg) { fprintf(stdout, "Skipped\n"); - return 0; + return T_EXIT_SKIP; } ret = test_own(&pring); if (ret) { @@ -232,5 +233,5 @@ int main(int argc, char *argv[]) pthread_join(thread, &tret); - return 0; + return T_EXIT_PASS; } diff --git a/test/multicqes_drain.c b/test/multicqes_drain.c index b16dc52..b7448ac 100644 --- a/test/multicqes_drain.c +++ b/test/multicqes_drain.c @@ -17,6 +17,7 @@ #include #include "liburing.h" +#include "helpers.h" enum { multi, @@ -360,12 +361,12 @@ int main(int argc, char *argv[]) int i, ret; if (argc > 1) - return 0; + return T_EXIT_SKIP; ret = io_uring_queue_init(1024, &ring, 0); if (ret) { printf("ring setup failed\n"); - return 1; + return T_EXIT_FAIL; } for (i = 0; i < 5; i++) { From patchwork Wed Jul 6 03:40:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Schwartz X-Patchwork-Id: 12907277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75B40CCA47F for ; Wed, 6 Jul 2022 03:41:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229480AbiGFDlg (ORCPT ); Tue, 5 Jul 2022 23:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbiGFDlg (ORCPT ); Tue, 5 Jul 2022 23:41:36 -0400 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB84A1D0EC for ; Tue, 5 Jul 2022 20:41:34 -0700 (PDT) Received: by mail-il1-x12e.google.com with SMTP id v1so5277800ilg.11 for ; Tue, 05 Jul 2022 20:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=dNvJ2cyduJU4oP9p8VcACup4a7slqRhxUtHeCCkIxT0=; b=Dly67QQ104kf4Xzg+NW6n+4cd/GfaWerv18Uor4ys44MQBgQ/LGUqnSGRTZ8DRFB5J WXm3rTvpw7l/yuksyHROsFYfZwo6Yyg0GeznTPAV0tUXbPGk9fovaPz7Pqsq59KtFnOL Izlj0GW9efLgjeuCRC6nGuLcL0G6HVDK3q2jd8kqZTlO5Vzb84sUxyeJ/pXUH9W594vh E84+poE9odNgL9vopXxCF6wPScZOayFVKmoBsqAWrRL9SR2hSzS+9J2IQAXTAYeZh1sA cB+aPaqAbYv1MLyMqKmLpFNpgHPjfe3E1MblGZRp5918YpR2kr2gbh99w4/VUFJHhj/X JXAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dNvJ2cyduJU4oP9p8VcACup4a7slqRhxUtHeCCkIxT0=; b=tt6wxH2ZtE11XsDcECj7iJPfsJJ18tkJSYovfKgHCKGC93/ISk760WP5q1dGUP2hgH eFwqe9qTr6Nosp7pe7IDXybAQMIQGVSF00yLmYh1qRUsqo7MpDx2yhHLIoMx0D45AJOq /blMnnnVKpjmlSF9sfwpGmm53yqDsQD1z+25cSx+mL5InlCcCYqzjtlMJ/cyB4xL8wjY DINfpgrX3DFLK4qr8m7JemnwVs9o0bbeV7e68IH0n9VHKgceh4gp63MgaTk6CGMCMe2Q TZd4qSHsnCSwxSX6KcjYc9/8ueNypa8/I0MfFbG2s8yOiZFPx4mMYK8xqbvA2WlaYlv/ AEZA== X-Gm-Message-State: AJIora8lAWCuSQxZ5AGe+vt/mQO6RqyBNyr7ODO/HKWf5i/owy3bSaeI k2b0snqlOlvys4444xZ/iCycqpy2EFIwnBQ+ X-Google-Smtp-Source: AGRyM1vW76jZ24LZws4ZmBvnW/ojoqxOiuTmqdyNIabeDphxeqP1bivZuJkhjzZy1WJVEoGahyy8HQ== X-Received: by 2002:a05:6e02:154c:b0:2dc:1e6c:ad84 with SMTP id j12-20020a056e02154c00b002dc1e6cad84mr5623198ilu.167.1657078893995; Tue, 05 Jul 2022 20:41:33 -0700 (PDT) Received: from didactylos.localdomain ([2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) by smtp.gmail.com with ESMTPSA id z6-20020a05660217c600b006692192baf7sm16427854iox.25.2022.07.05.20.41.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 20:41:33 -0700 (PDT) From: Eli Schwartz To: io-uring@vger.kernel.org Subject: [PATCH liburing 4/6] tests: mention in a status message that this is a skip Date: Tue, 5 Jul 2022 23:40:56 -0400 Message-Id: <20220706034059.2817423-5-eschwartz93@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220706034059.2817423-1-eschwartz93@gmail.com> References: <20220706034059.2817423-1-eschwartz93@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org It didn't specify that it's an error, and ultimately either returned an early 0 or, now, T_EXIT_SKIP. Clarify in the logging what it actually is. Signed-off-by: Eli Schwartz --- test/file-register.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/file-register.c b/test/file-register.c index ae35c37..634ef81 100644 --- a/test/file-register.c +++ b/test/file-register.c @@ -306,7 +306,7 @@ static int test_sparse(struct io_uring *ring) ret = io_uring_register_files(ring, files, 200); if (ret) { if (ret == -EBADF) { - fprintf(stdout, "Sparse files not supported\n"); + fprintf(stdout, "Sparse files not supported, skipping\n"); no_update = 1; goto done; } From patchwork Wed Jul 6 03:40:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Schwartz X-Patchwork-Id: 12907279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DEF5CCA481 for ; Wed, 6 Jul 2022 03:41:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbiGFDlh (ORCPT ); Tue, 5 Jul 2022 23:41:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230274AbiGFDlg (ORCPT ); Tue, 5 Jul 2022 23:41:36 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3EE21D0E6 for ; Tue, 5 Jul 2022 20:41:35 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id p128so12960838iof.1 for ; Tue, 05 Jul 2022 20:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=x057cX0WQUKc+gw02TFg5EPcC5q2Nkpgn1fkajLFlvI=; b=XJWKgLHvqG5SFvipw2Zw52/F4WindsxEA1OhN4F0P5yqjGhsopoe84dkDBoJG0KswZ GNPnUyI2JozpRseaeql35kS/dSjizJRGA4zLp1PvvwhvvwChW7rcQf4oEInuAwoiVRaH rm+fw2n2BrsAHLUFC66k8st04fTSAwBIhSMCF7aaa2wZq5CV8umjbEoPkDA7DafFNpfm gbpie1mlHMxXurK/3mwrA/CLWUEzXqN1aJ3AH+Pd28ruM/dJuElM29en5TUZJqaJB8W2 51EnNYCMbSOJXQyapzhycUyNuFh6ELPiKlYmxhOzu5Uve4PIzWhoaU1v2qp5KCccaKTI iGaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x057cX0WQUKc+gw02TFg5EPcC5q2Nkpgn1fkajLFlvI=; b=v4Q3Cxvh10pics32PJGkA29mR8/Q3dskTd2X3i0q46fO4kCiyN6nLExDyEceiruTnN NLPY0cu0FgY5YYbJpYEj5CAWzzF6C/knVV24taByIMLGX6XemyyuecqtN9hcXum4jl87 WVhsA2j8cJJYUbYXwfVfX+MCPUZqPJY/LwC+INvzdbg85wX/kPPpguQIyKcYnK+3HHFj s/KL8i8eAGPFkLP3Q2EwdUw+c8j2VA+PcnxuLmuPx7wrCdmCUV3SEBOsxpuzr77fUr8h HubVDye8tp3Ba8hj8RQpJucTtHcLeOGH0OKabhLD5Me4ef628hyashX2AuKrMGD56WIs UVLg== X-Gm-Message-State: AJIora/3vijvZCsBVFS0PgbyyN4xsaa1B+0dupUDMq+7XE7daKZRyNfa r3M/H9N85NvGOou0fwlLSZYDkwbTuIJCytuC X-Google-Smtp-Source: AGRyM1sNyYc5VwooATU3zDMwUOhopKqOQvZvtpURb2XUZF5VMxQ8FHeYl5ap3vacSoYd48+BZbgqAQ== X-Received: by 2002:a6b:8b42:0:b0:675:1e6d:9386 with SMTP id n63-20020a6b8b42000000b006751e6d9386mr21268298iod.153.1657078894777; Tue, 05 Jul 2022 20:41:34 -0700 (PDT) Received: from didactylos.localdomain ([2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) by smtp.gmail.com with ESMTPSA id z6-20020a05660217c600b006692192baf7sm16427854iox.25.2022.07.05.20.41.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 20:41:34 -0700 (PDT) From: Eli Schwartz To: io-uring@vger.kernel.org Subject: [PATCH liburing 5/6] tests: migrate a skip that used a goto to enter cleanup Date: Tue, 5 Jul 2022 23:40:57 -0400 Message-Id: <20220706034059.2817423-6-eschwartz93@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220706034059.2817423-1-eschwartz93@gmail.com> References: <20220706034059.2817423-1-eschwartz93@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org We cannot use the general cleanup-and-succeed here. Migrate this to use exitcode reporting via a new "skip" goto. Signed-off-by: Eli Schwartz --- test/mkdir.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/mkdir.c b/test/mkdir.c index 6b3497c..0a6d16f 100644 --- a/test/mkdir.c +++ b/test/mkdir.c @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) if (ret < 0) { if (ret == -EBADF || ret == -EINVAL) { fprintf(stdout, "mkdirat not supported, skipping\n"); - goto out; + goto skip; } fprintf(stderr, "mkdirat: %s\n", strerror(-ret)); goto err; @@ -97,10 +97,13 @@ int main(int argc, char *argv[]) goto err1; } -out: unlinkat(AT_FDCWD, fn, AT_REMOVEDIR); io_uring_queue_exit(&ring); - return 0; + return T_EXIT_PASS; +skip: + unlinkat(AT_FDCWD, fn, AT_REMOVEDIR); + io_uring_queue_exit(&ring); + return T_EXIT_SKIP; err1: unlinkat(AT_FDCWD, fn, AT_REMOVEDIR); err: From patchwork Wed Jul 6 03:40:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Schwartz X-Patchwork-Id: 12907281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4063ACCA47F for ; Wed, 6 Jul 2022 03:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230339AbiGFDli (ORCPT ); Tue, 5 Jul 2022 23:41:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbiGFDlh (ORCPT ); Tue, 5 Jul 2022 23:41:37 -0400 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 828801D337 for ; Tue, 5 Jul 2022 20:41:36 -0700 (PDT) Received: by mail-io1-xd2a.google.com with SMTP id z191so12939516iof.6 for ; Tue, 05 Jul 2022 20:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=yDg6wC7nuZZX8KWmjdjU7VBm9TO44Q1YklajAUbfBmw=; b=MhoLdYR4BKTgVaD7bIkgz9rTuDL0ChkCD5K/Yrq86zloAXi6TEWeeqvZJDv7MHm/vq uQMjtR+AlEOaXXnyesl7sFVEaZbRZnjOL890kHUWsF989s8BDlupOsvUtRGUJDuKrV95 S8XfQYay5pufOg7F4iNtmaK+s4X1RXH0jLA9x6Wr+/I4amrHugcXnp4kQj71pUrWjE9v FxgjFMYpIL9ATrP9ow5jioSvFjjWISYClwHzXtZziP5nTPQ+S8xXi/dCo0DSDX+MuG1O k6VnN0jiEa0tF8jXi6nFhrhybwPjEX+92MVwe8a5tE08K0XUqHO+Hma7YAqljDoRFg55 KKRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yDg6wC7nuZZX8KWmjdjU7VBm9TO44Q1YklajAUbfBmw=; b=IFYACKdxBSf+Wbv4U2mh+TbVDcxw4GaDIV7UI7oRkkwwlreERzpQm7ESSKE1QxC3o/ l5jBo12HgbAbclNIMu+aH5sclcxRKgaly8AT+dnrvYFOhkeyjZrCSBPaE/iePW6Qhe21 U0/9yyWm/tsweUihzwZdKEfAtqaxChamFKi556+5ZZzt2w1YWQXidcK2ldryEgiomQaT GYDWv3A+abJ9L/Xyx+ym3hQucOJy18YfDKzR2gm97774imUj3XtOMWFdBZtDF+71slQN OOaNkQUPQmpfbmLdxSsGbhXJll0UQma8K471zfRC0L7dU9tkVYbSNlE7kh3k+c60GyGh RgAw== X-Gm-Message-State: AJIora/PQnGOFYtghRbTrJ75/AkMEht+MFW2yUvSEvhROngtlbfplBCs pXDTedBjERc5hPr9gi4ojcEsx0bKLMKtc2lY X-Google-Smtp-Source: AGRyM1u+5HKkYBTrEyc4tSw/zklLIPrGvbHfrSBcMNbViWvMtKghTwNIx6vf8QoUj7wm+3XcpVgSAw== X-Received: by 2002:a05:6638:328c:b0:33c:b753:69f6 with SMTP id f12-20020a056638328c00b0033cb75369f6mr23713694jav.73.1657078895598; Tue, 05 Jul 2022 20:41:35 -0700 (PDT) Received: from didactylos.localdomain ([2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) by smtp.gmail.com with ESMTPSA id z6-20020a05660217c600b006692192baf7sm16427854iox.25.2022.07.05.20.41.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 20:41:35 -0700 (PDT) From: Eli Schwartz To: io-uring@vger.kernel.org Subject: [PATCH liburing 6/6] tests: correctly exit with failure in a looped test Date: Tue, 5 Jul 2022 23:40:58 -0400 Message-Id: <20220706034059.2817423-7-eschwartz93@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220706034059.2817423-1-eschwartz93@gmail.com> References: <20220706034059.2817423-1-eschwartz93@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org A common test pattern in this project is to test a couple related things in a single test binary, and return failure on the first one that fails, if any. Tracking subtest failures cannot be done well with simple exit() statuses, though it can using something like TAP and parsing a generated report. However, this test simply set the value of `ret`, then proceeded to another test. If the first failed and the second succeeded, we would log a failure but then return a success. Just return immediately on failure as is done elsewhere. Signed-off-by: Eli Schwartz --- test/multicqes_drain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/multicqes_drain.c b/test/multicqes_drain.c index b7448ac..1423f92 100644 --- a/test/multicqes_drain.c +++ b/test/multicqes_drain.c @@ -373,7 +373,7 @@ int main(int argc, char *argv[]) ret = test_simple_drain(&ring); if (ret) { fprintf(stderr, "test_simple_drain failed\n"); - break; + return T_EXIT_FAIL; } } @@ -381,8 +381,8 @@ int main(int argc, char *argv[]) ret = test_generic_drain(&ring); if (ret) { fprintf(stderr, "test_generic_drain failed\n"); - break; + return T_EXIT_FAIL; } } - return ret; + return T_EXIT_PASS; }