Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7886042rwp; Wed, 19 Jul 2023 01:39:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlH0kIyQ3AMmg437/9HHQSdjhc0hhoblbtQVB9etm4m7RmRol2j6HVvr97dPX00OaR8rL0qR X-Received: by 2002:a17:906:2c9:b0:987:6372:c31f with SMTP id 9-20020a17090602c900b009876372c31fmr1707682ejk.37.1689755943099; Wed, 19 Jul 2023 01:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689755943; cv=none; d=google.com; s=arc-20160816; b=WjefJAxt4q0DvDnBgYKRdplk+R7ISu4XEYVWNA/9T76fnJEWQG5480fLyzfCQlcc7c vPfmw0HVExKh41vLh7SFj8LY6dSqR56zOroPLaBMiQ59JC6z6wAMlIgOGpiHXA6ddFue Uw5AvR7u3B6+2J9T8/GwMxMisevwxmUK22EcQ8FdDdba12dQaLNRAcJwgHXjPvf2BASd lHdwv7782f3L89DP+eTj3M7wXbekiuAoArSqpHU/ug06Tdo0L6jHPw9H3PVJ8g4R+Vy7 2oAdtsTtXIU9p1t3CkaofvoU3cEIsFfBOH+djeojaFMUZ0Xi2ffnPPcgECRvO6ezPR+9 ZxJw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=zD3UEKBWOcid7vW1ZcdBVv5pq+DD5Ikq9fhBF2xLfgw=; fh=m0eTdPw2R8NKDwnRyYntko0SO3QzNXxyyQqidfPZUmk=; b=cqyGzHTk9Pt83/zWx2NU02cMOqrW087cs+u3LWvOdHK8sBq3SKx1n4vPeomLgx4IfU AGypnoOkeVmeHDyokx1TT33u+/P8BlaT8jE0/nsa2H2IAVaVGAZfLxDYFvYsIOzsdcek vNCMbVvDe/nCArIDO0ZCkiLNXmrtL78QBWM7YOct/twa/GyMrEI593hx9JFv7TM5G7nJ xkRbHZtz+UO3ovr7sdtvUqQSnoGHbHmTI7O0Va1TxfQGmLdsREKN+qXyMgsUW94vliPa TXms6wwJkmdql+NP00HKuttscwjcg/x2Qji5Rhm9c2gFBacQCHtI9Q0XYOTXRId4sAS4 YGdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cP7IpKjM; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020a170906280700b00993b3881ed2si2386387ejc.686.2023.07.19.01.38.38; Wed, 19 Jul 2023 01:39:03 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=cP7IpKjM; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbjGSIbO (ORCPT + 99 others); Wed, 19 Jul 2023 04:31:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbjGSIbM (ORCPT ); Wed, 19 Jul 2023 04:31:12 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CEBB1724 for ; Wed, 19 Jul 2023 01:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689755424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=zD3UEKBWOcid7vW1ZcdBVv5pq+DD5Ikq9fhBF2xLfgw=; b=cP7IpKjMkqcAStVlt1abeOrsbMML7AypAHDZvws4Rc08XmTcafh+3JmNHbEQAGvP9KlxMf YvNNA9AZN4T1Az7pYA2lGhPfyMxLthvxRZMc0lvNffQFG7e9DjWaKmlH9j/1c0MyemLE4X MZOSLz0SVd1rbY9H6xn4OXguVGdfomM= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-412-O0FBTxn0NQylKXNoi0dxhg-1; Wed, 19 Jul 2023 04:30:23 -0400 X-MC-Unique: O0FBTxn0NQylKXNoi0dxhg-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7681da13a3fso418906085a.1 for ; Wed, 19 Jul 2023 01:30:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689755423; x=1690360223; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zD3UEKBWOcid7vW1ZcdBVv5pq+DD5Ikq9fhBF2xLfgw=; b=Tc5sFljLTgQe1QicKq7nY9IOd+OsVFedo1vwWXxKrXA3rnvkyuMqyu5oevsf5vWo6v 6XLOhLmkf4f3juP3+iTe4fqcybH5zVmxSDC4fZ4q4/aVXa6WItd0coJhFq4DSk8Pdtgl 6Fp2R4bkKTJZN2kd1HabTKsi8/ABUcxkGCgD1W2K7ttq2dvxlcjf2EF3solCpd0FSnMA 0CIpxWVRdum25mR23IOF4JI6riNuyspi4n2DqmrwgtoX9I1zjtvxx8A+g4G4suioROmY IqaFJl+BNoA8nEe/2GaWAOKHV5kYcfvMQg521s4WYCRWOxu7fF/yCqUuI7wGEmo/0zUf 9n8g== X-Gm-Message-State: ABy/qLZyynXiIihIeVAz0yBhRO0CrzCZVGmvKPQINOXIHzLamvo5ffE9 gt3zv8dWeSJmpu/92OjFIGrfmq+BlqaU34jJs1CTZVBYpI9zfYtNA4mh+SQli+Dy09IdrZw12m1 2ymnM0o2kcwmYiThC3VIwzSLq X-Received: by 2002:a05:620a:2b84:b0:767:3efd:59f5 with SMTP id dz4-20020a05620a2b8400b007673efd59f5mr2324593qkb.17.1689755422947; Wed, 19 Jul 2023 01:30:22 -0700 (PDT) X-Received: by 2002:a05:620a:2b84:b0:767:3efd:59f5 with SMTP id dz4-20020a05620a2b8400b007673efd59f5mr2324560qkb.17.1689755422654; Wed, 19 Jul 2023 01:30:22 -0700 (PDT) Received: from fedora.redhat.com ([2a06:c701:4b84:700:e5a3:9a79:b307:264a]) by smtp.gmail.com with ESMTPSA id t11-20020a0cb38b000000b00632191a70aesm1305450qve.88.2023.07.19.01.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 01:30:21 -0700 (PDT) From: Dana Elfassy To: shuah@kernel.org, usama.anjum@collabora.com, eballetbo@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dana Elfassy , Dana Elfassy , Enric Balletbo Serra , Shuah Khan Subject: [PATCH v3] selftests/input: add tests for the EVIOCSCLOCKID ioctl Date: Wed, 19 Jul 2023 11:30:03 +0300 Message-ID: <20230719083003.1562415-1-delfassy@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Dana Elfassy This patch introduces tests for the EVIOCSCLOCKID ioctl, for full coverage of the different clkids Signed-off-by: Dana Elfassy Reviewed-by: Enric Balletbo Serra Reviewed-by: Shuah Khan --- Changes in v3: - Modified signed-off-by email - Added Reviewed-by tag Changes in v2: - Replaced clkids numerical values with their equivalent definition This patch depends on '[v3] selftests/input: Introduce basic tests for evdev ioctls' [1] sent to the ML. [1] https://patchwork.kernel.org/project/linux-input/patch/20230607153214.15933-1-eballetbo@kernel.org/ tools/testing/selftests/input/evioc-test.c | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tools/testing/selftests/input/evioc-test.c b/tools/testing/selftests/input/evioc-test.c index ad7b93fe39cf..83ce1a3c9b84 100644 --- a/tools/testing/selftests/input/evioc-test.c +++ b/tools/testing/selftests/input/evioc-test.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "../kselftest_harness.h" @@ -234,4 +235,33 @@ TEST(eviocsrep_set_repeat_settings) selftest_uinput_destroy(uidev); } +TEST(eviocsclockid_set_clockid) +{ + struct selftest_uinput *uidev; + int clkid = CLOCK_REALTIME; + int rc; + + rc = selftest_uinput_create_device(&uidev, -1); + ASSERT_EQ(0, rc); + ASSERT_NE(NULL, uidev); + + rc = ioctl(uidev->evdev_fd, EVIOCSCLOCKID, &clkid); + ASSERT_EQ(0, rc); + + clkid = CLOCK_MONOTONIC; + rc = ioctl(uidev->evdev_fd, EVIOCSCLOCKID, &clkid); + ASSERT_EQ(0, rc); + + clkid = CLOCK_BOOTTIME; + rc = ioctl(uidev->evdev_fd, EVIOCSCLOCKID, &clkid); + ASSERT_EQ(0, rc); + + // case default + clkid = -1; + rc = ioctl(uidev->evdev_fd, EVIOCSCLOCKID, &clkid); + ASSERT_EQ(-1, rc); + + selftest_uinput_destroy(uidev); +} + TEST_HARNESS_MAIN -- 2.41.0