Documentation
¶
Index ¶
- Constants
- Variables
- func AddDiagnosticTeardown(name string, condition interface{}, teardownFunc func())
- func AddGlobalDiagnosticTeardown(condition interface{}, teardownFunc func())
- func AddGlobalTeardown(teardownFunc func())
- func AddTeardown(name string, teardownFunc func())
- func AdjustPodTimeout(podName string, timeout time.Duration) time.Duration
- func ApplyLicense(t *testing.T, namespace string, adminPod string, licenseType LicenseType)
- func ApplyNuoDBLicense(t *testing.T, namespace string, adminPod string)deprecated
- func ArgContains(args []string, x string) bool
- func AssertEnvContains(t *testing.T, envs []v1.EnvVar, key, expected string)
- func AssertEnvNotContains(t *testing.T, envs []v1.EnvVar, key string)
- func AssertResourceValue(t *testing.T, options *helm.Options, key string, actual *resource.Quantity)
- func Await(t *testing.T, lmbd func() bool, timeout time.Duration)
- func AwaitAdminFullyConnected(t *testing.T, namespace string, podName string, numServers int)
- func AwaitAdminKeystoreReload(t *testing.T, namespace string, podName string, adminPem string, ...)
- func AwaitBalancerTerminated(t *testing.T, namespace string, expectedName string)
- func AwaitDatabaseRestart(t *testing.T, namespace string, podName string, databaseName string, ...)
- func AwaitDatabaseUp(t *testing.T, namespace string, podName string, databaseName string, ...)
- func AwaitDomainLeader(t *testing.T, namespace string, adminPod string, timeout time.Duration) (leader string)
- func AwaitE(t *testing.T, lmbd func() bool, timeout time.Duration) error
- func AwaitJobSucceeded(t *testing.T, namespace string, jobName string, timeout time.Duration)
- func AwaitNoPods(t *testing.T, namespace string, expectedName string)
- func AwaitNrLoadBalancerPolicies(t *testing.T, namespace string, podName string, expectedNumber int)
- func AwaitNrReplicasReady(t *testing.T, namespace string, expectedName string, nrReplicas int)
- func AwaitNrReplicasScheduled(t *testing.T, namespace string, expectedName string, nrReplicas int)
- func AwaitPodHasVersion(t *testing.T, namespace string, podName string, expectedVersion string, ...)
- func AwaitPodLog(t *testing.T, namespaceName string, podName string, fileNameSuffix string)
- func AwaitPodObjectRecreated(t *testing.T, namespace string, pod *corev1.Pod, timeout time.Duration)
- func AwaitPodPhase(t *testing.T, namespace string, podName string, phase corev1.PodPhase, ...)
- func AwaitPodRestartCountGreaterThan(t *testing.T, namespace string, podName string, expectedRestartCount int32, ...)
- func AwaitPodStatus(t *testing.T, namespace string, podName string, ...)
- func AwaitPodTemplateHasVersion(t *testing.T, namespace string, podNameTemplate string, expectedVersion string, ...)
- func AwaitPodUp(t *testing.T, namespace string, adminPodName string, timeout time.Duration)
- func AwaitPvDeleted(t *testing.T, name string, timeout time.Duration)
- func AwaitServerState(t *testing.T, namespace string, adminPod string, serverId string, ...)
- func AwaitTillerUp(t *testing.T)
- func BackupCerificateFilesOnTestFailure(t *testing.T, namespaceName string, srcDirectory string)
- func BackupDatabase(t *testing.T, namespaceName string, podName string, databaseName string, ...) string
- func BackupDatabaseE(t *testing.T, namespaceName string, podName string, databaseName string, ...) error
- func ChangeCluster(t *testing.T, cluster K8sCluster) (func(), func())
- func CheckArchives(t *testing.T, namespaceName string, adminPod string, dbName string, ...) (archives []NuoDBArchive, removedArchives []NuoDBArchive)
- func CheckRestoreRequests(t *testing.T, namespaceName string, podName string, databaseName string, ...) (string, string)
- func CopyCertificatesToControlHost(t *testing.T, podName string, namespaceName string) string
- func CopyMap(m map[string]string) map[string]string
- func CreateNamespace(t *testing.T, namespaceName string)
- func CreateNginxDeployment(t *testing.T, namespaceName string)
- func CreateQuickstartSchema(t *testing.T, namespaceName string, adminPod string)
- func CreateSecret(t *testing.T, namespaceName string, certName string, secretName string, ...)
- func CreateSecretWithPassword(t *testing.T, namespaceName string, certName string, secretName string, ...)
- func CreateSecretsInVault(t *testing.T, namespaceName string, vaultName string)
- func CreateVault(t *testing.T, namespaceName string, vaultName string)
- func DeleteDatabase(t *testing.T, namespace string, dbName string, podName string)
- func DeleteJobPods(t *testing.T, namespace string, jobName string)
- func DeletePVC(t *testing.T, namespaceName string, name string)
- func DeletePod(t *testing.T, namespace string, podName string)
- func DeleteStatefulSet(t *testing.T, namespaceName string, name string)
- func DeployWithContext(t *testing.T, context context.Context, ...)
- func DescribePods(t *testing.T, namespace string, expectedName string)
- func EnableVaultKubernetesIntegration(t *testing.T, namespaceName string, vaultName string)
- func EnsureDatabaseNotRunning(t *testing.T, adminPod string, opt ExtractedOptions, ...)
- func EnvContains(envs []v1.EnvVar, key string, expected string) bool
- func EnvContainsValueFrom(envs []v1.EnvVar, key string, valueFrom *v1.EnvVarSource) bool
- func EnvFromSourceContains(envs []v1.EnvFromSource, value string) bool
- func EnvGet(envs []v1.EnvVar, key string) (string, bool)
- func ExecuteCommandsInPod(t *testing.T, namespaceName string, podName string, commands []string)
- func ExecuteInAllClusters(t *testing.T, actionFunc func(context *ClusterDeploymentContext))
- func FindAllPodsInSchema(t *testing.T, namespace string) []corev1.Pod
- func FindPod(t *testing.T, namespace string, expectedName string) (*corev1.Pod, error)
- func GenerateAndSetTLSKeys(t *testing.T, options *helm.Options, namespaceName string) (string, string)
- func GenerateCustomCertificates(t *testing.T, podName string, namespaceName string, commands []string)
- func GenerateTLSConfiguration(t *testing.T, namespaceName string, commands []string) (string, string)
- func GetAdminEventLog(t *testing.T, namespace string, podName string)
- func GetAppLog(t *testing.T, namespace string, podName string, fileNameSuffix string, ...) string
- func GetArchives(t *testing.T, namespaceName string, adminPod string, dbName string) (archives []NuoDBArchive, removedArchives []NuoDBArchive)
- func GetDaemonSet(t *testing.T, namespace string, daemonSetName string) *v1.DaemonSet
- func GetDiagnoseOnTestFailure(t *testing.T, namespace string, podName string)
- func GetDomainLeaderE(t *testing.T, namespace string, adminPod string) (string, error)
- func GetDomainServersE(t *testing.T, namespace string, adminPod string) (map[string]NuoDBServer, error)
- func GetEvents(t *testing.T, namespace string, filter metav1.ListOptions) []corev1.Event
- func GetK8sEventLog(t *testing.T, namespace string)
- func GetLatestBackup(t *testing.T, namespaceName string, podName string, databaseName string, ...) string
- func GetLatestBackupGroup(t *testing.T, namespaceName string, podName string, databaseName string) string
- func GetLoadBalancerPoliciesE(t *testing.T, namespaceName string, adminPod string) (map[string]NuoDBLoadBalancerPolicy, error)
- func GetMount(mounts []v1.VolumeMount, expectedName string) (*v1.VolumeMount, bool)
- func GetNamespaces(t *testing.T) []corev1.Namespace
- func GetNodesInternalAddresses(t *testing.T) map[string]string
- func GetNuoDBVersion(t *testing.T, namespaceName string, options *helm.Options) string
- func GetPod(t *testing.T, namespace string, podName string) *corev1.Pod
- func GetPodName(t *testing.T, namespaceName string, expectedName string) string
- func GetPodNames(t *testing.T, namespaceName string, expectedName string) []string
- func GetPodRestartCount(t *testing.T, namespace string, podName string) int32
- func GetPvc(t *testing.T, namespace string, pvcName string) *corev1.PersistentVolumeClaim
- func GetRegexOccurrenceInLog(t *testing.T, namespace string, podName string, expectedLogLine string, ...) int
- func GetReplicationController(t *testing.T, namespace string, replicationControllerName string) *corev1.ReplicationController
- func GetSecret(t *testing.T, namespace string, secretName string) *corev1.Secret
- func GetService(t *testing.T, namespaceName string, serviceName string) *corev1.Service
- func GetStatefulSet(t *testing.T, namespaceName, name string) *v1.StatefulSet
- func GetStatefulSets(t *testing.T, namespaceName string) *v1.StatefulSetList
- func GetStringOccurrenceInLog(t *testing.T, namespace string, podName string, expectedLogLine string, ...) int
- func GetUpgradedReleaseVersion(t *testing.T, options *helm.Options) string
- func GetVolume(volumes []v1.Volume, expectedName string) (*v1.Volume, bool)
- func GetVolumeClaim(vcp []v1.PersistentVolumeClaim, expectedName string) (*v1.PersistentVolumeClaim, bool)
- func HasDirectory(t *testing.T, namespace string, podName string, filename string) bool
- func HasFile(t *testing.T, namespace string, podName string, filename string) bool
- func InferVersionFromTemplate(t *testing.T, options *helm.Options)
- func InjectOpenShiftOverrides(t *testing.T, options *helm.Options)
- func InjectTestValues(t *testing.T, options *helm.Options)
- func InjectTestValuesFile(t *testing.T, options *helm.Options)
- func InjectTestVersion(t *testing.T, options *helm.Options)
- func InstallAdmin(t *testing.T, options *helm.Options, helmChartReleaseName string)
- func InstallDatabase(t *testing.T, options *helm.Options, helmChartReleaseName string)
- func InvokeBackupHook(t *testing.T, namespaceName, smPod, resourcePath string, payload ...string)
- func IsDaemonSetHotCopyEnabled(ss *appsv1.DaemonSet) bool
- func IsOpenShiftEnvironment(t *testing.T) bool
- func IsRestoreRequestSupported(t *testing.T, namespaceName string, podName string) bool
- func IsStatefulSetHotCopyEnabled(ss *appsv1.StatefulSet) bool
- func KillAdminPod(t *testing.T, namespace string, podName string)
- func KillProcess(t *testing.T, namespace string, podName string)
- func LabelNodes(t *testing.T, namespaceName string, labelName string, labelValue string)
- func LabelNodesIfMissing(t *testing.T, labelName string, defaultValue string) map[string]string
- func ListCronJobs(t *testing.T, namespace string) []batchv1beta1.CronJob
- func MapContains(actual map[string]string, expected map[string]string) (string, bool)
- func MountContains(mounts []v1.VolumeMount, expectedName string) bool
- func NewClusterDeploymentContext(parent context.Context, options *helm.Options, thisCluster K8sCluster, ...) context.Context
- func OverrideReadinessProbesTimeout(t *testing.T, options *helm.Options, timeoutSec string)
- func OverrideUpgradeContainerImage(t *testing.T, options *helm.Options)
- func PingService(t *testing.T, namespace string, serviceName string, podName string)
- func PurgeDatabaseArchives(t *testing.T, namespaceName string, adminPod string, dbName string)
- func ReadAll(path string) ([]byte, error)
- func RecoverCoresFromEngine(t *testing.T, namespaceName string, engineType string, pvcName string)
- func RemoveEmptyLines(s string) string
- func RemoveOrphanNamespaces(t *testing.T)
- func RestartDatabasePods(t *testing.T, namespaceName string, helmChartReleaseName string, ...)
- func RestoreDatabase(t *testing.T, namespaceName string, podName string, ...)
- func Retry(t *testing.T, fn func() error, attempts int, interval time.Duration) error
- func RotateTLSCertificates(t *testing.T, options *helm.Options, namespaceName string, ...)
- func RunOnNuoDBVersion(t *testing.T, versionCheckFunc func(*semver.Version) bool, ...)
- func RunOnNuoDBVersionCondition(t *testing.T, condition string, actionFunc func(*semver.Version))
- func RunOnNuoDBVersionFromOptionCondition(t *testing.T, options *helm.Options, condition string, ...)
- func RunOnNuoDBVersionFromOptions(t *testing.T, options *helm.Options, ...)
- func RunSQL(t *testing.T, namespace string, podName string, databaseName string, ...) (result string, err error)
- func ScaleDeployment(t *testing.T, namespaceName string, name string, replicas int)
- func ScaleStatefulSet(t *testing.T, namespaceName string, name string, replicas int)
- func ScaleYCSB(t *testing.T, namespaceName string, replicas int)
- func ServeFileViaHTTP(t *testing.T, namespaceName string, localFilePath string) string
- func ServePodFileViaHTTP(t *testing.T, namespaceName string, srcPodName string, filePath string) string
- func SetDeploymentUpgradeStrategyToRecreate(t *testing.T, namespaceName string, deploymentName string)
- func SkipTestOnNuoDBVersion(t *testing.T, versionCheckFunc func(*semver.Version) bool)
- func SkipTestOnNuoDBVersionCondition(t *testing.T, condition string)
- func SnapshotSm(t *testing.T, namespaceName, smPod, backupId, snapshotNameTemplate string, ...)
- func SnapshotVolume(t *testing.T, namespaceName string, pvcName string, snapName string)
- func SplitAndRender[T any](t *testing.T, output string, expectedNrObjects int, kind string) []T
- func SplitAndRenderClusterClusterRoleBinding(t *testing.T, output string, expectedNrObjects int) []rbacv1.ClusterRoleBinding
- func SplitAndRenderClusterRole(t *testing.T, output string, expectedNrObjects int) []rbacv1.ClusterRole
- func SplitAndRenderConfigMap(t *testing.T, output string, expectedNrObjects int) []v1.ConfigMap
- func SplitAndRenderCronJob(t *testing.T, output string, expectedNrObjects int) []v1beta1.CronJob
- func SplitAndRenderDaemonSet(t *testing.T, output string, expectedNrObjects int) []appsv1.DaemonSet
- func SplitAndRenderDeployment(t *testing.T, output string, expectedNrObjects int) []appsv1.Deployment
- func SplitAndRenderIngress(t *testing.T, output string, expectedNrObjects int) []networkingv1.Ingress
- func SplitAndRenderJob(t *testing.T, output string, expectedNrObjects int) []batchv1.Job
- func SplitAndRenderPersistentVolumeClaim(t *testing.T, output string, expectedNrObjects int) []v1.PersistentVolumeClaim
- func SplitAndRenderReplicationController(t *testing.T, output string, expectedNrObjects int) []v1.ReplicationController
- func SplitAndRenderRole(t *testing.T, output string, expectedNrObjects int) []rbacv1.Role
- func SplitAndRenderSecret(t *testing.T, output string, expectedNrObjects int) []v1.Secret
- func SplitAndRenderService(t *testing.T, output string, expectedNrObjects int) []v1.Service
- func SplitAndRenderServiceAccount(t *testing.T, output string, expectedNrObjects int) []v1.ServiceAccount
- func SplitAndRenderStatefulSet(t *testing.T, output string, expectedNrObjects int) []appsv1.StatefulSet
- func SplitAndRenderStorageClass(t *testing.T, output string, expectedNrObjects int) []storagev1.StorageClass
- func StartAdmin(t *testing.T, options *helm.Options, replicaCount int, namespace string) (string, string)
- func StartAdminCustomRelease(t *testing.T, options *helm.Options, replicaCount int, namespace string, ...) (string, string)
- func StartAdminNoWait(t *testing.T, options *helm.Options, replicaCount int, namespace string) (string, string)
- func StartAdminTemplate(t *testing.T, options *helm.Options, replicaCount int, namespace string, ...) (helmChartReleaseName string, namespaceName string)
- func StartDatabase(t *testing.T, namespace string, adminPod string, options *helm.Options) string
- func StartDatabaseNoWait(t *testing.T, namespace string, adminPod string, options *helm.Options) string
- func StartDatabaseTemplate(t *testing.T, namespaceName string, adminPod string, options *helm.Options, ...) (helmChartReleaseName string)
- func StartHAProxyIngress(t *testing.T, options *helm.Options, namespaceName string) string
- func StartVault(t *testing.T, options *helm.Options, namespaceName string) string
- func StartYCSBWorkload(t *testing.T, namespaceName string, options *helm.Options) (helmChartReleaseName string)
- func SuspendDatabaseBackupJobs(t *testing.T, namespaceName string, domain, dbName string, backupGroup string)
- func Teardown(name string)
- func UnmarshalClusters(s string) (err error, clusters map[string]K8sCluster)
- func UnmarshalDomainServers(s string) (err error, servers map[string]NuoDBServer)
- func UnmarshalJSONObject(t *testing.T, stringJSON string) map[string]interface{}
- func UnmarshalLoadBalancerPolicies(s string) (err error, policies map[string]NuoDBLoadBalancerPolicy)
- func UpdateDnsConfig(t *testing.T, fromCtx context.Context, toCtx context.Context)
- func UpgradeDatabase(t *testing.T, namespaceName string, helmChartReleaseName string, ...)
- func VerifyAdminKvSetAndGet(t *testing.T, podName string, namespaceName string)
- func VerifyAdminLabels(t *testing.T, namespace string, adminPod string, ...)
- func VerifyAdminState(t *testing.T, namespace string, podName string)
- func VerifyCertificateInLog(t *testing.T, namespace string, podName string, expectedLogLine string)
- func VerifyLicense(t *testing.T, namespace string, podName string, expected LicenseType)
- func VerifyLicenseE(t *testing.T, namespace string, podName string, expected LicenseType) error
- func VerifyLicenseFile(t *testing.T, namespace string, podName string, expectedLicense string)
- func VerifyLicenseIsCommunity(t *testing.T, namespace string, podName string)deprecated
- func VerifyLicensingErrorsInLog(t *testing.T, namespace string, podName string, expectError bool)
- func VerifyPolicyInstalled(t *testing.T, namespace string, podName string)
- func VerifyTeardown(t *testing.T)
- func VolumesContains(mounts []v1.Volume, expectedName string) bool
- func WithClusterDeployment(t *testing.T, context *ClusterDeploymentContext, ...)
- type AdminInstallationStep
- type BackupHookResponse
- type CONTEXT_KEY
- type ClusterDeploymentContext
- type ContainersNotStarted
- type DBVersion
- type DatabaseInstallationStep
- type ExtractedOptions
- type K8sCluster
- type LicenseType
- type NuoDBArchive
- type NuoDBCertInfo
- type NuoDBCertificateInfo
- type NuoDBDatabase
- type NuoDBKubeConfig
- type NuoDBLoadBalancerConfig
- func GetDatabaseLoadBalancerConfigE(t *testing.T, dbName string, loadBalancerConfigs []NuoDBLoadBalancerConfig) (*NuoDBLoadBalancerConfig, error)
- func GetGlobalLoadBalancerConfigE(t *testing.T, loadBalancerConfigs []NuoDBLoadBalancerConfig) (*NuoDBLoadBalancerConfig, error)
- func GetLoadBalancerConfigE(t *testing.T, namespaceName string, adminPod string) ([]NuoDBLoadBalancerConfig, error)
- func UnmarshalLoadBalancerConfigs(s string) (err error, lbConfigs []NuoDBLoadBalancerConfig)
- type NuoDBLoadBalancerPolicy
- type NuoDBProcess
- type NuoDBServer
- type NuoDBServerRoleInfo
- type NuoDBServerState
- type NuoDBServerTermIndexInfo
- type NuoDBStatefulSets
- type NuoDBStorageGroup
- type Registry
- type UpgradeOptions
Constants ¶
const ( DNS_CONFIG_MARKER = "# BEGIN BASE CONFIG" COREDNS_NS = "kube-system" COREDNS_CM = "coredns" COREFILE_KEY = "Corefile" DNS_SERVICE = "dns-service" )
const ADMIN_API_INGRESS_HOSTNAME = "api.nuodb.local"
FQDNs used for Ingress testing that point to minikube IP address; they must be aligned with the /etc/hosts entries in the `install_deps.sh` script
const ADMIN_HELM_CHART_PATH = "../../stable/admin"
const ADMIN_SQL_INGRESS_HOSTNAME = "sql.nuodb.local"
const ALWAYS_RUN_DIAGNOSTIC_TEARDOWNS = "ALWAYS_RUN_DIAGNOSTIC_TEARDOWNS"
const CA_CERT_FILE = "ca.cert"
const CA_CERT_FILE_NEW = "ca_new.cert"
const CA_CERT_SECRET = "nuodb-ca-cert"
const CERTIFICATES_BACKUP_PATH = "/tmp/keys_backup"
const CERTIFICATES_GENERATION_PATH = "/tmp/keys"
const CONTEXT_CLUSTER_KEY = CONTEXT_KEY("cluster")
const DATABASE_HELM_CHART_PATH = "../../stable/database"
const DATABASE_TE_INGRESS_HOSTNAME = "demo.nuodb.local"
const DEBUG_POD = `` /* 448-byte string literal not displayed */
const IMPORT_ARCHIVE_FILE = "../files/restore.bak.tz"
const IMPORT_SG0_BACKUP_FILE = "../files/backup-sg0.bak.tz"
const IMPORT_SG1_BACKUP_FILE = "../files/backup-sg1.bak.tz"
const INJECT_CLUSTERS_FILE = "../../clustersInject.yaml"
const INJECT_FILE = "../../versionInject.yaml"
const INJECT_VALUES_FILE = "../../valuesInject.yaml"
const K8S_EVENT_LOG_FILE = "kubernetes_event.log"
const KEYSTORE_FILE = "nuoadmin.p12"
const KEYSTORE_SECRET = "nuodb-keystore"
const MINIMAL_VIABLE_ENGINE_CPU = "500m"
suffix "m" for spec.containers[].resources.requests.cpu denotes "millicores", and 1 CPU is equivalent to 1000m
const MINIMAL_VIABLE_ENGINE_MEMORY = "500Mi"
const NAMESPACE_NAME_PREFIX = "test"
const NAMESPACE_RETENTION_PERIOD = 5 * time.Hour
const NGINX_DEPLOYMENT = "nginx"
const NUOCMD_FILE = "nuocmd.pem"
const NUOCMD_SECRET = "nuodb-client-pem"
const RESTORE_HELM_CHART_PATH = "../../stable/restore"
const RESULT_DIR = "../../results"
const SECRET_PASSWORD = "changeIt"
const SNAPSHOTABLE_STORAGE_CLASS = "csi-hostpath-sc"
const SNAPSHOT_TEMPLATE = `` /* 162-byte string literal not displayed */
const TEARDOWN_ADMIN = "admin"
const TEARDOWN_BACKUP = "backup"
const TEARDOWN_COLLECTOR = "nuocollector"
const TEARDOWN_CSIDRIVER_FS = "csidriver-fs"
const TEARDOWN_DATABASE = "database"
const TEARDOWN_HAPROXY = "haproxy"
const TEARDOWN_MULTICLUSTER = "multicluster"
const TEARDOWN_NGINX = "nginx"
const TEARDOWN_RESTORE = "restore"
const TEARDOWN_SECRETS = "secrets"
const TEARDOWN_VAULT = "vault"
const TEARDOWN_YCSB = "ycsb"
const THP_HELM_CHART_PATH = "../../stable/transparent-hugepage"
const TLS_GENERATOR_POD_TEMPLATE = `` /* 170-byte string literal not displayed */
const TLS_SECRET_NO_PASSWORD_YAML_TEMPLATE = `---
apiVersion: v1
kind: Secret
metadata:
name: %s
namespace: %s
apiVersion: v1
data:
%s: %s
`
const TLS_SECRET_PASSWORD_YAML_TEMPLATE = `---
apiVersion: v1
kind: Secret
metadata:
name: %s
namespace: %s
apiVersion: v1
data:
%s: %s
password: %s
`
const TRUSTSTORE_FILE = "nuoadmin-truststore.p12"
const TRUSTSTORE_SECRET = "nuodb-truststore"
const UPGRADE_INJECT_FILE = "../../upgradeInject.yaml"
const UPGRADE_STRATEGY = `
spec:
strategy:
$retainKeys:
- type
type: Recreate
`
const VOLUME_SNAPSHOT_CLASS = "csi-hostpath-snapclass"
const YCSB_CONTROLLER_NAME = "ycsb-load"
const YCSB_HELM_CHART_PATH = "../../incubator/demo-ycsb"
Variables ¶
var AlwaysRunDiagnosticTeardowns = strings.EqualFold(os.Getenv(ALWAYS_RUN_DIAGNOSTIC_TEARDOWNS), "true")
* Exported var - initialised from the EnvVar, but can be reset in code if desired
var MULTI_CLUSTER_1 = K8sCluster{
Name: "cluster-nuodb-1",
Domain: "cluster1.local",
Context: "yin",
}
var MULTI_CLUSTER_2 = K8sCluster{
Name: "cluster-nuodb-2",
Domain: "cluster2.local",
Context: "yang",
}
var NuoDBVersionRegex = regexp.MustCompile(`^([0-9]+\.[0-9]+(?:\.[0-9]+)?).*$`)
Functions ¶
func AddDiagnosticTeardown ¶
func AddDiagnosticTeardown(name string, condition interface{}, teardownFunc func())
*
- add a diagnostic teardown func to be called before any other teardowns in the named list - to aid diagnostics/debugging.
- This allows a diagnostic teardown to do such things as:
- <ul>
- <li>Generate logging and debug information immediately prior to resurce teardown
- <li>call time.Sleep() to allow inspection and/or debugging of the exit state before teardown.
- <ul> *
- NOTE: it is generally undesirable to add multiple diagnostic teardowns that sleep - so it would usually be best to
- add any Sleep() debug teardown to the innermost teardown list.
- Nonetheless, there are use-cases where multiple Sleep() teardowns are useful - to allow inspecting different
- intermediate states.
func AddGlobalDiagnosticTeardown ¶ added in v3.2.0
func AddGlobalDiagnosticTeardown(condition interface{}, teardownFunc func())
*
- Adds a diagnostic teardown function to all named diagnostic teardown lists - for deferred execution. *
- The teardown functions are called in reverse order of insertion, by a call to Teardown(name). *
func AddGlobalTeardown ¶ added in v3.2.0
func AddGlobalTeardown(teardownFunc func())
*
- Adds a teardown function to all named teardown lists - for deferred execution. *
- The teardown functions are called in reverse order of insertion, by a call to Teardown(name). *
func AddTeardown ¶
func AddTeardown(name string, teardownFunc func())
*
- add a teardown function to the named list - for deferred execution. *
- The teardown functions are called in reverse order of insertion, by a call to Teardown(name). *
- The typical idiom is:
- <pre>
- testlib.AddTeardown("DATABASE", func() { ...})
- // possibly more testlib.AddTeardown("DATABASE", func() { ... })
- defer testlib.Teardown("DATABASE")
- <pre>
func AdjustPodTimeout ¶ added in v3.4.0
func ApplyLicense ¶ added in v3.7.0
func ApplyLicense(t *testing.T, namespace string, adminPod string, licenseType LicenseType)
func ApplyNuoDBLicense
deprecated
added in
v3.2.0
func ArgContains ¶
func AssertEnvContains ¶ added in v3.8.0
func AssertEnvNotContains ¶ added in v3.8.0
func AssertResourceValue ¶ added in v3.5.0
func AwaitAdminKeystoreReload ¶ added in v3.7.0
func AwaitBalancerTerminated ¶
func AwaitDatabaseRestart ¶
func AwaitDatabaseUp ¶
func AwaitDomainLeader ¶ added in v3.3.0
func AwaitJobSucceeded ¶ added in v3.1.0
func AwaitNrReplicasReady ¶
func AwaitPodHasVersion ¶
func AwaitPodLog ¶ added in v3.2.0
func AwaitPodObjectRecreated ¶
func AwaitPodPhase ¶
func AwaitPodStatus ¶
func AwaitPodStatus(t *testing.T, namespace string, podName string, condition corev1.PodConditionType, status corev1.ConditionStatus, timeout time.Duration)
func AwaitPodUp ¶
func AwaitPvDeleted ¶ added in v3.4.0
func AwaitServerState ¶ added in v3.3.0
func AwaitTillerUp ¶
func BackupDatabase ¶ added in v3.1.0
func BackupDatabaseE ¶ added in v3.6.0
func ChangeCluster ¶ added in v3.2.0
func ChangeCluster(t *testing.T, cluster K8sCluster) (func(), func())
*
- Change kubectl current context *
- A change and revert functions are returned so that
- the caller can use them. *
func CheckArchives ¶ added in v3.1.0
func CheckArchives(t *testing.T, namespaceName string, adminPod string, dbName string, numExpected int, numExpectedRemoved int) (archives []NuoDBArchive, removedArchives []NuoDBArchive)
func CheckRestoreRequests ¶ added in v3.2.0
func CreateNamespace ¶
func CreateNginxDeployment ¶ added in v3.2.0
func CreateQuickstartSchema ¶ added in v3.2.0
func CreateSecret ¶
func CreateSecretsInVault ¶ added in v3.2.0
func CreateVault ¶ added in v3.2.0
func DeleteDatabase ¶
func DeleteJobPods ¶ added in v3.5.0
func DeleteStatefulSet ¶ added in v3.3.0
func DeployWithContext ¶ added in v3.2.0
func DeployWithContext(t *testing.T, context context.Context, deployFunc func(context *ClusterDeploymentContext, options *helm.Options))
*
- Deploy NuoDB Helm charts using deployment context *
- This function is typically used when performing a multi-cluster deployment. *
- The typical idiom is:
- <pre>
- testlib.DeployWithContext(t,
- deploymentContext,
- func(context *testlib.ClusterDeploymentContext, options *helm.Options) {
- testlib.CreateNamespace(t, namespaceName)
- testlib.StartAdminCustomRelease(t, options, 1, namespaceName, adminReleaseName)
- admin0 := fmt.Sprintf("%s-nuodb-%s-0", adminReleaseName, context.ThisCluster.Name)
- databaseReleaseName := testlib.StartDatabase(t, namespaceName, admin0, options)
- // Store deployment details in the context
- context.AdminReleaseName = adminReleaseName
- context.DatabaseReleaseName = databaseReleaseName
- context.Namespace = namespaceName
- },
- )
- <pre>
func DescribePods ¶ added in v3.2.0
func EnableVaultKubernetesIntegration ¶ added in v3.2.0
func EnsureDatabaseNotRunning ¶
func EnsureDatabaseNotRunning(t *testing.T, adminPod string, opt ExtractedOptions, kubectlOptions *k8s.KubectlOptions)
func EnvContainsValueFrom ¶
func EnvFromSourceContains ¶
func EnvFromSourceContains(envs []v1.EnvFromSource, value string) bool
func ExecuteCommandsInPod ¶
func ExecuteInAllClusters ¶ added in v3.2.0
func ExecuteInAllClusters(t *testing.T, actionFunc func(context *ClusterDeploymentContext))
*
- Execute arbitrary actions on all known cluster deployments *
- The cluster deployment is stored in clusterDeployments variable when
- a deployment context for it is created. *
func FindAllPodsInSchema ¶ added in v3.5.0
func GenerateAndSetTLSKeys ¶
func GetArchives ¶ added in v3.6.0
func GetArchives(t *testing.T, namespaceName string, adminPod string, dbName string) (archives []NuoDBArchive, removedArchives []NuoDBArchive)
func GetDaemonSet ¶
func GetDomainLeaderE ¶ added in v3.3.0
func GetDomainServersE ¶ added in v3.3.0
func GetK8sEventLog ¶
func GetLatestBackup ¶ added in v3.1.0
func GetLatestBackupGroup ¶ added in v3.7.0
func GetMount ¶ added in v3.1.0
func GetMount(mounts []v1.VolumeMount, expectedName string) (*v1.VolumeMount, bool)
func GetNodesInternalAddresses ¶ added in v3.4.0
func GetNuoDBVersion ¶ added in v3.3.0
func GetPodNames ¶ added in v3.3.0
func GetPodRestartCount ¶
func GetRegexOccurrenceInLog ¶
func GetService ¶
func GetStatefulSet ¶ added in v3.5.0
func GetStatefulSet(t *testing.T, namespaceName, name string) *v1.StatefulSet
func GetStatefulSets ¶ added in v3.3.0
func GetStatefulSets(t *testing.T, namespaceName string) *v1.StatefulSetList
func GetVolumeClaim ¶ added in v3.3.0
func GetVolumeClaim(vcp []v1.PersistentVolumeClaim, expectedName string) (*v1.PersistentVolumeClaim, bool)
func HasDirectory ¶ added in v3.7.0
func InstallAdmin ¶ added in v3.5.0
func InstallDatabase ¶ added in v3.1.0
func InvokeBackupHook ¶ added in v3.8.0
func IsOpenShiftEnvironment ¶
func IsRestoreRequestSupported ¶ added in v3.2.0
func IsStatefulSetHotCopyEnabled ¶
func IsStatefulSetHotCopyEnabled(ss *appsv1.StatefulSet) bool
func LabelNodes ¶
func LabelNodesIfMissing ¶ added in v3.9.0
LabelNodesIfMissing checks if all Nodes in the cluster have a labelName label. Any that do not, have that label set to defaultValue. It returns the list of all current values encountered.
func ListCronJobs ¶ added in v3.5.0
func ListCronJobs(t *testing.T, namespace string) []batchv1beta1.CronJob
func MapContains ¶ added in v3.5.0
func MountContains ¶
func MountContains(mounts []v1.VolumeMount, expectedName string) bool
func NewClusterDeploymentContext ¶ added in v3.2.0
func NewClusterDeploymentContext(parent context.Context, options *helm.Options, thisCluster K8sCluster, entrypointCluster K8sCluster) context.Context
*
- Creates cluster deployment context *
- New cluster deployment context will be created and attached to
- provided parent context. The new context will be stored in
- clusterDeployments global map so that it can be used later if needed. *
- The typical idiom is:
- <pre>
- defer testlib.Teardown(testlib.TEARDOWN_MULTICLUSTER) *
- context := context.Background()
- deploymentContext := testlib.NewClusterDeploymentContext(context,
- &helm.Options{},
- testlib.MULTI_CLUSTER_1,
- testlib.MULTI_CLUSTER_1)
- <pre>
func OverrideReadinessProbesTimeout ¶ added in v3.4.0
func OverrideUpgradeContainerImage ¶ added in v3.2.0
func PingService ¶
func PurgeDatabaseArchives ¶ added in v3.3.0
func RecoverCoresFromEngine ¶
func RemoveEmptyLines ¶
func RemoveOrphanNamespaces ¶ added in v3.3.0
func RestartDatabasePods ¶ added in v3.5.0
func RestoreDatabase ¶ added in v3.1.0
func RotateTLSCertificates ¶
func RunOnNuoDBVersion ¶ added in v3.3.0
func RunOnNuoDBVersionCondition ¶ added in v3.3.0
func RunOnNuoDBVersionFromOptionCondition ¶ added in v3.7.0
func RunOnNuoDBVersionFromOptions ¶ added in v3.7.0
func ScaleDeployment ¶ added in v3.6.0
func ScaleStatefulSet ¶ added in v3.3.0
func ServeFileViaHTTP ¶ added in v3.5.0
func ServePodFileViaHTTP ¶ added in v3.2.0
func SkipTestOnNuoDBVersion ¶ added in v3.3.0
func SkipTestOnNuoDBVersionCondition ¶ added in v3.3.0
*
- Skip test if NuoDB version matches the provided condition. *
- For more information about supported condition strings, please
- check https://github.com/Masterminds/semver. *
func SnapshotSm ¶ added in v3.8.0
func SnapshotVolume ¶ added in v3.8.0
Create a snapshot of a pvc and wait for it to become ready
func SplitAndRender ¶ added in v3.8.0
func SplitAndRenderClusterClusterRoleBinding ¶ added in v3.9.0
func SplitAndRenderClusterRole ¶ added in v3.9.0
func SplitAndRenderConfigMap ¶
func SplitAndRenderCronJob ¶ added in v3.1.0
func SplitAndRenderDaemonSet ¶
func SplitAndRenderIngress ¶ added in v3.5.0
func SplitAndRenderJob ¶ added in v3.1.0
func SplitAndRenderPersistentVolumeClaim ¶ added in v3.8.0
func SplitAndRenderRole ¶
func SplitAndRenderSecret ¶
func SplitAndRenderService ¶
func SplitAndRenderServiceAccount ¶ added in v3.5.0
func StartAdmin ¶
func StartAdminCustomRelease ¶ added in v3.2.0
func StartAdminNoWait ¶ added in v3.5.0
func StartAdminTemplate ¶
func StartDatabase ¶
func StartDatabaseNoWait ¶ added in v3.1.0
func StartDatabaseTemplate ¶
func StartHAProxyIngress ¶ added in v3.5.0
func StartVault ¶ added in v3.2.0
func StartYCSBWorkload ¶
func SuspendDatabaseBackupJobs ¶ added in v3.5.0
func Teardown ¶
func Teardown(name string)
*
- Call the stored teardown functions in the named list, in the correct order (last-in-first-out) *
- NOTE: Any DIAGNOSTIC teardowns - those added with AddDiagnosticTeardown() for this name - are called BEFORE any other teardowns for this name. *
- The typical use of Teardown is with a deferred call:
- defer testlib.Teardown("SOME NAME")
- See: testlib.AddTeardown(); testlib.AddDiagnosticTeardown()
func UnmarshalClusters ¶ added in v3.2.0
func UnmarshalClusters(s string) (err error, clusters map[string]K8sCluster)
func UnmarshalDomainServers ¶ added in v3.3.0
func UnmarshalDomainServers(s string) (err error, servers map[string]NuoDBServer)
func UnmarshalJSONObject ¶
func UnmarshalLoadBalancerPolicies ¶
func UnmarshalLoadBalancerPolicies(s string) (err error, policies map[string]NuoDBLoadBalancerPolicy)
func UpdateDnsConfig ¶ added in v3.8.0
UpdateDnsConfig adds the DNS server from one cluster as an upstream resolver for the other, replacing any stale IP addresses that may currently be appear in the CoreDNS configuration.
func UpgradeDatabase ¶ added in v3.3.0
func VerifyAdminKvSetAndGet ¶
func VerifyAdminLabels ¶ added in v3.9.0
func VerifyAdminLabels(t *testing.T, namespace string, adminPod string, expectedLabelValues map[string]string)
VerifyAdminLabels checks if adminPod in namespace has all the label values in expectedLabelValues
func VerifyCertificateInLog ¶
func VerifyLicense ¶ added in v3.7.0
func VerifyLicense(t *testing.T, namespace string, podName string, expected LicenseType)
func VerifyLicenseE ¶ added in v3.7.0
func VerifyLicenseFile ¶
func VerifyLicenseIsCommunity
deprecated
func VerifyPolicyInstalled ¶
func VerifyTeardown ¶
* * Verify all teardownLists have been executed already; and throw an require if not. * Can be used to verify correct coding of a test that uses teardown - and to ensure eventual release of resources. * * NOTE: while the funcs are called in the correct order for each list, * there can be NO guarantee that the lists are iterated in the correct order. * * This function MUST NOT be used as a replacement for calling teardown() at the correct point in the code.
func WithClusterDeployment ¶ added in v3.2.0
func WithClusterDeployment(t *testing.T, context *ClusterDeploymentContext, actionsFunc func(context *ClusterDeploymentContext))
*
- Execute arbitrary actions in context of a cluster deployment *
- The deployment context will be passed in the custom function as parameter
- which can be used to obtain information about the deployment. *
Types ¶
type AdminInstallationStep ¶
type BackupHookResponse ¶ added in v3.8.0
func GetBackupHookResponse ¶ added in v3.8.0
func GetBackupHookResponse(t *testing.T, namespaceName, smPod, resourcePath string, payload ...string) *BackupHookResponse
type CONTEXT_KEY ¶ added in v3.2.0
type CONTEXT_KEY string
type ClusterDeploymentContext ¶ added in v3.2.0
type ClusterDeploymentContext struct { Options *helm.Options ThisCluster K8sCluster EntrypointCluster K8sCluster AdminReleaseName string DatabaseReleaseName string Namespace string }
func GetClusterDeploymentContext ¶ added in v3.8.0
func GetClusterDeploymentContext(t *testing.T, context context.Context) *ClusterDeploymentContext
type ContainersNotStarted ¶ added in v3.5.0
type ContainersNotStarted struct {
Name string
}
func (*ContainersNotStarted) Error ¶ added in v3.5.0
func (e *ContainersNotStarted) Error() string
type ExtractedOptions ¶
type ExtractedOptions struct { NrTePods int NrSmHotCopyPods int NrSmNoHotCopyPods int NrSmPods int DbName string ClusterName string EntrypointClusterName string DbPrimaryRelease bool DomainName string }
func GetExtractedOptions ¶
func GetExtractedOptions(options *helm.Options) (opt ExtractedOptions)
type K8sCluster ¶ added in v3.2.0
type K8sCluster struct { Name string `json:"name"` Domain string `json:"domain"` Context string `json:"context"` }
func InjectClusters ¶ added in v3.2.0
func InjectClusters(t *testing.T, cluster K8sCluster) K8sCluster
*
- Injects user-defined Kubernetes cluster information *
- The information is expected to be in stored in
- clustersInject.yaml file in JSON format as a list.
- See all cluster names in MULTI_CLUSTER_* constants. *
type LicenseType ¶ added in v3.7.0
type LicenseType string
const ( UNLICENSED LicenseType = "UNLICENSED" LIMITED LicenseType = "LIMITED" ENTERPRISE LicenseType = "ENTERPRISE" )
type NuoDBArchive ¶
type NuoDBArchive struct { Id int `json:"id"` DbName string `json:"dbName"` Path string `json:"path"` State string `json:"state"` JournalPath string `json:"journalPath"` }
func UnmarshalArchives ¶
func UnmarshalArchives(s string) (err error, archives []NuoDBArchive)
type NuoDBCertInfo ¶ added in v3.7.0
type NuoDBCertificateInfo ¶ added in v3.7.0
type NuoDBCertificateInfo struct { ServerCertificates map[string]NuoDBCertInfo `json:"serverCertificates"` ProcessCertificates map[string]NuoDBCertInfo `json:"processCertificates"` TrustedCertificates map[string]NuoDBCertInfo `json:"trustedCertificates"` }
func UnmarshalCertificateInfo ¶ added in v3.7.0
func UnmarshalCertificateInfo(s string) (err error, info NuoDBCertificateInfo)
type NuoDBDatabase ¶
type NuoDBDatabase struct { Incarnation DBVersion `json:"incarnation"` Name string `json:"name"` Processes string `json:"processes"` State string `json:"state"` }
func GetDatabaseE ¶ added in v3.6.0
func UnmarshalDatabase ¶
func UnmarshalDatabase(s string) (err error, databases []NuoDBDatabase)
type NuoDBKubeConfig ¶
type NuoDBKubeConfig struct { Pods map[string]corev1.Pod `json:"pods"` Deployments map[string]v1.Deployment `json:"deployments"` StatefulSets map[string]v1.StatefulSet `json:"statefulsets"` Volumes map[string]corev1.Volume `json:"volumes"` DaemonSets map[string]v1.DaemonSet `json:"daemonSets"` }
func GetNuoDBK8sConfigDump ¶
func GetNuoDBK8sConfigDump(t *testing.T, namespace string, podName string) NuoDBKubeConfig
func UnmarshalNuoDBKubeConfig ¶
func UnmarshalNuoDBKubeConfig(s string) (err error, kubeConfigs []NuoDBKubeConfig)
type NuoDBLoadBalancerConfig ¶
type NuoDBLoadBalancerConfig struct { DbName string `json:"dbName"` DefaultLbQuery string `json:"defaultLbQuery"` Prefilter string `json:"prefilter"` IsGlobal bool `json:"isGlobal"` }
func GetDatabaseLoadBalancerConfigE ¶ added in v3.3.0
func GetDatabaseLoadBalancerConfigE(t *testing.T, dbName string, loadBalancerConfigs []NuoDBLoadBalancerConfig) (*NuoDBLoadBalancerConfig, error)
func GetGlobalLoadBalancerConfigE ¶ added in v3.3.0
func GetGlobalLoadBalancerConfigE(t *testing.T, loadBalancerConfigs []NuoDBLoadBalancerConfig) (*NuoDBLoadBalancerConfig, error)
func GetLoadBalancerConfigE ¶
func UnmarshalLoadBalancerConfigs ¶
func UnmarshalLoadBalancerConfigs(s string) (err error, lbConfigs []NuoDBLoadBalancerConfig)
type NuoDBLoadBalancerPolicy ¶
type NuoDBProcess ¶
type NuoDBProcess struct { Address string `json:"address"` DbName string `json:"dbName"` Type string `json:"type"` Host string `json:"host"` Hostname string `json:"hostname"` Labels map[string]string `json:"labels"` IpAddress string `json:"ipAddress"` Options map[string]string `json:"options"` NodeId int32 `json:"nodeId"` StartId string `json:"startId"` State string `json:"state"` DState string `json:"durableState"` }
func GetDatabaseProcessesE ¶ added in v3.3.0
func Unmarshal ¶
func Unmarshal(s string) (err error, processes []NuoDBProcess)
type NuoDBServer ¶ added in v3.3.0
type NuoDBServer struct { Address string `json:"address"` ConnectedState NuoDBServerState `json:"connectedState"` Id string `json:"id"` IsEvicted bool `json:"isEvicted"` IsLocal bool `json:"isLocal"` LocalRoleInfo NuoDBServerRoleInfo `json:"localRoleInfo"` PeerMemberState string `json:"peerMemberState"` PeerState string `json:"peerState"` Version string `json:"version"` Labels map[string]string `json:"labels"` }
type NuoDBServerRoleInfo ¶ added in v3.3.0
type NuoDBServerRoleInfo struct { LeaderServerId string `json:"leaderServerId"` LocalPeerTermIndexInfo NuoDBServerTermIndexInfo `json:"localPeerTermIndexInfo"` Role string `json:"role"` }
type NuoDBServerState ¶ added in v3.3.0
type NuoDBServerTermIndexInfo ¶ added in v3.3.0
type NuoDBStatefulSets ¶ added in v3.3.0
type NuoDBStatefulSets struct { AdminSet v1.StatefulSet SmNonHCSet v1.StatefulSet SmHCSet v1.StatefulSet }
func FindAllStatefulSets ¶ added in v3.3.0
func FindAllStatefulSets(t *testing.T, namespaceName string) NuoDBStatefulSets
type NuoDBStorageGroup ¶ added in v3.6.0
type NuoDBStorageGroup struct { Id int `json:"sgId"` Name string `json:"sgName"` DbName string `json:"dbName"` State string `json:"state"` ArchiveStates map[string]string `json:"archiveStates"` ProcessStates map[string]string `json:"processStates"` LeaderCandidates []string `json:"leaderCandidates"` }
func AwaitStorageGroup ¶ added in v3.6.0
func GetStorageGroup ¶ added in v3.6.0
func GetStorageGroup(t *testing.T, namespaceName, adminPod, dbName, sgName string) *NuoDBStorageGroup
func UnmarshalStorageGroups ¶ added in v3.6.0
func UnmarshalStorageGroups(s string) (err error, sgs []NuoDBStorageGroup)
type Registry ¶
type Registry struct { Nuodb struct { Image struct { Registry string Repository string Tag string } } }
func UnmarshalImageYAML ¶
UnmarshalImageYAML is used to unmarshal into map[string]string
type UpgradeOptions ¶ added in v3.3.0
Source Files
¶
- NuoDBArchive.go
- NuoDBCertificateInfo.go
- NuoDBDatabase.go
- NuoDBKubeConfig.go
- NuoDBLoadBalancerConfig.go
- NuoDBLoadBalancerPolicy.go
- NuoDBProcess.go
- NuoDBRegistryEntry.go
- NuoDBServer.go
- NuoDBStorageGroup.go
- constants.go
- core_recovery.go
- haproxy_utilities.go
- hashicorp_utilities.go
- minikube_utilities.go
- multicluster_utilities.go
- nuodb_admin_utilities.go
- nuodb_database_utilities.go
- nuodb_ycsb_utilities.go
- open_shift_utilities.go
- secrets.go
- template_utilities.go
- testlib.go
- tls.go
- upgrade_utilities.go