From c7e64e2b4f3a9d7734a92aebc53f285cd6afd94b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 16 Dec 2018 13:53:22 +0100 Subject: vm: don't call Diagnose when VM hasn't crashed Fixes #875 --- vm/vm_test.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'vm/vm_test.go') diff --git a/vm/vm_test.go b/vm/vm_test.go index 1c66166f7..626ad62cb 100644 --- a/vm/vm_test.go +++ b/vm/vm_test.go @@ -107,11 +107,16 @@ var tests = []*Test{ Body: func(outc chan []byte, errc chan error) { errc <- nil }, + }, + { + Name: "#875-diagnose-bugs-2", + Body: func(outc chan []byte, errc chan error) { + errc <- nil + }, Report: &report.Report{ - Title: "BUG: DIAGNOSE", - // TODO: this is wrong. - Report: []byte( - "BUG: DIAGNOSE\n", + Title: lostConnectionCrash, + Output: []byte( + "DIAGNOSE\n", ), }, }, @@ -148,10 +153,9 @@ var tests = []*Test{ }, Report: &report.Report{ Title: "BUG: bad", - // TODO: this is wrong. Report: []byte( - "DIAGNOSE\n" + - "BUG: bad\n", + "BUG: bad\n" + + "DIAGNOSE\n", ), }, }, @@ -298,4 +302,7 @@ func testMonitorExecution(t *testing.T, test *Test) { if !bytes.Equal(test.Report.Report, rep.Report) { t.Fatalf("want report:\n%s\n\ngot report:\n%s\n", test.Report.Report, rep.Report) } + if test.Report.Output != nil && !bytes.Equal(test.Report.Output, rep.Output) { + t.Fatalf("want output:\n%s\n\ngot output:\n%s\n", test.Report.Output, rep.Output) + } } -- cgit mrf-deployment