backup

package
v1.30.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package backup provides Ginkgo/Gomega assertions around backup/restore flows: BackupCondition checks, ScheduledBackup scheduling/suspension, continuous archiving, restoration (with/without application DB), and PITR verification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertArchiveConditionMet

func AssertArchiveConditionMet(
	env *environment.TestingEnvironment,
	namespace, clusterName string,
	timeout int,
)

AssertArchiveConditionMet waits for the Cluster's ContinuousArchiving condition to become True within timeout seconds.

func AssertBackupConditionInClusterStatus

func AssertBackupConditionInClusterStatus(
	env *environment.TestingEnvironment,
	namespace, clusterName string,
)

AssertBackupConditionInClusterStatus checks that the backup condition in the Cluster's Status eventually becomes "True".

func AssertClusterImport

func AssertClusterImport(
	env *environment.TestingEnvironment,
	testTimeouts map[timeouts.Timeout]int,
	namespace, clusterWithExternalClusterName, clusterName, databaseName string,
) *apiv1.Cluster

AssertClusterImport imports a database into a new cluster, waits for it to be ready, and verifies the standbys are streaming.

func AssertClusterRestore

func AssertClusterRestore(
	env *environment.TestingEnvironment,
	testTimeouts map[timeouts.Timeout]int,
	namespace, restoreClusterFile, tableName string,
)

AssertClusterRestore restores a cluster from restoreClusterFile, waits for it to be ready, checks that the test data table is there, the timeline is 2, and the standbys stream from the new primary.

func AssertClusterRestoreWithApplicationDB

func AssertClusterRestoreWithApplicationDB(
	env *environment.TestingEnvironment,
	testTimeouts map[timeouts.Timeout]int,
	namespace, restoreClusterFile, tableName string,
)

AssertClusterRestoreWithApplicationDB asserts the full AssertClusterRestore flow and additionally rotates the application user password and verifies the cluster remains reachable.

func AssertClusterWasRestoredWithPITR

func AssertClusterWasRestoredWithPITR(
	env *environment.TestingEnvironment,
	testTimeouts map[timeouts.Timeout]int,
	namespace, clusterName, tableName, lsn string,
)

AssertClusterWasRestoredWithPITR verifies a PITR-restored cluster came up on the expected WAL position with both standbys streaming, and that the third record from the post-backup write is gone.

func AssertClusterWasRestoredWithPITRAndApplicationDB

func AssertClusterWasRestoredWithPITRAndApplicationDB(
	env *environment.TestingEnvironment,
	testTimeouts map[timeouts.Timeout]int,
	namespace, clusterName, tableName, lsn string,
)

AssertClusterWasRestoredWithPITRAndApplicationDB is the PITR variant of AssertClusterRestoreWithApplicationDB: verifies timeline 3, table contents, and that the application database password can be rotated.

func AssertScheduledBackupsAreScheduled

func AssertScheduledBackupsAreScheduled(
	env *environment.TestingEnvironment,
	namespace, backupYAMLPath string,
	timeout int,
)

AssertScheduledBackupsAreScheduled creates the ScheduledBackup described in backupYAMLPath and asserts that it eventually fires at least twice.

func AssertScheduledBackupsImmediate

func AssertScheduledBackupsImmediate(
	env *environment.TestingEnvironment,
	namespace, backupYAMLPath, scheduledBackupName string,
)

AssertScheduledBackupsImmediate creates the ScheduledBackup described in backupYAMLPath, asserts the first backup runs immediately, and checks that no additional backups fire within the test window.

func AssertSuspendScheduleBackups

func AssertSuspendScheduleBackups(env *environment.TestingEnvironment, namespace, scheduledBackupName string)

AssertSuspendScheduleBackups suspends and resumes a ScheduledBackup, verifying no new backups land while suspended.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL