66package e2e
77
88import (
9- "crypto/sha1 "
9+ "crypto/sha256 "
1010 "fmt"
1111 "io"
1212 "io/ioutil"
@@ -253,7 +253,7 @@ overrides:
253253 preresolved: true
254254`
255255
256- expectedPackagedSHA := "ca02098b7f6cee61836119233e3b43d1a92083b4 "
256+ expectedPackagedSHA256 := "e084f139ad114ef6c56dc7343f7d6bd8d2cd11a16e77e00aca97b5e5d18c3a56 "
257257
258258 path := "/tmp/kbld-test-pkg-unpkg-successful-with-many-images"
259259 defer os .RemoveAll (path )
@@ -262,21 +262,21 @@ overrides:
262262 StdinReader : strings .NewReader (input ),
263263 })
264264
265- actualSHA := sha1File (t , path )
265+ actualSHA256 := sha256File (t , path )
266266
267- // Assert that concurrently writing to tar doesn't affect sha
268- if actualSHA != expectedPackagedSHA {
269- t .Fatalf ("Expected package sha to be same >>>%s<<< to match >>>%s<<<" , actualSHA , expectedPackagedSHA )
267+ // Assert that concurrently writing to tar doesn't affect sha256
268+ if actualSHA256 != expectedPackagedSHA256 {
269+ t .Fatalf ("Expected package sha256 to be same >>>%s<<< to match >>>%s<<<" , actualSHA256 , expectedPackagedSHA256 )
270270 }
271271
272272 kbld .RunWithOpts ([]string {"package" , "-f" , "-" , "--output" , path , "--concurrency=5" }, RunOpts {
273273 StdinReader : strings .NewReader (input ),
274274 })
275275
276- actualSHA = sha1File (t , path )
276+ actualSHA256 = sha256File (t , path )
277277
278- if actualSHA != expectedPackagedSHA {
279- t .Fatalf ("Expected package sha to be same >>>%s<<< to match >>>%s<<<" , actualSHA , expectedPackagedSHA )
278+ if actualSHA256 != expectedPackagedSHA256 {
279+ t .Fatalf ("Expected package sha256 to be same >>>%s<<< to match >>>%s<<<" , actualSHA256 , expectedPackagedSHA256 )
280280 }
281281
282282 kbld .RunWithOpts ([]string {
@@ -285,14 +285,14 @@ overrides:
285285 }, RunOpts {StdinReader : strings .NewReader (input )})
286286}
287287
288- func sha1File (t * testing.T , path string ) string {
288+ func sha256File (t * testing.T , path string ) string {
289289 f , err := os .Open (path )
290290 if err != nil {
291291 t .Fatal (err )
292292 }
293293 defer f .Close ()
294294
295- hs := sha1 .New ()
295+ hs := sha256 .New ()
296296 if _ , err := io .Copy (hs , f ); err != nil {
297297 t .Fatal (err )
298298 }
0 commit comments