From f701559034c32e9fd289fe2a9dc01dff7a8f8d4e Mon Sep 17 00:00:00 2001 From: Marcin Pasinski Date: Mon, 18 Sep 2017 13:18:06 +0200 Subject: [PATCH] Make sure to read artifact data in installation tests. For the install tests to pass we need to read the artifact data part in order to correctly calculate the payload checksum. Changelog: None Signed-off-by: Marcin Pasinski (cherry picked from commit f2bd9ea494d38d9d06506d5d8a3adaa7223a8f2c) --- installer/installer_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/installer/installer_test.go b/installer/installer_test.go index 302fcc231..a689da262 100644 --- a/installer/installer_test.go +++ b/installer/installer_test.go @@ -97,8 +97,12 @@ func TestInstallNoSignature(t *testing.T) { type fDevice struct{} -func (d *fDevice) InstallUpdate(io.ReadCloser, int64) error { return nil } -func (d *fDevice) EnableUpdatedPartition() error { return nil } +func (d *fDevice) InstallUpdate(r io.ReadCloser, l int64) error { + _, err := io.Copy(ioutil.Discard, r) + return err +} + +func (d *fDevice) EnableUpdatedPartition() error { return nil } const ( PublicRSAKey = `-----BEGIN PUBLIC KEY-----