chore: merge feature branch

This commit is contained in:
Jahziel Villasana-Espinoza 2024-05-23 11:53:34 -04:00
commit 23919e6c7d
2 changed files with 47 additions and 35 deletions

View file

@ -39,41 +39,41 @@ func TestMDMApple(t *testing.T) {
name string
fn func(t *testing.T, ds *Datastore)
}{
// {"TestNewMDMAppleConfigProfileDuplicateName", testNewMDMAppleConfigProfileDuplicateName},
// {"TestNewMDMAppleConfigProfileLabels", testNewMDMAppleConfigProfileLabels},
// {"TestNewMDMAppleConfigProfileDuplicateIdentifier", testNewMDMAppleConfigProfileDuplicateIdentifier},
// {"TestDeleteMDMAppleConfigProfile", testDeleteMDMAppleConfigProfile},
// {"TestDeleteMDMAppleConfigProfileByTeamAndIdentifier", testDeleteMDMAppleConfigProfileByTeamAndIdentifier},
// {"TestListMDMAppleConfigProfiles", testListMDMAppleConfigProfiles},
// {"TestHostDetailsMDMProfiles", testHostDetailsMDMProfiles},
// {"TestBatchSetMDMAppleProfiles", testBatchSetMDMAppleProfiles},
// {"TestMDMAppleProfileManagement", testMDMAppleProfileManagement},
// {"TestMDMAppleProfileManagementBatch2", testMDMAppleProfileManagementBatch2},
// {"TestMDMAppleProfileManagementBatch3", testMDMAppleProfileManagementBatch3},
// {"TestGetMDMAppleProfilesContents", testGetMDMAppleProfilesContents},
// {"TestAggregateMacOSSettingsStatusWithFileVault", testAggregateMacOSSettingsStatusWithFileVault},
// {"TestMDMAppleHostsProfilesStatus", testMDMAppleHostsProfilesStatus},
// {"TestMDMAppleIdPAccount", testMDMAppleIdPAccount},
// {"TestIgnoreMDMClientError", testDoNotIgnoreMDMClientError},
// {"TestDeleteMDMAppleProfilesForHost", testDeleteMDMAppleProfilesForHost},
// {"TestGetMDMAppleCommandResults", testGetMDMAppleCommandResults},
// {"TestBulkUpsertMDMAppleConfigProfiles", testBulkUpsertMDMAppleConfigProfile},
// {"TestMDMAppleBootstrapPackageCRUD", testMDMAppleBootstrapPackageCRUD},
// {"TestListMDMAppleCommands", testListMDMAppleCommands},
// {"TestMDMAppleSetupAssistant", testMDMAppleSetupAssistant},
// {"TestMDMAppleEnrollmentProfile", testMDMAppleEnrollmentProfile},
// {"TestListMDMAppleSerials", testListMDMAppleSerials},
// {"TestMDMAppleDefaultSetupAssistant", testMDMAppleDefaultSetupAssistant},
// {"TestSetVerifiedMacOSProfiles", testSetVerifiedMacOSProfiles},
// {"TestMDMAppleConfigProfileHash", testMDMAppleConfigProfileHash},
// {"TestMDMAppleResetEnrollment", testMDMAppleResetEnrollment},
// {"TestMDMAppleDeleteHostDEPAssignments", testMDMAppleDeleteHostDEPAssignments},
// {"LockUnlockWipeMacOS", testLockUnlockWipeMacOS},
// {"ScreenDEPAssignProfileSerialsForCooldown", testScreenDEPAssignProfileSerialsForCooldown},
// {"MDMAppleDDMDeclarationsToken", testMDMAppleDDMDeclarationsToken},
// {"MDMAppleSetPendingDeclarationsAs", testMDMAppleSetPendingDeclarationsAs},
// {"SetOrUpdateMDMAppleDeclaration", testSetOrUpdateMDMAppleDDMDeclaration},
// {"DEPAssignmentUpdates", testMDMAppleDEPAssignmentUpdates},
{"TestNewMDMAppleConfigProfileDuplicateName", testNewMDMAppleConfigProfileDuplicateName},
{"TestNewMDMAppleConfigProfileLabels", testNewMDMAppleConfigProfileLabels},
{"TestNewMDMAppleConfigProfileDuplicateIdentifier", testNewMDMAppleConfigProfileDuplicateIdentifier},
{"TestDeleteMDMAppleConfigProfile", testDeleteMDMAppleConfigProfile},
{"TestDeleteMDMAppleConfigProfileByTeamAndIdentifier", testDeleteMDMAppleConfigProfileByTeamAndIdentifier},
{"TestListMDMAppleConfigProfiles", testListMDMAppleConfigProfiles},
{"TestHostDetailsMDMProfiles", testHostDetailsMDMProfiles},
{"TestBatchSetMDMAppleProfiles", testBatchSetMDMAppleProfiles},
{"TestMDMAppleProfileManagement", testMDMAppleProfileManagement},
{"TestMDMAppleProfileManagementBatch2", testMDMAppleProfileManagementBatch2},
{"TestMDMAppleProfileManagementBatch3", testMDMAppleProfileManagementBatch3},
{"TestGetMDMAppleProfilesContents", testGetMDMAppleProfilesContents},
{"TestAggregateMacOSSettingsStatusWithFileVault", testAggregateMacOSSettingsStatusWithFileVault},
{"TestMDMAppleHostsProfilesStatus", testMDMAppleHostsProfilesStatus},
{"TestMDMAppleIdPAccount", testMDMAppleIdPAccount},
{"TestIgnoreMDMClientError", testDoNotIgnoreMDMClientError},
{"TestDeleteMDMAppleProfilesForHost", testDeleteMDMAppleProfilesForHost},
{"TestGetMDMAppleCommandResults", testGetMDMAppleCommandResults},
{"TestBulkUpsertMDMAppleConfigProfiles", testBulkUpsertMDMAppleConfigProfile},
{"TestMDMAppleBootstrapPackageCRUD", testMDMAppleBootstrapPackageCRUD},
{"TestListMDMAppleCommands", testListMDMAppleCommands},
{"TestMDMAppleSetupAssistant", testMDMAppleSetupAssistant},
{"TestMDMAppleEnrollmentProfile", testMDMAppleEnrollmentProfile},
{"TestListMDMAppleSerials", testListMDMAppleSerials},
{"TestMDMAppleDefaultSetupAssistant", testMDMAppleDefaultSetupAssistant},
{"TestSetVerifiedMacOSProfiles", testSetVerifiedMacOSProfiles},
{"TestMDMAppleConfigProfileHash", testMDMAppleConfigProfileHash},
{"TestMDMAppleResetEnrollment", testMDMAppleResetEnrollment},
{"TestMDMAppleDeleteHostDEPAssignments", testMDMAppleDeleteHostDEPAssignments},
{"LockUnlockWipeMacOS", testLockUnlockWipeMacOS},
{"ScreenDEPAssignProfileSerialsForCooldown", testScreenDEPAssignProfileSerialsForCooldown},
{"MDMAppleDDMDeclarationsToken", testMDMAppleDDMDeclarationsToken},
{"MDMAppleSetPendingDeclarationsAs", testMDMAppleSetPendingDeclarationsAs},
{"SetOrUpdateMDMAppleDeclaration", testSetOrUpdateMDMAppleDDMDeclaration},
{"DEPAssignmentUpdates", testMDMAppleDEPAssignmentUpdates},
{"TestInsertMDMAsset", testInsertMDMAsset},
}

View file

@ -821,6 +821,8 @@ type MDMAppleStoreDDMStatusReportFunc func(ctx context.Context, hostUUID string,
type MDMAppleSetPendingDeclarationsAsFunc func(ctx context.Context, hostUUID string, status *fleet.MDMDeliveryStatus, detail string) error
type InsertMDMConfigAssetsFunc func(ctx context.Context, assets []fleet.MDMConfigAsset) error
type WSTEPStoreCertificateFunc func(ctx context.Context, name string, crt *x509.Certificate) error
type WSTEPNewSerialFunc func(ctx context.Context) (*big.Int, error)
@ -2157,6 +2159,9 @@ type DataStore struct {
MDMAppleSetPendingDeclarationsAsFunc MDMAppleSetPendingDeclarationsAsFunc
MDMAppleSetPendingDeclarationsAsFuncInvoked bool
InsertMDMConfigAssetsFunc InsertMDMConfigAssetsFunc
InsertMDMConfigAssetsFuncInvoked bool
WSTEPStoreCertificateFunc WSTEPStoreCertificateFunc
WSTEPStoreCertificateFuncInvoked bool
@ -5165,6 +5170,13 @@ func (s *DataStore) MDMAppleSetPendingDeclarationsAs(ctx context.Context, hostUU
return s.MDMAppleSetPendingDeclarationsAsFunc(ctx, hostUUID, status, detail)
}
func (s *DataStore) InsertMDMConfigAssets(ctx context.Context, assets []fleet.MDMConfigAsset) error {
s.mu.Lock()
s.InsertMDMConfigAssetsFuncInvoked = true
s.mu.Unlock()
return s.InsertMDMConfigAssetsFunc(ctx, assets)
}
func (s *DataStore) WSTEPStoreCertificate(ctx context.Context, name string, crt *x509.Certificate) error {
s.mu.Lock()
s.WSTEPStoreCertificateFuncInvoked = true