diff --git a/cmd/fleetctl/mdm_test.go b/cmd/fleetctl/mdm_test.go index 2ae64aa99cd0..b5bd96520533 100644 --- a/cmd/fleetctl/mdm_test.go +++ b/cmd/fleetctl/mdm_test.go @@ -1118,6 +1118,9 @@ func TestMDMWipeCommand(t *testing.T) { return nil, nil } } + ds.IsHostConnectedToFleetMDMFunc = func(ctx context.Context, host *fleet.Host) (bool, error) { + return host.MDM.ConnectedToFleet != nil && *host.MDM.ConnectedToFleet, nil + } appCfgAllMDM, appCfgWinMDM, appCfgMacMDM, appCfgNoMDM := setupAppConigs() appCfgScriptsDisabled := &fleet.AppConfig{ServerSettings: fleet.ServerSettings{ScriptsDisabled: true}} diff --git a/server/service/hosts_test.go b/server/service/hosts_test.go index bc07f5d7d269..e2d5d8d4ac7b 100644 --- a/server/service/hosts_test.go +++ b/server/service/hosts_test.go @@ -1560,6 +1560,9 @@ func TestLockUnlockWipeHostAuth(t *testing.T) { ds.UnlockHostManuallyFunc = func(ctx context.Context, hostID uint, platform string, ts time.Time) error { return nil } + ds.IsHostConnectedToFleetMDMFunc = func(ctx context.Context, host *fleet.Host) (bool, error) { + return true, nil + } cases := []struct { name string