2020package validate
2121
2222import (
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
3232func 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