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-11-16 13:47:49 +00:00
|
|
|
testListInvites,
|
|
|
|
testDeleteInvite,
|
|
|
|
testSaveInvite,
|
2016-10-04 20:34:36 +00:00
|
|
|
testDeleteQuery,
|
|
|
|
testSaveQuery,
|
2016-11-16 13:47:49 +00:00
|
|
|
testListQuery,
|
2016-10-04 20:34:36 +00:00
|
|
|
testDeletePack,
|
|
|
|
testAddAndRemoveQueryFromPack,
|
|
|
|
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-10-03 03:14:35 +00:00
|
|
|
}
|