Skip to content

Commit ac32a10

Browse files
Do not ignore error
1 parent c9b3261 commit ac32a10

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

test/integration/multinetwork_test.go

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ func connectExtnet(ctx context.Context, t *testing.T, profile string) {
122122
if PodmanDriver() {
123123
bin = "podman"
124124
}
125-
extnetIPv4, extnetIPv6, _ = oci.ContainerIPs(bin, profile, extnetNetworkName)
125+
extnetIPv4, extnetIPv6, err = oci.ContainerIPs(bin, profile, extnetNetworkName)
126+
if err != nil {
127+
t.Fatalf("failed to execute oci.ContainerIPs, error: %v", err)
128+
}
126129
t.Logf("cluster %s was attached to network %s with address %s/%s", profile, extnetNetworkName, extnetIPv4, extnetIPv6)
127130
}
128131
}
@@ -154,7 +157,10 @@ func multinetworkValidateFreshStart(ctx context.Context, t *testing.T, profile s
154157
if PodmanDriver() {
155158
bin = "podman"
156159
}
157-
clusterIPv4, clusterIPv6, _ = oci.ContainerIPs(bin, profile, profile)
160+
clusterIPv4, clusterIPv6, err = oci.ContainerIPs(bin, profile, profile)
161+
if err != nil {
162+
t.Fatalf("failed to execute oci.ContainerIPs, error: %v", err)
163+
}
158164
t.Logf("cluster %s started with address %s/%s", profile, clusterIPv4, clusterIPv6)
159165
}
160166
}
@@ -185,14 +191,20 @@ func multinetworkValidateStart(ctx context.Context, t *testing.T, profile string
185191
if PodmanDriver() {
186192
bin = "podman"
187193
}
188-
ipv4, ipv6, _ := oci.ContainerIPs(bin, profile, profile)
194+
ipv4, ipv6, err := oci.ContainerIPs(bin, profile, profile)
195+
if err != nil {
196+
t.Fatalf("failed to execute oci.ContainerIPs, error: %v", err)
197+
}
189198
if ipv4 != clusterIPv4 {
190199
t.Fatalf("clusterIPv4 mismatch %s != %s", clusterIPv4, ipv4)
191200
}
192201
if ipv6 != clusterIPv6 {
193202
t.Fatalf("clusterIPv6 mismatch %s != %s", clusterIPv6, ipv6)
194203
}
195-
ipv4, ipv6, _ = oci.ContainerIPs(bin, profile, extnetNetworkName)
204+
ipv4, ipv6, err = oci.ContainerIPs(bin, profile, extnetNetworkName)
205+
if err != nil {
206+
t.Fatalf("failed to execute oci.ContainerIPs, error: %v", err)
207+
}
196208
if ipv4 != extnetIPv4 {
197209
t.Fatalf("extnetIPv4 mismatch %s != %s", extnetIPv4, ipv4)
198210
}
@@ -291,5 +303,8 @@ func CleanupExtnet(t *testing.T) {
291303
cmd := exec.CommandContext(ctx, "docker", "network", "rm", extnetNetworkName)
292304
rr := &RunResult{Args: cmd.Args}
293305
t.Logf("(dbg) Run: %v", rr.Command())
294-
_ = cmd.Run()
306+
err := cmd.Run()
307+
if err != nil {
308+
t.Logf("failed to run docker network rm %v", err)
309+
}
295310
}

0 commit comments

Comments
 (0)