Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp266154rwb; Thu, 10 Nov 2022 00:03:57 -0800 (PST) X-Google-Smtp-Source: AMsMyM7AWLz+waz67W+uVGFgSzk/8h6+jtjZBQXVnfGjcqfJGstbvbB/mA6fIuR9SdTG/rKjKRis X-Received: by 2002:a17:907:6744:b0:782:fd8e:9298 with SMTP id qm4-20020a170907674400b00782fd8e9298mr2427165ejc.640.1668067437035; Thu, 10 Nov 2022 00:03:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668067437; cv=none; d=google.com; s=arc-20160816; b=MAs0uUXEAXZlvLD2PnRiPy+gpU4Kt96qSf96gdf3Fjm9jW9GcOYj0wBep3WXCtrMBe ydEMiP74cUt3TSMC2P2mgT2kSL5nhKbI3HMVRQ/LEnsHPhhqRjBV31FCR7THSZvMVady Bn6suwLBjM9A6H07Bwtg0vVjqZKLEGK5jsxGH7FGPC5Y6yeBtcm3k3uUU4sy44vYXz+H qfxr/RlIUwm8Zij8UwktpNQt03k0JnAwRN3j0ymCRLKZ3stKI4p5vEoW/bMjI67ukS17 2lYOlNYaPNbj2pQe1yOs0NpXbvBhgPYEQ1yd8eLZY5NzckHD2r+p7Zrcz22ttWlVBw/v PcWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2n116yHqsHx3GXDFBWj4GPvIYmNiRVCPoPYr5g3rrak=; b=w0cR1lTOE3V7VYhxMJW8jDSHcEgOo9olICoeDBDykTEJkDuVg6B9hrFyGw1YB7g0NH 956aSJaq2lnJt0A1yOA575sJ5aH3c3QumXS2Y1n7ZR4H7YHJS1guKcQdzvtqBSLa9Fra T5EMxdJkTqqXs0N6hPoF5pjeZUOu8MCZw96Fg1YW7vHn2cjMmwK3Zedw+9nlLrGqLRkj +hpCHwKlIlUHcC+9giRCNrqAcZQiFGpg6ivQPXrxhzkiJqmc75MDJ8Q4k/SOa/fDvXj/ d4SJ7veim+FxDIhvcO9cmUOTYlIGMdQmGhZ8LtnRzGdn14XlbISanBvk3gZLGoJOyRKk HiRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gYQsWdVO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a056402170800b0046453c36c69si14960998edu.68.2022.11.10.00.03.31; Thu, 10 Nov 2022 00:03:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gYQsWdVO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232585AbiKJHjf (ORCPT + 92 others); Thu, 10 Nov 2022 02:39:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232590AbiKJHj1 (ORCPT ); Thu, 10 Nov 2022 02:39:27 -0500 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31B82E04 for ; Wed, 9 Nov 2022 23:39:26 -0800 (PST) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-370547b8ca0so8575567b3.0 for ; Wed, 09 Nov 2022 23:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2n116yHqsHx3GXDFBWj4GPvIYmNiRVCPoPYr5g3rrak=; b=gYQsWdVOo9NH7cYp9EJkoemWayrJHXiS/a3isVMQa4fPDIoXQZuZRuzpPrbQhMsSDB HNxHv2cx1GuGINBMy5EPOrByy5dPmJmbiO2QkkV1+PznHFuyXGyfd06C6t5jHBhbLYai z5fiRGk3BmddUg8Q17lB46PmNJwHiS2yC/iqgaJY+JWa+0LlxjEBQdEi38oat8wgKXCB +FIgIC2csbm6vi7/NUz6uHlCFRUjbKXfyMsLeeJuhCjtfPmUWdRWG+/WBvNz/OjIMyGW sphblqWlJqR0nXAY1R6ClBnbX3AsiLdX+/Jy3BN2K2ZtXI9avMHrh4L6loZZDcUjUHb1 I8/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2n116yHqsHx3GXDFBWj4GPvIYmNiRVCPoPYr5g3rrak=; b=f/CNyq2lkCxHHfLtGStKwwfVQ2lc+JKQl/qKGdlIxrBAmr1qE6XA8VlUMnPcrvGcr8 csETBhySFcPOht7PIVxgb52mXf7PD92DSSXiKx/c1hmtjGLgyGwLNzKl9DnfcQMFyo6k bpss0R6Hja9LUKz8ofsYFR1DM1yB7bwEqi4Ivzxm5M/MCgx5MFKNEnr0MEq0wC+dgFjY x2edUkrtnkBV8AUJho7Tp+UhEZAt7nRL4mw7yzKMxq8SNlOD9pzwBRFzh4fWL/KUjApt JIoLZJJcHbuWy9bqgeK0VxSYQjcZAg/pSZD4HvocHWFK6vjBXNoZE25E3BR4D7b2/uPv CUdg== X-Gm-Message-State: ACrzQf0lWNmUBH00JD2asi8QFfgLDaVV3ul80teWMXI/3TCwJNthicmO PGPyTngaBH0s0MqaTd4QnnDG+T7pW8E8txCLFuCrog== X-Received: by 2002:a05:690c:802:b0:36b:adba:8ff with SMTP id bx2-20020a05690c080200b0036badba08ffmr57582518ywb.237.1668065965190; Wed, 09 Nov 2022 23:39:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Naresh Kamboju Date: Thu, 10 Nov 2022 13:09:09 +0530 Message-ID: Subject: Re: kselftest rtctests failed on arm64 Raspberry Pi 4 - rtctest.c:34:date_read:Expected -1 (-1) != self->fd (-1) To: Alexandre Belloni Cc: "open list:KERNEL SELFTEST FRAMEWORK" , open list , lkft-triage@lists.linaro.org, Shuah Khan , =?UTF-8?Q?Mateusz_Jo=C5=84czyk?= , Alessandro Zummo , =?UTF-8?B?RGFuaWVsIETDrWF6?= Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre, On Wed, 9 Nov 2022 at 03:05, Alexandre Belloni wrote: > > Hello, > > On 08/11/2022 15:17:04+0530, Naresh Kamboju wrote: > > kselftest rtctests failed on arm64 Raspberry Pi 4 Model B device and > > passed on other devices and qemu emulators. Please refer to the > > full logs and test comparison results links. > > > > It seems your board doesn't have an rtc at all, the tests will not run > unless you add one. > > You can try the following patch: Daniel Diaz tested the following patch and results were changed from FAIL to SKIP [1]. Reported-by: Linux Kernel Functional Testing Tested-by: Daniel Diaz [ 241.791361] kselftest: Running tests in rtc TAP version 13 1..1 # selftests: rtc: rtctest # TAP version 13 # 1..8 # # Starting 8 tests from 2 test cases. # # RUN rtc.date_read ... # # SKIP Skipping test since /dev/rtc0 does not exist # # OK rtc.date_read # ok 1 # SKIP Skipping test since /dev/rtc0 does not exist # # RUN rtc.date_read_loop ... # # SKIP Skipping test since /dev/rtc0 does not exist # # OK rtc.date_read_loop # ok 2 # SKIP Skipping test since /dev/rtc0 does not exist # # RUN rtc.uie_read ... # # SKIP Skipping test since /dev/rtc0 does not exist # # OK rtc.uie_read # ok 3 # SKIP Skipping test since /dev/rtc0 does not exist # # RUN rtc.uie_select ... # # SKIP Skipping test since /dev/rtc0 does not exist # # OK rtc.uie_select # ok 4 # SKIP Skipping test since /dev/rtc0 does not exist # # RUN rtc.alarm_alm_set ... # # SKIP Skipping test since /dev/rtc0 does not exist # # OK rtc.alarm_alm_set # ok 5 # SKIP Skipping test since /dev/rtc0 does not exist # # RUN rtc.alarm_wkalm_set ... # # SKIP Skipping test since /dev/rtc0 does not exist # # OK rtc.alarm_wkalm_set # ok 6 # SKIP Skipping test since /dev/rtc0 does not exist # # RUN rtc.alarm_alm_set_minute ... # # SKIP Skipping test since /dev/rtc0 does not exist # # OK rtc.alarm_alm_set_minute # ok 7 # SKIP Skipping test since /dev/rtc0 does not exist # # RUN rtc.alarm_wkalm_set_minute ... # # SKIP Skipping test since /dev/rtc0 does not exist # # OK rtc.alarm_wkalm_set_minute # ok 8 # SKIP Skipping test since /dev/rtc0 does not exist # # PASSED: 8 / 8 tests passed. # # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:8 error:0 ok 1 selftests: rtc: rtctest > > From e93ddc7046aba97b39b0ceffc53ebf1f10ad9868 Mon Sep 17 00:00:00 2001 > From: Alexandre Belloni > Date: Tue, 8 Nov 2022 22:18:55 +0100 > Subject: [PATCH] selftests: rtc: skip when RTC is not present > > There is not point in failing the tests when there the RTC is not present, > simply skip the test. > > Signed-off-by: Alexandre Belloni > --- > tools/testing/selftests/rtc/rtctest.c | 33 ++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c > index 2b9d929a24ed..63ce02d1d5cc 100644 > --- a/tools/testing/selftests/rtc/rtctest.c > +++ b/tools/testing/selftests/rtc/rtctest.c > @@ -31,7 +31,6 @@ FIXTURE(rtc) { > > FIXTURE_SETUP(rtc) { > self->fd = open(rtc_file, O_RDONLY); > - ASSERT_NE(-1, self->fd); > } > > FIXTURE_TEARDOWN(rtc) { > @@ -42,6 +41,10 @@ TEST_F(rtc, date_read) { > int rc; > struct rtc_time rtc_tm; > > + if (self->fd == -1 && errno == ENOENT) > + SKIP(return, "Skipping test since %s does not exist", rtc_file); > + ASSERT_NE(-1, self->fd); > + > /* Read the RTC time/date */ > rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm); > ASSERT_NE(-1, rc); > @@ -85,6 +88,10 @@ TEST_F_TIMEOUT(rtc, date_read_loop, READ_LOOP_DURATION_SEC + 2) { > struct rtc_time rtc_tm; > time_t start_rtc_read, prev_rtc_read; > > + if (self->fd == -1 && errno == ENOENT) > + SKIP(return, "Skipping test since %s does not exist", rtc_file); > + ASSERT_NE(-1, self->fd); > + > TH_LOG("Continuously reading RTC time for %ds (with %dms breaks after every read).", > READ_LOOP_DURATION_SEC, READ_LOOP_SLEEP_MS); > > @@ -119,6 +126,10 @@ TEST_F_TIMEOUT(rtc, uie_read, NUM_UIE + 2) { > int i, rc, irq = 0; > unsigned long data; > > + if (self->fd == -1 && errno == ENOENT) > + SKIP(return, "Skipping test since %s does not exist", rtc_file); > + ASSERT_NE(-1, self->fd); > + > /* Turn on update interrupts */ > rc = ioctl(self->fd, RTC_UIE_ON, 0); > if (rc == -1) { > @@ -144,6 +155,10 @@ TEST_F(rtc, uie_select) { > int i, rc, irq = 0; > unsigned long data; > > + if (self->fd == -1 && errno == ENOENT) > + SKIP(return, "Skipping test since %s does not exist", rtc_file); > + ASSERT_NE(-1, self->fd); > + > /* Turn on update interrupts */ > rc = ioctl(self->fd, RTC_UIE_ON, 0); > if (rc == -1) { > @@ -183,6 +198,10 @@ TEST_F(rtc, alarm_alm_set) { > time_t secs, new; > int rc; > > + if (self->fd == -1 && errno == ENOENT) > + SKIP(return, "Skipping test since %s does not exist", rtc_file); > + ASSERT_NE(-1, self->fd); > + > rc = ioctl(self->fd, RTC_RD_TIME, &tm); > ASSERT_NE(-1, rc); > > @@ -237,6 +256,10 @@ TEST_F(rtc, alarm_wkalm_set) { > time_t secs, new; > int rc; > > + if (self->fd == -1 && errno == ENOENT) > + SKIP(return, "Skipping test since %s does not exist", rtc_file); > + ASSERT_NE(-1, self->fd); > + > rc = ioctl(self->fd, RTC_RD_TIME, &alarm.time); > ASSERT_NE(-1, rc); > > @@ -285,6 +308,10 @@ TEST_F_TIMEOUT(rtc, alarm_alm_set_minute, 65) { > time_t secs, new; > int rc; > > + if (self->fd == -1 && errno == ENOENT) > + SKIP(return, "Skipping test since %s does not exist", rtc_file); > + ASSERT_NE(-1, self->fd); > + > rc = ioctl(self->fd, RTC_RD_TIME, &tm); > ASSERT_NE(-1, rc); > > @@ -339,6 +366,10 @@ TEST_F_TIMEOUT(rtc, alarm_wkalm_set_minute, 65) { > time_t secs, new; > int rc; > > + if (self->fd == -1 && errno == ENOENT) > + SKIP(return, "Skipping test since %s does not exist", rtc_file); > + ASSERT_NE(-1, self->fd); > + > rc = ioctl(self->fd, RTC_RD_TIME, &alarm.time); > ASSERT_NE(-1, rc); [1] https://lkft.validation.linaro.org/scheduler/job/5831980#L1760 -- Linaro LKFT https://lkft.linaro.org