All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/3] Add tests for a group of real time clock ioctls
@ 2020-04-22 15:28 Filip Bozuta
  2020-04-22 15:28 ` [LTP] [PATCH 1/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC time Filip Bozuta
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Filip Bozuta @ 2020-04-22 15:28 UTC (permalink / raw)
  To: ltp


This series covers tests for following RTC ioctls:

    *RTC_RD_TIME    *RTC_UIE_ON
    *RTC_SET_TIME   *RTC_UIE_OFF
    *RTC_ALM_READ   *RTC_PIE_ON
    *RTC_ALM_SET    *RTC_PIE_OFF
    *RTC_AIE_ON     *RTC_WIE_ON
    *RTC_AIE_OFF    *RTC_WIE_OFF

The functionalities of individual ioctls were described in this series
patch commit messages.

The testing method for these ioctls is described in the upper comment
sections of test programs.

Filip Bozuta (3):
  testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read
    and set RTC time
  testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read
    and set RTC alarm time
  testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to turn
    on/off RTC interrupts

 runtest/syscalls                              |   4 +
 testcases/kernel/syscalls/ioctl/.gitignore    |   3 +
 testcases/kernel/syscalls/ioctl/ioctl_rtc01.c | 112 ++++++++++++++++++
 testcases/kernel/syscalls/ioctl/ioctl_rtc02.c | 107 +++++++++++++++++
 testcases/kernel/syscalls/ioctl/ioctl_rtc03.c |  88 ++++++++++++++
 5 files changed, 314 insertions(+)
 create mode 100644 testcases/kernel/syscalls/ioctl/ioctl_rtc01.c
 create mode 100644 testcases/kernel/syscalls/ioctl/ioctl_rtc02.c
 create mode 100644 testcases/kernel/syscalls/ioctl/ioctl_rtc03.c

-- 
2.17.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP] [PATCH 1/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC time
  2020-04-22 15:28 [LTP] [PATCH 0/3] Add tests for a group of real time clock ioctls Filip Bozuta
@ 2020-04-22 15:28 ` Filip Bozuta
  2020-04-23  5:57   ` [LTP] ?==?utf-8?q? ?==?utf-8?q? [PATCH 1/3]?==?utf-8?q? " Aleksandar Markovic
  2020-04-22 15:28 ` [LTP] [PATCH 2/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC alarm time Filip Bozuta
  2020-04-22 15:28 ` [LTP] [PATCH 3/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to turn on/off RTC interrupts Filip Bozuta
  2 siblings, 1 reply; 7+ messages in thread
From: Filip Bozuta @ 2020-04-22 15:28 UTC (permalink / raw)
  To: ltp


This patch tests functionalities of following ioctls:

RTC_RD_TIME - Getting RTC time

    Returns this RTC's time in the following structure:

        struct rtc_time {
            int tm_sec;
            int tm_min;
            int tm_hour;
            int tm_mday;
            int tm_mon;
            int tm_year;
            int tm_wday;     /* unused */
            int tm_yday;     /* unused */
            int tm_isdst;    /* unused */
        };

    The fields in this structure have the same meaning and
    ranges as the tm structure described in gmtime man page.
    A pointer to this structure should be passed as the third
    ioctl argument.

RTC_SET_TIME - Setting RTC time

    Sets this RTC's time to the time specified by the rtc_time
    structure pointed to by the third ioctl argument. To set the
    RTC's time the process must be privileged (i.e., have the
    CAP_SYS_TIME capability).

Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com>
---
 runtest/syscalls                              |   2 +
 testcases/kernel/syscalls/ioctl/.gitignore    |   1 +
 testcases/kernel/syscalls/ioctl/ioctl_rtc01.c | 112 ++++++++++++++++++
 3 files changed, 115 insertions(+)
 create mode 100644 testcases/kernel/syscalls/ioctl/ioctl_rtc01.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-testcases-kernel-syscalls-ioctl-Add-test-for-RTC-ioc.patch
Type: text/x-patch
Size: 4058 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200422/447e18cc/attachment-0001.bin>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP] [PATCH 2/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC alarm time
  2020-04-22 15:28 [LTP] [PATCH 0/3] Add tests for a group of real time clock ioctls Filip Bozuta
  2020-04-22 15:28 ` [LTP] [PATCH 1/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC time Filip Bozuta
@ 2020-04-22 15:28 ` Filip Bozuta
  2020-04-23  6:01   ` [LTP] ?==?utf-8?q? ?==?utf-8?q? [PATCH 2/3]?==?utf-8?q? " Aleksandar Markovic
  2020-04-22 15:28 ` [LTP] [PATCH 3/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to turn on/off RTC interrupts Filip Bozuta
  2 siblings, 1 reply; 7+ messages in thread
From: Filip Bozuta @ 2020-04-22 15:28 UTC (permalink / raw)
  To: ltp


This patch tests functionalities of following ioctls:

RTC_ALM_READ, RTC_ALM_SET - Getting/Setting alarm time

    Read and set the alarm time, for RTCs that support alarms.
    The alarm interrupt must be separately enabled or disabled
    using the RTC_AIE_ON, RTC_AIE_OFF requests. The third ioctl's
    argument is a pointer to a rtc_time structure. Only the tm_sec,
    tm_min, and tm_hour fields of this structure are used.

Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com>
---
 runtest/syscalls                              |   1 +
 testcases/kernel/syscalls/ioctl/.gitignore    |   1 +
 testcases/kernel/syscalls/ioctl/ioctl_rtc02.c | 107 ++++++++++++++++++
 3 files changed, 109 insertions(+)
 create mode 100644 testcases/kernel/syscalls/ioctl/ioctl_rtc02.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-testcases-kernel-syscalls-ioctl-Add-test-for-RTC-ioc.patch
Type: text/x-patch
Size: 3892 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200422/85ddb95b/attachment-0001.bin>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP] [PATCH 3/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to turn on/off RTC interrupts
  2020-04-22 15:28 [LTP] [PATCH 0/3] Add tests for a group of real time clock ioctls Filip Bozuta
  2020-04-22 15:28 ` [LTP] [PATCH 1/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC time Filip Bozuta
  2020-04-22 15:28 ` [LTP] [PATCH 2/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC alarm time Filip Bozuta
@ 2020-04-22 15:28 ` Filip Bozuta
  2020-04-23  5:43   ` [LTP] ?==?utf-8?q? ?==?utf-8?q? [PATCH 3/3]?==?utf-8?q? " Aleksandar Markovic
  2 siblings, 1 reply; 7+ messages in thread
From: Filip Bozuta @ 2020-04-22 15:28 UTC (permalink / raw)
  To: ltp


This patch tests functionalities of following ioctls:

RTC_AIE_ON, RTC_AIE_OFF - Alarm interrupt enabling on/off

    Enable or disable the alarm interrupt, for RTCs that support
    alarms.  The third ioctl's argument is ignored.

RTC_UIE_ON, RTC_UIE_OFF - Update interrupt enabling on/off

    Enable or disable the interrupt on every clock update, for
    RTCs that support this once-per-second interrupt. The third
    ioctl's argument is ignored.

RTC_PIE_ON, RTC_PIE_OFF - Periodic interrupt enabling on/off

    Enable or disable the periodic interrupt, for RTCs that sup?
    port these periodic interrupts. The third ioctl's argument
    is ignored. Only a privileged process (i.e., one having the
    CAP_SYS_RESOURCE capability) can enable the periodic interrupt
    if the frequency is currently set above the value specified in
    /proc/sys/dev/rtc/max-user-freq.

RTC_WIE_ON, RTC_WIE_OFF - Watchdog interrupt enabling on/off

    Enable or disable the Watchdog interrupt, for RTCs that sup-
    port this Watchdog interrupt. The third ioctl's argument is
    ignored.

Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com>
---
 runtest/syscalls                              |  1 +
 testcases/kernel/syscalls/ioctl/.gitignore    |  1 +
 testcases/kernel/syscalls/ioctl/ioctl_rtc03.c | 88 +++++++++++++++++++
 3 files changed, 90 insertions(+)
 create mode 100644 testcases/kernel/syscalls/ioctl/ioctl_rtc03.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-testcases-kernel-syscalls-ioctl-Add-test-for-RTC-ioc.patch
Type: text/x-patch
Size: 3101 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200422/ad87e1be/attachment-0001.bin>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP]  ?==?utf-8?q? ?==?utf-8?q? [PATCH 3/3]?==?utf-8?q? testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to turn on/off RTC interrupts
  2020-04-22 15:28 ` [LTP] [PATCH 3/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to turn on/off RTC interrupts Filip Bozuta
@ 2020-04-23  5:43   ` Aleksandar Markovic
  0 siblings, 0 replies; 7+ messages in thread
From: Aleksandar Markovic @ 2020-04-23  5:43 UTC (permalink / raw)
  To: ltp


I thinks these lines:

+static int interrupt_requests[] = {
+?? ?RTC_AIE_ON, RTC_PIE_ON, RTC_UIE_ON,
+?? ?RTC_WIE_ON, RTC_AIE_OFF, RTC_PIE_OFF,
+?? ?RTC_UIE_OFF, RTC_WIE_OFF};
+static char requests_text[][15] = {
+?? ?"RTC_AIE_ON", "RTC_PIE_ON", "RTC_UIE_ON",
+?? ?"RTC_WIE_ON", "RTC_AIE_OFF", "RTC_PIE_OFF",
+?? ?"RTC_UIE_OFF", "RTC_WIE_OFF"};

would look much clearer as:

static int interrupt_requests[] = {
????RTC_AIE_ON,? RTC_PIE_ON,? RTC_UIE_ON,? RTC_WIE_ON,
????RTC_AIE_OFF, RTC_PIE_OFF, RTC_UIE_OFF, RTC_WIE_OFF};
static char requests_text[][15] = {
????"RTC_AIE_ON",? "RTC_PIE_ON",? "RTC_UIE_ON",? "RTC_WIE_ON",
??? "RTC_AIE_OFF", "RTC_PIE_OFF", "RTC_UIE_OFF", "RTC_WIE_OFF"};

Thanks, Aleksandar

P. S. (my email client doesn't handle tabs well (converts them to spaces) - ofcourse, you keep tabs, I em not suggesting replacing them with space)


-------- Original Message --------
Subject: [LTP] [PATCH 3/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to turn on/off RTC interrupts
Date: Wednesday, April 22, 2020 17:28 CEST
From: Filip Bozuta <fbozuta1@gmail.com>
To: ltp@lists.linux.it
CC: pvorel@suse.cz, Aleksandar.Markovic@rt-rk.com, laurent@vivier.eu
References: <20200422152841.13432-1-fbozuta1@gmail.com>


?
This patch tests functionalities of following ioctls:

RTC_AIE_ON, RTC_AIE_OFF - Alarm interrupt enabling on/off

Enable or disable the alarm interrupt, for RTCs that support
alarms. The third ioctl's argument is ignored.

RTC_UIE_ON, RTC_UIE_OFF - Update interrupt enabling on/off

Enable or disable the interrupt on every clock update, for
RTCs that support this once-per-second interrupt. The third
ioctl's argument is ignored.

RTC_PIE_ON, RTC_PIE_OFF - Periodic interrupt enabling on/off

Enable or disable the periodic interrupt, for RTCs that sup?
port these periodic interrupts. The third ioctl's argument
is ignored. Only a privileged process (i.e., one having the
CAP_SYS_RESOURCE capability) can enable the periodic interrupt
if the frequency is currently set above the value specified in
/proc/sys/dev/rtc/max-user-freq.

RTC_WIE_ON, RTC_WIE_OFF - Watchdog interrupt enabling on/off

Enable or disable the Watchdog interrupt, for RTCs that sup-
port this Watchdog interrupt. The third ioctl's argument is
ignored.

Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com>
---
runtest/syscalls | 1 +
testcases/kernel/syscalls/ioctl/.gitignore | 1 +
testcases/kernel/syscalls/ioctl/ioctl_rtc03.c | 88 +++++++++++++++++++
3 files changed, 90 insertions(+)
create mode 100644 testcases/kernel/syscalls/ioctl/ioctl_rtc03.c
?


?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200423/b441dea2/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP]  ?==?utf-8?q? ?==?utf-8?q? [PATCH 1/3]?==?utf-8?q? testcases/kernel/syscalls/ioctl:  Add test for RTC ioctls used to read and set RTC time
  2020-04-22 15:28 ` [LTP] [PATCH 1/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC time Filip Bozuta
@ 2020-04-23  5:57   ` Aleksandar Markovic
  0 siblings, 0 replies; 7+ messages in thread
From: Aleksandar Markovic @ 2020-04-23  5:57 UTC (permalink / raw)
  To: ltp


Hi, Filip.

This is a very unclear way to set the structure elements:

+?? ?struct rtc_time rtc_set_time = {0, 15, 13, 26, 8, 119, 0, 0, 0};

Simple setting structure elements separately would be much better.

Also, why do you use such numbers: 15, 13,...? Is it just a random choice?

Thanks,
Aleksandar

-------- Original Message --------
Subject: [LTP] [PATCH 1/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC time
Date: Wednesday, April 22, 2020 17:28 CEST
From: Filip Bozuta <fbozuta1@gmail.com>
To: ltp@lists.linux.it
CC: pvorel@suse.cz, Aleksandar.Markovic@rt-rk.com, laurent@vivier.eu
References: <20200422152841.13432-1-fbozuta1@gmail.com>


?
This patch tests functionalities of following ioctls:

RTC_RD_TIME - Getting RTC time

Returns this RTC's time in the following structure:

struct rtc_time {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday; /* unused */
int tm_yday; /* unused */
int tm_isdst; /* unused */
};

The fields in this structure have the same meaning and
ranges as the tm structure described in gmtime man page.
A pointer to this structure should be passed as the third
ioctl argument.

RTC_SET_TIME - Setting RTC time

Sets this RTC's time to the time specified by the rtc_time
structure pointed to by the third ioctl argument. To set the
RTC's time the process must be privileged (i.e., have the
CAP_SYS_TIME capability).

Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com>
---
runtest/syscalls | 2 +
testcases/kernel/syscalls/ioctl/.gitignore | 1 +
testcases/kernel/syscalls/ioctl/ioctl_rtc01.c | 112 ++++++++++++++++++
3 files changed, 115 insertions(+)
create mode 100644 testcases/kernel/syscalls/ioctl/ioctl_rtc01.c
?


?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200423/538ecbb6/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP]  ?==?utf-8?q? ?==?utf-8?q? [PATCH 2/3]?==?utf-8?q? testcases/kernel/syscalls/ioctl:  Add test for RTC ioctls used to read and set RTC alarm time
  2020-04-22 15:28 ` [LTP] [PATCH 2/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC alarm time Filip Bozuta
@ 2020-04-23  6:01   ` Aleksandar Markovic
  0 siblings, 0 replies; 7+ messages in thread
From: Aleksandar Markovic @ 2020-04-23  6:01 UTC (permalink / raw)
  To: ltp


Similar to the situation in patch 1, you wrote:

+?? ?struct rtc_time rtc_set_alarm = {13, 35, 12};

In my opinion, this way of setting structure should be avoided.

Thanks,
Aleksandar

-------- Original Message --------
Subject: [LTP] [PATCH 2/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC alarm time
Date: Wednesday, April 22, 2020 17:28 CEST
From: Filip Bozuta <fbozuta1@gmail.com>
To: ltp@lists.linux.it
CC: pvorel@suse.cz, Aleksandar.Markovic@rt-rk.com, laurent@vivier.eu
References: <20200422152841.13432-1-fbozuta1@gmail.com>


?
This patch tests functionalities of following ioctls:

RTC_ALM_READ, RTC_ALM_SET - Getting/Setting alarm time

Read and set the alarm time, for RTCs that support alarms.
The alarm interrupt must be separately enabled or disabled
using the RTC_AIE_ON, RTC_AIE_OFF requests. The third ioctl's
argument is a pointer to a rtc_time structure. Only the tm_sec,
tm_min, and tm_hour fields of this structure are used.

Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com>
---
runtest/syscalls | 1 +
testcases/kernel/syscalls/ioctl/.gitignore | 1 +
testcases/kernel/syscalls/ioctl/ioctl_rtc02.c | 107 ++++++++++++++++++
3 files changed, 109 insertions(+)
create mode 100644 testcases/kernel/syscalls/ioctl/ioctl_rtc02.c
?


?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200423/aabefe16/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-23  6:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22 15:28 [LTP] [PATCH 0/3] Add tests for a group of real time clock ioctls Filip Bozuta
2020-04-22 15:28 ` [LTP] [PATCH 1/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC time Filip Bozuta
2020-04-23  5:57   ` [LTP] ?==?utf-8?q? ?==?utf-8?q? [PATCH 1/3]?==?utf-8?q? " Aleksandar Markovic
2020-04-22 15:28 ` [LTP] [PATCH 2/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC alarm time Filip Bozuta
2020-04-23  6:01   ` [LTP] ?==?utf-8?q? ?==?utf-8?q? [PATCH 2/3]?==?utf-8?q? " Aleksandar Markovic
2020-04-22 15:28 ` [LTP] [PATCH 3/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to turn on/off RTC interrupts Filip Bozuta
2020-04-23  5:43   ` [LTP] ?==?utf-8?q? ?==?utf-8?q? [PATCH 3/3]?==?utf-8?q? " Aleksandar Markovic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.