Skip to content

Commit

Permalink
NAB suite_test
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Feb 7, 2025
1 parent de07ca5 commit 5a6cb86
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions internal/controller/nonadminbackup_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ var _ = ginkgo.Describe("Test single reconciles of NonAdminBackup Reconcile func
func testStorageLocation(name, namespace, provider, bucket, prefix string) velerov1.BackupStorageLocation {
return velerov1.BackupStorageLocation{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Name: name,
Namespace: namespace,
},
Spec: velerov1.BackupStorageLocationSpec{
Expand Down Expand Up @@ -911,7 +911,7 @@ var _ = ginkgo.Describe("Test full reconcile loop of NonAdminBackup Controller",
if scenario.enforcedBackupSpec != nil {
scenario.enforcedBackupSpec.StorageLocation = testBSL.Name
}

gomega.Expect(k8sClient.Create(ctxTimeout, nonAdminBackup)).To(gomega.Succeed())
// wait NAB reconcile
time.Sleep(2 * time.Second)
Expand Down Expand Up @@ -986,7 +986,13 @@ var _ = ginkgo.Describe("Test full reconcile loop of NonAdminBackup Controller",
return nonAdminBackup.Status.VeleroBackup.Status.Phase == velerov1.BackupPhaseCompleted, nil
}, 5*time.Second, 1*time.Second).Should(gomega.BeTrue())
}

if nonAdminBackup != nil &&
nonAdminBackup.Status.VeleroBackup != nil &&
nonAdminBackup.Status.VeleroBackup.Status != nil &&
nonAdminBackup.Status.VeleroBackup.Status.Phase == velerov1.BackupPhaseCompleted {
gomega.Expect(nonAdminBackup.Status.LogsPath).To(gomega.Not(gomega.BeZero()))
gomega.Expect(nonAdminBackup.Status.ResourceListPath).To(gomega.Not(gomega.BeZero()))
}
ginkgo.By("Waiting Reconcile of delete event")
gomega.Expect(k8sClient.Delete(ctxTimeout, nonAdminBackup)).To(gomega.Succeed())
time.Sleep(1 * time.Second)
Expand Down

0 comments on commit 5a6cb86

Please sign in to comment.