Skip to content

Commit 1a716f5

Browse files
committed
Test configuration profile visibility for Linux disk encryption
1 parent f748190 commit 1a716f5

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

server/service/integration_enterprise_test.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2901,13 +2901,26 @@ func (s *integrationEnterpriseTestSuite) TestLinuxDiskEncryption() {
29012901
})
29022902
require.NoError(t, err)
29032903

2904-
// turn on disk encryption enforcement
2905-
s.Do("POST", "/api/latest/fleet/disk_encryption", updateDiskEncryptionRequest{EnableDiskEncryption: true}, http.StatusNoContent)
2904+
// config profiles endpoint should work but show all zeroes
2905+
var profileSummary getMDMProfilesSummaryResponse
2906+
s.DoJSON("GET", "/api/latest/fleet/configuration_profiles/summary", getMDMProfilesSummaryRequest{}, http.StatusOK, &profileSummary)
2907+
require.Equal(t, fleet.MDMProfilesSummary{}, profileSummary.MDMProfilesSummary)
29062908

29072909
// set encrypted for host
29082910
require.NoError(t, s.ds.SetOrUpdateHostDisksEncryption(context.Background(), hostLin.ID, true))
29092911

2910-
// should succeed as we no longer require MDM to access this endpoint, as Linux encryption doesn't require MDM
2912+
// should still show zeroes
2913+
s.DoJSON("GET", "/api/latest/fleet/configuration_profiles/summary", getMDMProfilesSummaryRequest{}, http.StatusOK, &profileSummary)
2914+
require.Equal(t, fleet.MDMProfilesSummary{}, profileSummary.MDMProfilesSummary)
2915+
2916+
// turn on disk encryption enforcement
2917+
s.Do("POST", "/api/latest/fleet/disk_encryption", updateDiskEncryptionRequest{EnableDiskEncryption: true}, http.StatusNoContent)
2918+
2919+
// should show the Linux host as pending
2920+
s.DoJSON("GET", "/api/latest/fleet/configuration_profiles/summary", getMDMProfilesSummaryRequest{}, http.StatusOK, &profileSummary)
2921+
require.Equal(t, fleet.MDMProfilesSummary{Pending: 1}, profileSummary.MDMProfilesSummary)
2922+
2923+
// encryption summary should succeed (Linux encryption doesn't require MDM)
29112924
var summary getMDMDiskEncryptionSummaryResponse
29122925
s.DoJSON("GET", "/api/latest/fleet/mdm/disk_encryption/summary", getMDMDiskEncryptionSummaryRequest{}, http.StatusOK, &summary)
29132926
s.DoJSON("GET", "/api/latest/fleet/disk_encryption", getMDMDiskEncryptionSummaryRequest{}, http.StatusOK, &summary)

0 commit comments

Comments
 (0)