mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
fix: ensure test cleanup
This commit is contained in:
parent
3dc65d7432
commit
945eb778a6
1 changed files with 2 additions and 0 deletions
|
|
@ -931,6 +931,7 @@ func (s *integrationMDMTestSuite) TestGetMDMCSR() {
|
|||
|
||||
// Validate errors if no private key is set
|
||||
testSetEmptyPrivateKey = true
|
||||
t.Cleanup(func() { testSetEmptyPrivateKey = false })
|
||||
s.uploadAPNSCert([]byte("-----BEGIN CERTIFICATE-----\nZm9vCg==\n-----END CERTIFICATE-----"), http.StatusInternalServerError, "Couldn't upload APNs certificate. Missing required private key. Learn how to configure the private key here: https://fleetdm.com/learn-more-about/fleet-server-private-key")
|
||||
|
||||
r := s.Do("GET", "/api/latest/fleet/mdm/apple/request_csr", getMDMAppleCSRRequest{}, http.StatusInternalServerError)
|
||||
|
|
@ -8677,6 +8678,7 @@ func (s *integrationMDMTestSuite) TestABMAssetManagement() {
|
|||
|
||||
// Validate error when server private key not set
|
||||
testSetEmptyPrivateKey = true
|
||||
t.Cleanup(func() { testSetEmptyPrivateKey = false })
|
||||
|
||||
r := s.Do("GET", "/api/latest/fleet/mdm/apple/abm_public_key", generateABMKeyPairResponse{}, http.StatusInternalServerError)
|
||||
require.Contains(t, extractServerErrorText(r.Body), "Couldn't download public key. Missing required private key. Learn how to configure the private key here: https://fleetdm.com/learn-more-about/fleet-server-private-key")
|
||||
|
|
|
|||
Loading…
Reference in a new issue