From 350733573cc7bc927e4d4c26c4cc6e5776df7f70 Mon Sep 17 00:00:00 2001 From: Matthew Sykes Date: Tue, 14 Apr 2020 18:11:01 -0400 Subject: [PATCH] Restore logspec after CheckLogspecOperations Noticed debug level logging was on for a test when it should not have been. Change-Id: I0f38614917be3868712b8b53899e8b1bbba1cb03 Signed-off-by: Matthew Sykes --- integration/e2e/e2e_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/integration/e2e/e2e_test.go b/integration/e2e/e2e_test.go index d4facdd614d..ac13bd93c36 100644 --- a/integration/e2e/e2e_test.go +++ b/integration/e2e/e2e_test.go @@ -815,6 +815,7 @@ func CheckLogspecOperations(client *http.Client, logspecURL string) { resp, err = client.Do(updateReq) Expect(err).NotTo(HaveOccurred()) Expect(resp.StatusCode).To(Equal(http.StatusNoContent)) + resp.Body.Close() resp, err = client.Get(logspecURL) Expect(err).NotTo(HaveOccurred()) @@ -823,6 +824,14 @@ func CheckLogspecOperations(client *http.Client, logspecURL string) { resp.Body.Close() Expect(err).NotTo(HaveOccurred()) Expect(string(bodyBytes)).To(MatchJSON(`{"spec":"debug"}`)) + + By("resetting the logspec") + updateReq, err = http.NewRequest(http.MethodPut, logspecURL, strings.NewReader(`{"spec":"info"}`)) + Expect(err).NotTo(HaveOccurred()) + resp, err = client.Do(updateReq) + Expect(err).NotTo(HaveOccurred()) + Expect(resp.StatusCode).To(Equal(http.StatusNoContent)) + resp.Body.Close() } func CheckHealthEndpoint(client *http.Client, url string) {