Skip to content

Commit ad44882

Browse files
generatedunixname2655515034848748meta-codesync[bot]
authored andcommitted
fbcode/openbmc/openbmc/tools/flashy/checks_and_remediations/common/04_ensure_flash_available_test.go
Reviewed By: podtserkovskiy Differential Revision: D94342833 fbshipit-source-id: 0696376dfda384a133fffc85268d4518217f2c17
1 parent a68c167 commit ad44882

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/flashy/checks_and_remediations/common/04_ensure_flash_available_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package common
2121

2222
import (
2323
"bytes"
24+
"fmt"
2425
"log"
2526
"os"
2627
"testing"
@@ -29,7 +30,6 @@ import (
2930
"github.com/facebook/openbmc/tools/flashy/lib/fileutils"
3031
"github.com/facebook/openbmc/tools/flashy/lib/step"
3132
"github.com/facebook/openbmc/tools/flashy/lib/utils"
32-
"github.com/pkg/errors"
3333
)
3434

3535
func TestEnsureFlashAvailable(t *testing.T) {
@@ -110,7 +110,7 @@ func TestEnsureFlashAvailable(t *testing.T) {
110110
lsOutput: "/dev/mtd1",
111111
printOutput: "bootargs=console=ttyS2,9600n8 root=/dev/ram rw",
112112
grepOutput: "",
113-
want: step.ExitMustReboot{Err: errors.Errorf("Forcing reboot for new bootargs to take effect")},
113+
want: step.ExitMustReboot{Err: fmt.Errorf("Forcing reboot for new bootargs to take effect")},
114114
},
115115
{
116116
name: "missing flash",
@@ -123,7 +123,7 @@ func TestEnsureFlashAvailable(t *testing.T) {
123123
lsOutput: "Cannot access MTD device /dev/mtd1: No such file or directory",
124124
printOutput: "",
125125
grepOutput: "",
126-
want: step.ExitMissingMtd{Err: errors.Errorf("Broken flash chip? Cannot see MTD chips on device. Error code: err1, stderr: Cannot access MTD device /dev/mtd1: No such file or directory")},
126+
want: step.ExitMissingMtd{Err: fmt.Errorf("Broken flash chip? Cannot see MTD chips on device. Error code: err1, stderr: Cannot access MTD device /dev/mtd1: No such file or directory")},
127127
},
128128
{
129129
name: "fw_printenv broken",
@@ -136,7 +136,7 @@ func TestEnsureFlashAvailable(t *testing.T) {
136136
lsOutput: "/dev/mtd1",
137137
printOutput: "Cannot access MTD device /dev/mtd1: No such file or directory",
138138
grepOutput: "",
139-
want: step.ExitBadFlashChip{Err: errors.Errorf("Broken flash chip? U-Boot environment is inaccessible. Error code: err1, stderr: Cannot access MTD device /dev/mtd1: No such file or directory")},
139+
want: step.ExitBadFlashChip{Err: fmt.Errorf("Broken flash chip? U-Boot environment is inaccessible. Error code: err1, stderr: Cannot access MTD device /dev/mtd1: No such file or directory")},
140140
},
141141
{
142142
name: "fw_setenv broken",
@@ -167,24 +167,24 @@ func TestEnsureFlashAvailable(t *testing.T) {
167167
}
168168
} else if cmdArr[0] == "sh" {
169169
if tc.failLs {
170-
return 1, errors.Errorf("err1"), "", tc.lsOutput
170+
return 1, fmt.Errorf("err1"), "", tc.lsOutput
171171
} else {
172172
return 0, nil, "", tc.lsOutput
173173
}
174174
} else if cmdArr[0] == "fw_printenv" {
175175
if tc.failPrint {
176-
return 1, errors.Errorf("err1"), "", tc.printOutput
176+
return 1, fmt.Errorf("err1"), "", tc.printOutput
177177
} else {
178178
return 0, nil, "", tc.printOutput
179179
}
180180
} else if cmdArr[0] == "fw_setenv" {
181181
if tc.failSet {
182-
return 0, errors.Errorf("err2"), "", "err2"
182+
return 0, fmt.Errorf("err2"), "", "err2"
183183
} else {
184184
return 0, nil, "", ""
185185
}
186186
}
187-
return 0, errors.Errorf("err3"), "", "err3"
187+
return 0, fmt.Errorf("err3"), "", "err3"
188188
}
189189
utils.IsLFOpenBMC = func() bool {
190190
return tc.lfOpenBMC

0 commit comments

Comments
 (0)