Skip to content

Commit f02c6a4

Browse files
committed
skip test case if no services are present
ex. in a docker environment
1 parent 07ac3b6 commit f02c6a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/snclient/check_service_linux_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ func TestCheckServiceLinuxOutput(t *testing.T) {
254254
serviceName = entry["name"]
255255
}
256256

257+
if serviceName == "" {
258+
t.Skipf("no running service found, skipping test")
259+
return
260+
}
261+
257262
require.NotEmptyf(t, serviceName, "check requires a service to test against")
258263

259264
res := snc.RunCheck("check_service", []string{"filter= name like " + serviceName, "crit=rss<5"})

0 commit comments

Comments
 (0)