mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
fix flaky TestIntegrationsMDM/TestDEPProfileAssignment (#11304)
This test was failing because we can send other commands when a DEP device is enrolling (eg: to install a bootstrap package) and the test was assuming that the first command we'll always get is the command to install `fleetd`. We have discussed in the past (@gillespi314 suggested that is important) increasing the accuracy of the timestamps in the `nano_commadns` table, which is the proper fix for this.
This commit is contained in:
parent
1fb9eeec64
commit
9cd51af022
1 changed files with 11 additions and 7 deletions
|
|
@ -558,14 +558,18 @@ func (s *integrationMDMTestSuite) TestDEPProfileAssignment() {
|
|||
d.mdmEnroll(s)
|
||||
|
||||
// make sure the host gets a request to install fleetd
|
||||
var fleetdCmd *micromdm.CommandPayload
|
||||
cmd := d.idle()
|
||||
require.NotNil(t, cmd)
|
||||
require.NotNil(t, cmd.Command)
|
||||
require.Equal(t, "InstallEnterpriseApplication", cmd.Command.RequestType)
|
||||
require.NotNil(t, cmd.Command.InstallEnterpriseApplication)
|
||||
// TODO: this seems flaky?
|
||||
// require.NotNil(t, cmd.Command.InstallEnterpriseApplication.ManifestURL)
|
||||
// require.Contains(t, *cmd.Command.InstallEnterpriseApplication.ManifestURL, apple_mdm.FleetdPublicManifestURL)
|
||||
for cmd != nil {
|
||||
if cmd.Command.RequestType == "InstallEnterpriseApplication" &&
|
||||
cmd.Command.InstallEnterpriseApplication.ManifestURL != nil &&
|
||||
strings.Contains(*cmd.Command.InstallEnterpriseApplication.ManifestURL, apple_mdm.FleetdPublicManifestURL) {
|
||||
fleetdCmd = cmd
|
||||
}
|
||||
cmd = d.acknowledge(cmd.CommandUUID)
|
||||
}
|
||||
require.NotNil(t, fleetdCmd)
|
||||
require.NotNil(t, fleetdCmd.Command)
|
||||
|
||||
// only one shows up as pending
|
||||
listHostsRes = listHostsResponse{}
|
||||
|
|
|
|||
Loading…
Reference in a new issue