Skip to content

Commit e760ed4

Browse files
generatedunixname2655515034848748meta-codesync[bot]
authored andcommitted
fbcode/openbmc/openbmc/tools/flashy/lib/validate/compatibility_test.go
Reviewed By: malikrafsan Differential Revision: D92949810 fbshipit-source-id: 8cc966cecb5f50e026f2063a5695377dd8305902
1 parent 181c4b0 commit e760ed4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/flashy/lib/validate/compatibility_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
package validate
2121

2222
import (
23+
"fmt"
2324
"strings"
2425
"testing"
2526

2627
"github.com/facebook/openbmc/tools/flashy/lib/fileutils"
2728
"github.com/facebook/openbmc/tools/flashy/lib/utils"
2829
"github.com/facebook/openbmc/tools/flashy/tests"
29-
"github.com/pkg/errors"
3030
)
3131

3232
func TestCompatibleVersionMapping(t *testing.T) {
@@ -65,7 +65,7 @@ func TestCheckImageBuildNameCompatibility(t *testing.T) {
6565
name: "does not match",
6666
etcIssueVer: "fbtp-v2020.09.1",
6767
imageFileVer: "yosemite-v1.2",
68-
want: errors.Errorf("OpenBMC versions from /etc/issue ('fbtp') and image file ('yosemite') do not match!"),
68+
want: fmt.Errorf("OpenBMC versions from /etc/issue ('fbtp') and image file ('yosemite') do not match!"),
6969
},
7070
{
7171
name: "compatible, uses normalized version",
@@ -77,7 +77,7 @@ func TestCheckImageBuildNameCompatibility(t *testing.T) {
7777
name: "etc issue build name get error",
7878
etcIssueVer: "!@#$",
7979
imageFileVer: "yfbgp2-v1234",
80-
want: errors.Errorf(
80+
want: fmt.Errorf(
8181
"Unable to get build name from version '!@#$' (normalized: '!@#$'): " +
8282
"No match for regex '^(?P<buildname>\\w+)' for input '!@#$'",
8383
),
@@ -86,7 +86,7 @@ func TestCheckImageBuildNameCompatibility(t *testing.T) {
8686
name: "image build name get error",
8787
etcIssueVer: "fby2-gpv2-v2019.43.1",
8888
imageFileVer: "!@#$",
89-
want: errors.Errorf(
89+
want: fmt.Errorf(
9090
"Unable to get build name from version '!@#$' (normalized: '!@#$'): " +
9191
"No match for regex '^(?P<buildname>\\w+)' for input '!@#$'",
9292
),
@@ -177,7 +177,7 @@ func TestGetNormalizedBuildNameFromVersion(t *testing.T) {
177177
name: "rubbish version, no match",
178178
ver: "!@#$",
179179
want: "",
180-
wantErr: errors.Errorf("Unable to get build name from version '%v' (normalized: '%v'): %v",
180+
wantErr: fmt.Errorf("Unable to get build name from version '%v' (normalized: '%v'): %v",
181181
"!@#$", "!@#$", "No match for regex '^(?P<buildname>\\w+)' for input '!@#$'"),
182182
},
183183
}
@@ -234,15 +234,15 @@ func TestGetOpenBMCVersionFromImageFile(t *testing.T) {
234234
fileBuf: []byte{},
235235
mmapErr: nil,
236236
want: "",
237-
wantErr: errors.Errorf("Unable to find OpenBMC version in image file 'x': " +
237+
wantErr: fmt.Errorf("Unable to find OpenBMC version in image file 'x': " +
238238
"No match for regex 'U-Boot \\d+\\.\\d+ (?P<version>[^\\s]+)' for input"),
239239
},
240240
{
241241
name: "mmap err",
242242
fileBuf: []byte{},
243-
mmapErr: errors.Errorf("mmap err"),
243+
mmapErr: fmt.Errorf("mmap err"),
244244
want: "",
245-
wantErr: errors.Errorf("Unable to read and mmap image file 'x': mmap err"),
245+
wantErr: fmt.Errorf("Unable to read and mmap image file 'x': mmap err"),
246246
},
247247
}
248248
for _, tc := range cases {

0 commit comments

Comments
 (0)