Skip to content

Commit 941053e

Browse files
committed
util: check if test is running from service
1 parent c14ea57 commit 941053e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

util/util_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ func TestRunningFromSystemService(t *testing.T) {
4040
func TestCurrentUnitName(t *testing.T) {
4141
testIsRunningSystemd(t)
4242

43+
fromService, err := RunningFromSystemService()
44+
if err != nil || !fromService {
45+
t.Skip("Not running from a systemd service")
46+
}
47+
4348
s, err := CurrentUnitName()
4449
if err != nil {
4550
t.Error(err.Error())

0 commit comments

Comments
 (0)