Skip to content

Commit a6d2d92

Browse files
author
Chenxiong Qi
committed
Fix assertion on file content equality by digest
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
1 parent 64390a8 commit a6d2d92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

integration_tests/push_containerfile_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func TestPushContainerfile(t *testing.T) {
7979
for i := 0; i < len(files); i += 2 {
8080
fileContent := files[i]
8181
fileName := files[i+1]
82-
script := fmt.Sprintf(`echo "%s" >%s`, fileContent, fileName)
82+
script := fmt.Sprintf(`echo -n "%s" >%s`, fileContent, fileName)
8383
err := container.ExecuteCommand("bash", "-c", script)
8484
g.Expect(err).ShouldNot(HaveOccurred())
8585
}
@@ -218,7 +218,7 @@ func TestPushContainerfile(t *testing.T) {
218218
if title, exists := layerAnnotations["org.opencontainers.image.title"]; exists {
219219
g.Expect(title).Should(Equal(tc.expectedTitleAnnotationValue))
220220
}
221-
g.Expect(layerDescriptor.Digest, tc.expectedContainerfileDigest)
221+
g.Expect(string(layerDescriptor.Digest)).Should(Equal("sha256:"+tc.expectedContainerfileDigest))
222222

223223
expectedArtifactType := tc.params.artifactType
224224
if expectedArtifactType == "" {

0 commit comments

Comments
 (0)