1f08c3bdfSopenharmony_ciThis document defines the plan for functional testing of POSIX Clocks
2f08c3bdfSopenharmony_ciand Timers.
3f08c3bdfSopenharmony_ci
4f08c3bdfSopenharmony_ciFirst a list of the features that will and will not be tested is given.
5f08c3bdfSopenharmony_ci
6f08c3bdfSopenharmony_ciThen, an attempt is made to break down the features into possible testing
7f08c3bdfSopenharmony_ciscenarios.  Not all of these may be implemented.  The assertions.xml file
8f08c3bdfSopenharmony_ciwill have the additional detail on which were chosen for implementation.
9f08c3bdfSopenharmony_ci
10f08c3bdfSopenharmony_ciFeatures To Be Tested
11f08c3bdfSopenharmony_ci=====================
12f08c3bdfSopenharmony_ciThe following features will be tested:
13f08c3bdfSopenharmony_ciclocks - Testing that clocks can accurately keep time in certain scenarios.
14f08c3bdfSopenharmony_cisleep  - Testing that processes can go to sleep for specified periods of time.
15f08c3bdfSopenharmony_citimers - The following types of timers will be tested.
16f08c3bdfSopenharmony_ci         absolute timer, no repeat	think:  alarm clock
17f08c3bdfSopenharmony_ci         relative timer, no repeat	think:  stopwatch
18f08c3bdfSopenharmony_ci         absolute timer, repeats	think:  grandfather clock
19f08c3bdfSopenharmony_ci         relative timer, repeats	think:  repeating stopwatch
20f08c3bdfSopenharmony_ci         Also, timer overruns will be counted.
21f08c3bdfSopenharmony_ci
22f08c3bdfSopenharmony_ciFeatures Not To Be Tested
23f08c3bdfSopenharmony_ci=========================
24f08c3bdfSopenharmony_ciAPI testing of the clocks/timers functions is considered to be done by
25f08c3bdfSopenharmony_cithe conformance section.
26f08c3bdfSopenharmony_ciLoad and other stress testing will be done in the stress section.
27f08c3bdfSopenharmony_ciA few error handling tests will be created, but the majority will not for
28f08c3bdfSopenharmony_cithis initial release.  (Over time, these may be added from regression
29f08c3bdfSopenharmony_citests, or regression tests may suggest additional error handling tests to
30f08c3bdfSopenharmony_cicreate.)
31f08c3bdfSopenharmony_ci
32f08c3bdfSopenharmony_ciApproach
33f08c3bdfSopenharmony_ci========
34f08c3bdfSopenharmony_ciIn order to generate the test cases listed below, the following approaches
35f08c3bdfSopenharmony_ciwere taken:
36f08c3bdfSopenharmony_ci- If it was not covered in the conformance area fully, determined the
37f08c3bdfSopenharmony_ci  correct behavior of the features listed above and generated test scenarios
38f08c3bdfSopenharmony_ci  to verify this behavior happened.
39f08c3bdfSopenharmony_ci- Determined certain critical values that may cause failures to appear and
40f08c3bdfSopenharmony_ci  generated test scenarios setting clocks or timers to these critical
41f08c3bdfSopenharmony_ci  values.
42f08c3bdfSopenharmony_ci- Determined race conditions that could appear or time dependencies for
43f08c3bdfSopenharmony_ci  things happening and generated test cases to expose these issues.
44f08c3bdfSopenharmony_ci
45f08c3bdfSopenharmony_ciTest Case Scenarios
46f08c3bdfSopenharmony_ci===================
47f08c3bdfSopenharmony_ciSome potential test case scenarios are listed after each functional
48f08c3bdfSopenharmony_ciarea.
49f08c3bdfSopenharmony_ci
50f08c3bdfSopenharmony_ciClocks
51f08c3bdfSopenharmony_ci------
52f08c3bdfSopenharmony_ci- Set clock time to: 0, a large number, all the dates that were
53f08c3bdfSopenharmony_ci  critical for Y2K testing, set to time before daylight savings (and then
54f08c3bdfSopenharmony_ci  after daylight savings). ==> This is probably multiple test cases.
55f08c3bdfSopenharmony_ci- Call clock_gettime() mulitple times and ensure the time is always
56f08c3bdfSopenharmony_ci  increasing (call also at nsec increments to ensure both nsec and sec
57f08c3bdfSopenharmony_ci  are always increasing).
58f08c3bdfSopenharmony_ci- Ensure we can tell time within acceptable jitter (over some period of time).
59f08c3bdfSopenharmony_ci  - Test for a few different clocks.
60f08c3bdfSopenharmony_ci  - Test after setting the time.
61f08c3bdfSopenharmony_ci- Send a signal while setting the time.
62f08c3bdfSopenharmony_ci- Kill the process (example of previous with SIGKILL) when setting the time.
63f08c3bdfSopenharmony_ci- Have a timer expire when setting the time.
64f08c3bdfSopenharmony_ci- Set the time from two different processes.
65f08c3bdfSopenharmony_ci
66f08c3bdfSopenharmony_ciSleep
67f08c3bdfSopenharmony_ci-----
68f08c3bdfSopenharmony_ci- Mimic the non-repeating timers tests as they apply to sleep.
69f08c3bdfSopenharmony_ci
70f08c3bdfSopenharmony_ciTimers
71f08c3bdfSopenharmony_ci------
72f08c3bdfSopenharmony_ci Non-repeating (relative and absolute)
73f08c3bdfSopenharmony_ci - Set timer expiration to: 0, a large number, all the dates that were
74f08c3bdfSopenharmony_ci   critical for Y2K testing, set to time before daylight savings (and then
75f08c3bdfSopenharmony_ci   after daylight savings). ==> This is probably multiple test cases.  Some
76f08c3bdfSopenharmony_ci   are absolute timers only.
77f08c3bdfSopenharmony_ci - Have the clock change underneath a timer and ensure it expires
78f08c3bdfSopenharmony_ci   correctly.
79f08c3bdfSopenharmony_ci - [Relative only] Set up multiple timers to expire after the same duration
80f08c3bdfSopenharmony_ci   and ensure they expire in the order set up.  (May need to nanosleep
81f08c3bdfSopenharmony_ci   for CLOCKRES nanoseconds in between set ups to get correct results.  Also,
82f08c3bdfSopenharmony_ci   even if this fails, not necessarily a "bug" since many factors influence
83f08c3bdfSopenharmony_ci   expiration time.)
84f08c3bdfSopenharmony_ci - Test out all the various events that can be sent for a timer expiration.
85f08c3bdfSopenharmony_ci - Set two timers to expire at the same time, different events, in the
86f08c3bdfSopenharmony_ci   same process.
87f08c3bdfSopenharmony_ci - Set up two timers to expire for the same time in two different processes.
88f08c3bdfSopenharmony_ci - Set up one repeating timer to expire after X time and one non-repeating
89f08c3bdfSopenharmony_ci   to expire after 2*X time.
90f08c3bdfSopenharmony_ci
91f08c3bdfSopenharmony_ci Repeating (relative and absolute)
92f08c3bdfSopenharmony_ci - Perform all non-repeating timer tests on repeating timers.
93f08c3bdfSopenharmony_ci - Ensure that these are still going off at the same time, over time.
94f08c3bdfSopenharmony_ci
95f08c3bdfSopenharmony_ci Overruns
96f08c3bdfSopenharmony_ci - Have multiple timers in a process blocked and ensure overrun count
97f08c3bdfSopenharmony_ci   for each is correct.
98f08c3bdfSopenharmony_ci - Have a repeating timer blocked for a period of time and ensure overrun
99f08c3bdfSopenharmony_ci   count is correct.
100f08c3bdfSopenharmony_ci - Ensure overrun count and timer_gettime() return correct values when
101f08c3bdfSopenharmony_ci   SIGEV_NONE is used in ev.sigev_notify.
102f08c3bdfSopenharmony_ci - Try to call timer_getoverrun() as an overrun is happening.
103f08c3bdfSopenharmony_ci
104f08c3bdfSopenharmony_ciContributors:	julie.n.fleischer REMOVE-THIS AT intel DOT com
105f08c3bdfSopenharmony_ci		geoffrey.r.gustafson REMOVE-THIS AT intel DOT com
106f08c3bdfSopenharmony_ci		rolla.n.selbak REMOVE-THIS AT intel DOT com
107f08c3bdfSopenharmony_ci		majid.awad REMOVE-THIS AT intel DOT com
108f08c3bdfSopenharmony_ci		salwan.searty REMOVE-THIS AT intel DOT com
109f08c3bdfSopenharmony_ci		george REMOVE-THIS AT mvista DOT com
110