2016-08-18 21:16:44 +00:00
|
|
|
package datastore
|
|
|
|
|
|
|
|
import (
|
2016-10-04 20:34:36 +00:00
|
|
|
"reflect"
|
|
|
|
"runtime"
|
|
|
|
"strings"
|
2016-08-18 21:16:44 +00:00
|
|
|
"testing"
|
|
|
|
|
2016-09-26 18:48:55 +00:00
|
|
|
"github.com/kolide/kolide-ose/server/kolide"
|
2016-08-18 21:16:44 +00:00
|
|
|
)
|
|
|
|
|
2016-10-04 20:34:36 +00:00
|
|
|
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,
|
2016-12-20 21:31:09 +00:00
|
|
|
testInviteByEmail,
|
2016-12-30 01:58:12 +00:00
|
|
|
testInviteByToken,
|
2016-11-16 13:47:49 +00:00
|
|
|
testListInvites,
|
|
|
|
testDeleteInvite,
|
|
|
|
testSaveInvite,
|
2016-10-04 20:34:36 +00:00
|
|
|
testDeleteQuery,
|
2016-12-09 17:12:45 +00:00
|
|
|
testDeleteQueries,
|
2016-10-04 20:34:36 +00:00
|
|
|
testSaveQuery,
|
2016-11-16 13:47:49 +00:00
|
|
|
testListQuery,
|
2016-10-04 20:34:36 +00:00
|
|
|
testDeletePack,
|
|
|
|
testEnrollHost,
|
|
|
|
testAuthenticateHost,
|
|
|
|
testLabels,
|
|
|
|
testManagingLabelsOnPacks,
|
|
|
|
testPasswordResetRequests,
|
|
|
|
testCreateUser,
|
|
|
|
testSaveUser,
|
|
|
|
testUserByID,
|
|
|
|
testPasswordResetRequests,
|
2016-11-02 14:59:53 +00:00
|
|
|
testSearchHosts,
|
|
|
|
testSearchHostsLimit,
|
|
|
|
testSearchLabels,
|
|
|
|
testSearchLabelsLimit,
|
|
|
|
testListHostsInLabel,
|
|
|
|
testListUniqueHostsInLabels,
|
2016-11-09 23:33:16 +00:00
|
|
|
testDistributedQueriesForHost,
|
2016-11-16 13:47:49 +00:00
|
|
|
testSaveHosts,
|
|
|
|
testDeleteHost,
|
|
|
|
testListHost,
|
2016-11-22 21:56:05 +00:00
|
|
|
testGetHostsInPack,
|
2016-11-23 00:35:43 +00:00
|
|
|
testDistributedQueryCampaign,
|
2016-12-01 18:31:16 +00:00
|
|
|
testCleanupDistributedQueryCampaigns,
|
2016-11-25 18:08:22 +00:00
|
|
|
testBuiltInLabels,
|
2016-12-06 18:22:28 +00:00
|
|
|
testLoadPacksForQueries,
|
2016-12-13 22:22:05 +00:00
|
|
|
testScheduledQuery,
|
|
|
|
testDeleteScheduledQuery,
|
|
|
|
testListScheduledQueriesInPack,
|
|
|
|
testSaveScheduledQuery,
|
2016-12-29 18:32:28 +00:00
|
|
|
testOptions,
|
2016-12-22 19:29:29 +00:00
|
|
|
testNewScheduledQuery,
|
2016-10-03 03:14:35 +00:00
|
|
|
}
|