Skip to content

Commit

Permalink
test: update test to check r.Failed instead of error for "failed when…
Browse files Browse the repository at this point in the history
… contains" issues
  • Loading branch information
carlmontanari committed Dec 3, 2022
1 parent 1ff1aa4 commit bff9f38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 0 additions & 4 deletions driver/generic/sendcommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ func (d *Driver) sendCommand(

r.Record(b)

if r.Failed != nil {
return nil, r.Failed
}

return r, nil
}

Expand Down
14 changes: 9 additions & 5 deletions driver/generic/sendcommand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,16 @@ func testSendCommandFails(testName string, testCase *sendCommandTestCase) func(t

d, _ := prepareDriver(t, testName, testCase.payloadFile)

_, err := d.SendCommand(testCase.command)
if err == nil {
t.Errorf(
"%s: expected error running network Driver SendCommand, got: %s",
r, err := d.SendCommand(testCase.command)
if err != nil {
t.Fatalf("%s: response object indicates failure",
testName)
}

if r.Failed == nil {
t.Fatalf(
"%s: expected r.Failed to be set",
testName,
err,
)
}
}
Expand Down

0 comments on commit bff9f38

Please sign in to comment.