@@ -178,7 +178,7 @@ def test_no_header(self):
178
178
with open (empty_log ) as file :
179
179
result = kunit_parser .parse_run_tests (
180
180
kunit_parser .extract_tap_lines (file .readlines ()))
181
- self .assertEqual (0 , len (result .test . subtests ))
181
+ self .assertEqual (0 , len (result .subtests ))
182
182
self .assertEqual (
183
183
kunit_parser .TestStatus .FAILURE_TO_PARSE_TESTS ,
184
184
result .status )
@@ -191,9 +191,9 @@ def test_missing_test_plan(self):
191
191
kunit_parser .extract_tap_lines (
192
192
file .readlines ()))
193
193
# A missing test plan is not an error.
194
- self .assertEqual (0 , result .test . counts .errors )
194
+ self .assertEqual (0 , result .counts .errors )
195
195
# All tests should be accounted for.
196
- self .assertEqual (10 , result .test . counts .total ())
196
+ self .assertEqual (10 , result .counts .total ())
197
197
self .assertEqual (
198
198
kunit_parser .TestStatus .SUCCESS ,
199
199
result .status )
@@ -203,7 +203,7 @@ def test_no_tests(self):
203
203
with open (header_log ) as file :
204
204
result = kunit_parser .parse_run_tests (
205
205
kunit_parser .extract_tap_lines (file .readlines ()))
206
- self .assertEqual (0 , len (result .test . subtests ))
206
+ self .assertEqual (0 , len (result .subtests ))
207
207
self .assertEqual (
208
208
kunit_parser .TestStatus .NO_TESTS ,
209
209
result .status )
@@ -213,11 +213,11 @@ def test_no_tests_no_plan(self):
213
213
with open (no_plan_log ) as file :
214
214
result = kunit_parser .parse_run_tests (
215
215
kunit_parser .extract_tap_lines (file .readlines ()))
216
- self .assertEqual (0 , len (result .test . subtests [0 ].subtests [0 ].subtests ))
216
+ self .assertEqual (0 , len (result .subtests [0 ].subtests [0 ].subtests ))
217
217
self .assertEqual (
218
218
kunit_parser .TestStatus .NO_TESTS ,
219
- result .test . subtests [0 ].subtests [0 ].status )
220
- self .assertEqual (1 , result .test . counts .errors )
219
+ result .subtests [0 ].subtests [0 ].status )
220
+ self .assertEqual (1 , result .counts .errors )
221
221
222
222
223
223
def test_no_kunit_output (self ):
@@ -228,7 +228,7 @@ def test_no_kunit_output(self):
228
228
kunit_parser .extract_tap_lines (file .readlines ()))
229
229
print_mock .assert_any_call (StrContains ('invalid KTAP input!' ))
230
230
print_mock .stop ()
231
- self .assertEqual (0 , len (result .test . subtests ))
231
+ self .assertEqual (0 , len (result .subtests ))
232
232
233
233
def test_crashed_test (self ):
234
234
crashed_log = test_data_path ('test_is_test_passed-crash.log' )
@@ -269,10 +269,10 @@ def test_ignores_hyphen(self):
269
269
result .status )
270
270
self .assertEqual (
271
271
"sysctl_test" ,
272
- result .test . subtests [0 ].name )
272
+ result .subtests [0 ].name )
273
273
self .assertEqual (
274
274
"example" ,
275
- result .test . subtests [1 ].name )
275
+ result .subtests [1 ].name )
276
276
file .close ()
277
277
278
278
@@ -283,7 +283,7 @@ def test_ignores_prefix_printk_time(self):
283
283
self .assertEqual (
284
284
kunit_parser .TestStatus .SUCCESS ,
285
285
result .status )
286
- self .assertEqual ('kunit-resource-test' , result .test . subtests [0 ].name )
286
+ self .assertEqual ('kunit-resource-test' , result .subtests [0 ].name )
287
287
288
288
def test_ignores_multiple_prefixes (self ):
289
289
prefix_log = test_data_path ('test_multiple_prefixes.log' )
@@ -292,7 +292,7 @@ def test_ignores_multiple_prefixes(self):
292
292
self .assertEqual (
293
293
kunit_parser .TestStatus .SUCCESS ,
294
294
result .status )
295
- self .assertEqual ('kunit-resource-test' , result .test . subtests [0 ].name )
295
+ self .assertEqual ('kunit-resource-test' , result .subtests [0 ].name )
296
296
297
297
def test_prefix_mixed_kernel_output (self ):
298
298
mixed_prefix_log = test_data_path ('test_interrupted_tap_output.log' )
@@ -301,7 +301,7 @@ def test_prefix_mixed_kernel_output(self):
301
301
self .assertEqual (
302
302
kunit_parser .TestStatus .SUCCESS ,
303
303
result .status )
304
- self .assertEqual ('kunit-resource-test' , result .test . subtests [0 ].name )
304
+ self .assertEqual ('kunit-resource-test' , result .subtests [0 ].name )
305
305
306
306
def test_prefix_poundsign (self ):
307
307
pound_log = test_data_path ('test_pound_sign.log' )
@@ -310,7 +310,7 @@ def test_prefix_poundsign(self):
310
310
self .assertEqual (
311
311
kunit_parser .TestStatus .SUCCESS ,
312
312
result .status )
313
- self .assertEqual ('kunit-resource-test' , result .test . subtests [0 ].name )
313
+ self .assertEqual ('kunit-resource-test' , result .subtests [0 ].name )
314
314
315
315
def test_kernel_panic_end (self ):
316
316
panic_log = test_data_path ('test_kernel_panic_interrupt.log' )
@@ -319,7 +319,7 @@ def test_kernel_panic_end(self):
319
319
self .assertEqual (
320
320
kunit_parser .TestStatus .TEST_CRASHED ,
321
321
result .status )
322
- self .assertEqual ('kunit-resource-test' , result .test . subtests [0 ].name )
322
+ self .assertEqual ('kunit-resource-test' , result .subtests [0 ].name )
323
323
324
324
def test_pound_no_prefix (self ):
325
325
pound_log = test_data_path ('test_pound_no_prefix.log' )
@@ -328,7 +328,7 @@ def test_pound_no_prefix(self):
328
328
self .assertEqual (
329
329
kunit_parser .TestStatus .SUCCESS ,
330
330
result .status )
331
- self .assertEqual ('kunit-resource-test' , result .test . subtests [0 ].name )
331
+ self .assertEqual ('kunit-resource-test' , result .subtests [0 ].name )
332
332
333
333
def line_stream_from_strs (strs : Iterable [str ]) -> kunit_parser .LineStream :
334
334
return kunit_parser .LineStream (enumerate (strs , start = 1 ))
@@ -467,7 +467,7 @@ def _json_for(self, log_file):
467
467
with open (test_data_path (log_file )) as file :
468
468
test_result = kunit_parser .parse_run_tests (file )
469
469
json_obj = kunit_json .get_json_result (
470
- test_result = test_result ,
470
+ test = test_result ,
471
471
def_config = 'kunit_defconfig' ,
472
472
build_dir = None ,
473
473
json_path = 'stdout' )
0 commit comments