mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
* Initial scaffolding of the host summary endpoint * inmem datastore implementation of GenerateHostStatusStatistics * HostSummary docstring * changing the url of the host summary endpoint * datastore tests for GenerateHostStatusStatistics * MySQL datastore implementation of GenerateHostStatusStatistics * <= and >= to catch exact time edge case * removing clock interface method * lowercase error wraps * removin superfluous whitespace * use updated_at * adding a seen_at column to the hosts table * moving the update of seen_time to the caller * using db.Get instead of db.Select
65 lines
1.4 KiB
Go
65 lines
1.4 KiB
Go
package datastore
|
|
|
|
import (
|
|
"reflect"
|
|
"runtime"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/kolide/kolide-ose/server/kolide"
|
|
)
|
|
|
|
func functionName(f func(*testing.T, kolide.Datastore)) string {
|
|
fullName := runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()
|
|
elements := strings.Split(fullName, ".")
|
|
return elements[len(elements)-1]
|
|
}
|
|
|
|
var testFunctions = [...]func(*testing.T, kolide.Datastore){
|
|
testOrgInfo,
|
|
testCreateInvite,
|
|
testInviteByEmail,
|
|
testInviteByToken,
|
|
testListInvites,
|
|
testDeleteInvite,
|
|
testSaveInvite,
|
|
testDeleteQuery,
|
|
testDeleteQueries,
|
|
testSaveQuery,
|
|
testListQuery,
|
|
testDeletePack,
|
|
testEnrollHost,
|
|
testAuthenticateHost,
|
|
testLabels,
|
|
testManagingLabelsOnPacks,
|
|
testPasswordResetRequests,
|
|
testCreateUser,
|
|
testSaveUser,
|
|
testUserByID,
|
|
testPasswordResetRequests,
|
|
testSearchHosts,
|
|
testSearchHostsLimit,
|
|
testSearchLabels,
|
|
testSearchLabelsLimit,
|
|
testListHostsInLabel,
|
|
testListUniqueHostsInLabels,
|
|
testDistributedQueriesForHost,
|
|
testSaveHosts,
|
|
testDeleteHost,
|
|
testListHost,
|
|
testGetHostsInPack,
|
|
testDistributedQueryCampaign,
|
|
testCleanupDistributedQueryCampaigns,
|
|
testBuiltInLabels,
|
|
testLoadPacksForQueries,
|
|
testScheduledQuery,
|
|
testDeleteScheduledQuery,
|
|
testListScheduledQueriesInPack,
|
|
testSaveScheduledQuery,
|
|
testOptions,
|
|
testNewScheduledQuery,
|
|
testOptionsToConfig,
|
|
testAddLabelToPackTwice,
|
|
testGenerateHostStatusStatistics,
|
|
testMarkHostSeen,
|
|
}
|