remote: Re-assert the MD5's match

This commit is contained in:
Armon Dadgar 2014-12-05 15:19:04 -08:00 committed by Mitchell Hashimoto
parent 07e5f3ff41
commit 21c29dd229
1 changed files with 11 additions and 7 deletions

View File

@ -1,6 +1,8 @@
package remote
import (
"bytes"
"crypto/md5"
"os"
"testing"
@ -52,6 +54,8 @@ func TestAtlasRemote(t *testing.T) {
if err != nil {
t.Fatalf("Err: %v", err)
}
inpMD5 := md5.Sum(inp)
hash := inpMD5[:16]
// Delete the state, should be none
err = r.DeleteState()
@ -84,13 +88,13 @@ func TestAtlasRemote(t *testing.T) {
}
// Check the payload
//if !bytes.Equal(payload.MD5, hash) {
// t.Fatalf("bad hash: %x %x", payload.MD5, hash)
//}
//if !bytes.Equal(payload.State, inp) {
// t.Errorf("inp: %s", inp)
// t.Fatalf("bad response: %s", payload.State)
//}
if !bytes.Equal(payload.MD5, hash) {
t.Fatalf("bad hash: %x %x", payload.MD5, hash)
}
if !bytes.Equal(payload.State, inp) {
t.Errorf("inp: %s", inp)
t.Fatalf("bad response: %s", payload.State)
}
// Delete the state
err = r.DeleteState()