From patchwork Mon Jul 26 07:56:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1509886 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=AfW2hiUF; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GYC1c29Qsz9shx; Mon, 26 Jul 2021 17:56:52 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1m7vTk-0004C4-QP; Mon, 26 Jul 2021 07:56:48 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1m7vTi-0004Bi-BU for kernel-team@lists.ubuntu.com; Mon, 26 Jul 2021 07:56:46 +0000 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (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 smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPS id 321F93F228 for ; Mon, 26 Jul 2021 07:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1627286206; bh=ytTQfhhJtbyp3bzlSNVDwtaYAv82wFvnTgbJ7S3vZ90=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AfW2hiUFSzTuW/Z11VyE1O6sjCf4ZGyB2xU6dw5pdsX5Ft8eX5UEwtS0XUKzb5ron yckp1TqO6XGndyZNzSwOE48sK9fTu9FbLd6xKx7Eeezwn7NoVbdBPNGRErndR3a0yz 3MFGrbHCkvMQoaTYnVtS5/khX3r+i85QPbfsvarxefYVG5+q04gT3W0zDr63Pi8ERB KHr1ohUegjAm6n6sC/PMR5CU+4Vny/hepnb/tMC8zF8zVV7m61hwiBMD8MfIvz9xR/ RNjh1S6B1amf8LEbkEWqEJVcuZlvWAHsoRO2P0v/M8GXHo/jUlGcyO6fGSLLzvkrvt 2cYBDSGmn6zQw== Received: by mail-pl1-f198.google.com with SMTP id f9-20020a1709028609b0290128bcba6be7so8133634plo.18 for ; Mon, 26 Jul 2021 00:56:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ytTQfhhJtbyp3bzlSNVDwtaYAv82wFvnTgbJ7S3vZ90=; b=KFPrTByii/40BeMvVn2oagIpkDL70xK8BCTtpOERVdMK9LQZlsBY6lBFUY+eO4Zj0L AnxQ7Cs2/aoYVhmrkqoMXfbbKRCMHY3pCPKXgJ4cDWwS1+PPN/zPyLFufWPzhGL6dq6J dyagu8ZGyj6zEDkjbQGI458QJJL+UOwr5RzA11WQpTB6cujfcfDlGYwRV0UD7Wz7jfnD EV1gSkIkP7t7gQWZlwMKMbbxxJu4XLcmfGUvwLMLNwL9UmBrCefvfORQgWJIT6rppRr8 XT5ATNspi7U/6xhMkQEvbICFC9wp74Hjy+JMpkRS68qsFKxTC6X29OJ/D5VyttHt9Syo fjbA== X-Gm-Message-State: AOAM530fUjtLXIBjBMePMCH4ZLnAYStbPaoXSQj9G0n2u9CxpGNSyenQ 89ZMl153cPJeOprBsNXEf27k1zLgG88RzhF8pFfb/2aCJBpe2COG1utFwYJOp1duuv00w/Yd2Eo kDxEBZ/7NA5vtl4fFJ//327J+/V4viLakrDbyzC6q X-Received: by 2002:a17:90b:ecd:: with SMTP id gz13mr15964774pjb.152.1627286204761; Mon, 26 Jul 2021 00:56:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGOTeyaHMUhoO7t2+A50PmreBF+f6hao1z73COFwIhIbKbzNjfdcYIt2r0/wnkUn62mf9qBQ== X-Received: by 2002:a17:90b:ecd:: with SMTP id gz13mr15964753pjb.152.1627286204464; Mon, 26 Jul 2021 00:56:44 -0700 (PDT) Received: from localhost.localdomain (2001-b011-200d-34f4-1ab9-7205-2371-16db.dynamic-ip6.hinet.net. [2001:b011:200d:34f4:1ab9:7205:2371:16db]) by smtp.gmail.com with ESMTPSA id p5sm41228994pfn.46.2021.07.26.00.56.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 00:56:43 -0700 (PDT) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [F/H/I/Unstable][F-OEM-5.10/F-OEM-5.13][SRU][PATCH 1/1] selftests: timers: rtcpie: skip test if default RTC device does not exist Date: Mon, 26 Jul 2021 15:56:08 +0800 Message-Id: <20210726075608.43981-2-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210726075608.43981-1-po-hsu.lin@canonical.com> References: <20210726075608.43981-1-po-hsu.lin@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1937991 This test will require /dev/rtc0, the default RTC device, or one specified by user to run. Since this default RTC is not guaranteed to exist on all of the devices, so check its existence first, otherwise skip this test with the kselftest skip code 4. Without this patch this test will fail like this on a s390x zVM: $ selftests: timers: rtcpie $ /dev/rtc0: No such file or directory not ok 1 selftests: timers: rtcpie # exit=22 With this patch: $ selftests: timers: rtcpie $ Default RTC /dev/rtc0 does not exist. Test Skipped! not ok 9 selftests: timers: rtcpie # SKIP Fixed up change log so "With this patch" text doesn't get dropped. Shuah Khan Signed-off-by: Po-Hsu Lin Signed-off-by: Shuah Khan (cherry picked from commit 0d3e5a057992bdc66e4dca2ca50b77fa4a7bd90e) Signed-off-by: Po-Hsu Lin Acked-by: Kleber Sacilotto de Souza --- tools/testing/selftests/timers/rtcpie.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/timers/rtcpie.c b/tools/testing/selftests/timers/rtcpie.c index 47b5bad..4ef2184 100644 --- a/tools/testing/selftests/timers/rtcpie.c +++ b/tools/testing/selftests/timers/rtcpie.c @@ -18,6 +18,8 @@ #include #include +#include "../kselftest.h" + /* * This expects the new RTC class driver framework, working with * clocks that will often not be clones of what the PC-AT had. @@ -35,8 +37,14 @@ int main(int argc, char **argv) switch (argc) { case 2: rtc = argv[1]; - /* FALLTHROUGH */ + break; case 1: + fd = open(default_rtc, O_RDONLY); + if (fd == -1) { + printf("Default RTC %s does not exist. Test Skipped!\n", default_rtc); + exit(KSFT_SKIP); + } + close(fd); break; default: fprintf(stderr, "usage: rtctest [rtcdev] [d]\n");