e2e: use ExitCleanly() in cleanup_test.go

Ongoing steps toward RUN-1907: replace Exit(0) with ExitCleanly()

Clean command-line replace.

Also, fix up the Containerized and Debian exceptions in matcher.
I was in a huge rush Thursday night when I added the Debian
exception. This, I hope, makes it slightly easier to understand
the cases where we don't check stderr.

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago committed 2023-09-11 06:33:18 -06:00
1 parent adc45ef887
commit 8cb14e54a5
2 files changed
+35 -25

No files matched your search

+19 -10
View File
@@ -198,16 +198,25 @@ func (matcher *exitCleanlyMatcher) Match(actual interface{}) (success bool, err
return false, nil
}
// FIXME: #19809, "failed to connect to syslog" warnings on f38
// FIXME: so, until that is fixed, don't check stderr if containerized
if !Containerized() {
info := GetHostDistributionInfo()
if info.Distribution == "fedora" {
if stderr != "" {
matcher.msg = fmt.Sprintf("Unexpected warnings seen on stderr: %q", stderr)
return false, nil
}
}
// Exit status is 0. Now check for anything on stderr... except:
if Containerized() {
// FIXME: #19809, "failed to connect to syslog" warnings on f38
// FIXME: so, until that is fixed, don't check stderr if containerized
return true, nil
}
info := GetHostDistributionInfo()
if info.Distribution != "fedora" {
// runc on debian:
// FIXME: #11784 - lstat /sys/fs/.../*.scope: ENOENT
// FIXME: #11785 - cannot toggle freezer: cgroups not configured
return true, nil
}
if stderr != "" {
matcher.msg = fmt.Sprintf("Unexpected warnings seen on stderr: %q", stderr)
return false, nil
}
return true, nil