fleet/server/datastore/datastore_test.go
Zach Wasserman cca4802642
Add support for query parameter in list hosts endpoint (#327)
Uses a LIKE clause to search for hosts matching the query against
columns `host_name`, `uuid`, `hardware_serial`, and `primary_ip`.

Introduces the `searchLike` helper to add the appropriate filters to the
SQL query.
2021-02-16 16:53:42 -08:00

97 lines
2.0 KiB
Go

package datastore
import (
"testing"
"github.com/fleetdm/fleet/server/kolide"
)
var testFunctions = [...]func(*testing.T, kolide.Datastore){
testOrgInfo,
testAdditionalQueries,
testEnrollSecrets,
testEnrollSecretsCaseSensitive,
testEnrollSecretRoundtrip,
testCreateInvite,
testInviteByEmail,
testInviteByToken,
testListInvites,
testDeleteInvite,
testSaveInvite,
testDeleteQuery,
testDeleteQueries,
testSaveQuery,
testListQuery,
testDeletePack,
testNewPack,
testEnrollHost,
testAuthenticateHost,
testAuthenticateHostCaseSensitive,
testLabels,
testSaveLabel,
testManagingLabelsOnPacks,
testPasswordResetRequests,
testCreateUser,
testSaveUser,
testUserByID,
testPasswordResetRequests,
testSearchHosts,
testSearchHostsLimit,
testSearchLabels,
testSearchLabelsLimit,
testListHostsInLabel,
testListUniqueHostsInLabels,
testSaveHosts,
testDeleteHost,
testListHosts,
testListHostsFilterAdditional,
testListHostsStatus,
testListHostsQuery,
testListHostsInPack,
testListPacksForHost,
testHostIDsByName,
testHostByIdentifier,
testListPacks,
testDistributedQueryCampaign,
testCleanupDistributedQueryCampaigns,
testBuiltInLabels,
testLoadPacksForQueries,
testScheduledQuery,
testDeleteScheduledQuery,
testNewScheduledQuery,
testListScheduledQueriesInPack,
testCascadingDeletionOfQueries,
testGetPackByName,
testGetQueryByName,
testAddLabelToPackTwice,
testGenerateHostStatusStatistics,
testMarkHostSeen,
testCleanupIncomingHosts,
testDuplicateNewQuery,
testChangeEmail,
testChangeLabelDetails,
testMigrationStatus,
testUnicode,
testCountHostsInTargets,
testHostStatus,
testHostIDsInTargets,
testApplyOsqueryOptions,
testApplyOsqueryOptionsNoOverrides,
testOsqueryOptionsForHost,
testApplyQueries,
testApplyPackSpecRoundtrip,
testApplyPackSpecMissingQueries,
testApplyPackSpecMissingName,
testGetPackSpec,
testApplyLabelSpecsRoundtrip,
testGetLabelSpec,
testLabelIDsByName,
testListLabelsForPack,
testHostAdditional,
testCarveMetadata,
testCarveBlocks,
testCarveListCarves,
testCarveCleanupCarves,
testCarveUpdateCarve,
}