summaryrefslogtreecommitdiff
path: root/unit/atf-src/TODO
blob: 556baba6ec9104583079b185605843cf548d1214 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
Things to do                                    Automated Testing Framework
===========================================================================


Last revised: November 30th, 2010


This document includes the list of things that need to be done in ATF that
are most requested by the users. This information used to be available in
an ad-hoc bug tracker but that proved to be a bad idea. I have collected
all worthy comments in here.

Please note that most work these days is going into Kyua (see
http://code.google.com/p/kyua/). The ideas listed here apply to the
components of ATF that have *not* been migrated to the new codebase yet.
For bug reports or ideas that apply to the components that already have
been migrated, please use the bug tracker in the URL above. Similarly,
whenever a component is migrated, the ideas in this file should be revised
and migrated to the new bug tracker where appropriate.


---------------------------------------------------------------------------
Add build-time checks to atf-sh

The 0.7 release introduced build-time tests to atf-c and atf-c++, but not
to atf-sh. Expose the functionality to the shell interface.

This will probably require writing an atf-build utility that exposes the C
code and can be called from the shell.

---------------------------------------------------------------------------
Revisit what to do when an Atffile lists a non-existent file

---------------------------------------------------------------------------
Add ATF_CHECK* versions to atf-c++ to support non-fatal tests

---------------------------------------------------------------------------
Implement race-condition tests

gcooper:

I would think that stress/negative tests would be of more value than race
condition tests (they're similar, but not exactly the same in my mind).

In particular,

1. Feed through as much data as possible to determine where reporting
   breaks down.
2. Feed through data quickly and terminate ASAP. The data should be
   captured. Terminate child applications with unexpected exit codes and
   signals (in particular, SIGCHLD, SIGPIPE, exit codes that terminate,
   etc).
3. Open up a file descriptor in the test application, don't close the file
   descriptor.
4. fork(2) a process; don't wait(2) for the application to complete.

There are other scenarios that could be exercised, but these are the ones
I could think of off the topic of my head.

--

jmmv:

1. The thing is: how do you express any of this in a portable/abstract
   interface? How do you express that a test case "receives data"? What
   does that exactly mean? I don't think the framework should care about
   this: each test should be free to decide where its data is and how to
   deal with it.

2. Ditto.

3. Not sure I understand your request, but testing for "unexpected exit
   codes" is already supported. See wiki:DesignXFail for the feature
   design details.

4. What's the problem with this case? The test case exits right away after
   terminating the execution of its body; any open file descriptors,
   leaked memory, etc. die with it.

5. forking and not waiting for a subprocess was a problem already
   addressed.

I kinda have an idea of what Antti means with "race condition tests", but
every time I have tried to describe my understanding of matters I seem to
be wrong. Would be nice to have a clear description of what this involves;
in particular, what are the expectations from the framework and how should
the feature be exposed.

As of now, what I understand by "race condition test" is: a test case that
exercises a race condition. The test case may finish without triggering
the race, in which case it just exists with a successful status.
Otherwise, if the race triggers, the test case gets stuck and times out.
The result should be reported as an "expected failure" different from
timeout.

--

pooka:

Yup. Plus some atf-wide mechanism for the operator to supply some kind of
guideline if the test should try to trigger the race for a second or for
an hour.

--

jmmv:

Alright. While mocking up some code for this, I think that your two
requests are complementary.

On the one hand, when you are talking about a "race condition" test you
really mean an "expected race condition" test. Correct? If so, we need to
extend the xfail mechanism to add one more case, which is to report any
failures as a race condition error and, if there is no failure, report the
test as successful.

On the other hand, the atf-wide mechanism to support how long the test
should run for can be thought as a "stress test" mechanism. I.e. run this
test for X time / iterations and report its results regularly without
involving xfail at all.

So, with this in mind:

* For a test that triggers an unfixed race condition, you set xfail to
  race mode and define the test as a stress test. Any failures are
  reported as expected failures.

* For a test that verifies a supposedly-fixed race condition, you do *not*
  set xfail to race mode, and only set the test to stress test. Any
  failures are reported as real failures.

These stress test cases implement a single iteration of the test and
atf-run is in charge of running the test several times, stopping on the
first failure.

Does that make sense?

---------------------------------------------------------------------------
Implement ATF_REQUIRE_ERRNO

pooka:

Most of the lines in tests against system functionality are:

if (syscall(args) == -1)
    atf_tc_fail_errno("flop")

Some shorthand would be helpful, like ATF_REQUIRE_ERRNO(syscall(args))
Also, a variant which allows arbitrary return value checks (e.g. "!= 0" or
"< 124" or "!= size") would be nice.

--

gcooper:

There's a problem with this request; not all functions fail in the same
way ... in particular compare the pthread family of functions (which
return errno) vs many native syscalls. Furthermore, compare some
fcntl-like syscalls vs other syscalls. One size fits all solutions may not
be a wise idea in this case, so I think that the problem statement needs
to be better defined, because the above request is too loose.

FWIW, there's also a TEST macro in LTP, which tests for non-zero status,
and sets an appropriate set of global variables for errnos and return
codes, respectively. It was a good idea, but has been mostly abandoned
because it's too difficult to define a success and failure in a universal
manner, so I think that we need to be careful with what's implemented in
ATF to not repeat the mistakes that others have made.

--

jmmv:

I think you've got a good point.

This was mostly intended to simplify the handling of the stupid errno
global variable. I think this is valuable to have, but maybe the
macro/function name should be different because _ERRNO can be confusing.
Probably something like an ATF_CHECK_LIBC / ATF_CHECK_PTHREAD approach
would be more flexible and simple.


===========================================================================
vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2