Skip to content

Commit afdc6cc

Browse files
author
Dongsu Park
committed
dbus: check errors from ListUnits()
Add missing error checks for ListUnits() calls.
1 parent 5af4316 commit afdc6cc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

dbus/methods_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ func TestStartStopUnit(t *testing.T) {
111111
}
112112

113113
units, err := conn.ListUnits()
114+
if err != nil {
115+
t.Fatal(err)
116+
}
114117

115118
unit := getUnitStatus(units, target)
116119

@@ -130,6 +133,9 @@ func TestStartStopUnit(t *testing.T) {
130133
<-reschan
131134

132135
units, err = conn.ListUnits()
136+
if err != nil {
137+
t.Fatal(err)
138+
}
133139

134140
unit = getUnitStatus(units, target)
135141

@@ -452,6 +458,9 @@ func TestStartStopTransientUnit(t *testing.T) {
452458
}
453459

454460
units, err := conn.ListUnits()
461+
if err != nil {
462+
t.Fatal(err)
463+
}
455464

456465
unit := getUnitStatus(units, target)
457466

@@ -471,6 +480,9 @@ func TestStartStopTransientUnit(t *testing.T) {
471480
<-reschan
472481

473482
units, err = conn.ListUnits()
483+
if err != nil {
484+
t.Fatal(err)
485+
}
474486

475487
unit = getUnitStatus(units, target)
476488

@@ -508,6 +520,9 @@ func TestStartStopTransientScope(t *testing.T) {
508520
}
509521

510522
units, err := conn.ListUnits()
523+
if err != nil {
524+
t.Fatal(err)
525+
}
511526

512527
unit := getUnitStatus(units, target)
513528

0 commit comments

Comments
 (0)