Skip to content

Too small --exec-timeout does hangs for 5 min in shell tests (LTP test default) #80

@pevik

Description

@pevik

Tested on latest master: 4e20e25.

--exec-timeout looks to be broken, as it simply keep test running, at least when kirk is running locally on SUT. ima_violations runs for ~4 sec, because it sleeps for 3 sec, thus it hangs when called with smaller exec timeout:

# time ./kirk --exec-timeout=1 -f ima; echo $?
...
Connecting to SUT: default

Starting suite: ima
--------------------
ima_measurements: pass  (0.723s)
ima_policy: skip  (0.428s)
ima_tpm: skip  (0.414s)
ima_violations: broken  (5m 0s) NOTE: it HANGS here for test default, which is for shell 5 min
...
real	5m4.726s
user	0m1.495s
sys	0m2.272s
0

FYI this is the output for ima testsuite without --exec-timeout:

# time ./kirk -f ima; echo $?
...
Connecting to SUT: default

Starting suite: ima
--------------------
ima_measurements: pass  (0.716s)
ima_policy: skip  (0.393s)
ima_tpm: skip  (0.431s)
ima_violations: pass  (3.683s)
ima_keys: skip  (0.341s)
ima_kexec: skip  (0.419s)
ima_selinux: skip  (0.399s)
ima_conditionals: skip  (0.639s)
evm_overlay: skip  (0.375s)
                                                                                                                                
Execution time: 7.843s

	Suite:       ima
	Total runs:  9
	Runtime:     7.396s
...

real	0m8.041s
user	0m1.329s
sys	0m2.228s
0

Running with -v shows the crazy duration:

# time ./kirk -v --exec-timeout=1 -f ima; echo $?
...
tst_test.c:1825: TINFO: Overall timeout per run is 0h 02m 00s
ima_mmap.c:38: TINFO: sleep 3s

Summary:
passed    2
failed    0
broken    1
skipped   0
warnings  0

Duration: 5m 0s
# time ./kirk -v -f ima; echo $?
...
ima_violations 4 TINFO: verify limiting single open writer violation
ima_violations 4 TPASS: 1 open_writers violation(s) added
ima_violations 5 TINFO: verify limiting multiple open writers violations
ima_violations 5 TPASS: 1 open_writers violation(s) added
ima_violations 6 TINFO: verify new open writer causes additional violation
ima_violations 6 TPASS: 2 open_writers violation(s) added
ima_violations 7 TINFO: verify limiting single open reader ToMToU violations
ima_violations 7 TPASS: 1 ToMToU violation(s) added
ima_violations 8 TINFO: verify new open reader causes additional violation
ima_violations 8 TPASS: 2 ToMToU violation(s) added

Summary:
passed   8
failed   0
broken   0
skipped  0
warnings 0

Duration: 3.582s
...

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions