Skip to content

Commit

Permalink
Enhancements in the hibernation integration tests to make the compati…
Browse files Browse the repository at this point in the history
…ble (gardener#5143)

with ManagedSeeds
  • Loading branch information
krgostev authored Dec 10, 2021
1 parent 6d2c840 commit 921c308
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions test/framework/k8s_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ func ShootCreationCompleted(newShoot *gardencorev1beta1.Shoot) (bool, string) {

for _, condition := range newShoot.Status.Conditions {
if condition.Status != gardencorev1beta1.ConditionTrue {
hibernation := newShoot.Spec.Hibernation
if condition.Type == gardencorev1beta1.SeedGardenletReady && hibernation != nil && hibernation.Enabled != nil && *hibernation.Enabled {
continue
}
return false, fmt.Sprintf("condition type %s is not true yet, had message %s with reason %s", condition.Type, condition.Message, condition.Reason)
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/framework/shootframework.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type ShootConfig struct {

CreateTestNamespace bool
DisableTestNamespaceCleanup bool
SkipSeedInitialization bool
}

// ShootFramework represents the shoot test framework that includes
Expand Down Expand Up @@ -194,7 +195,7 @@ func (f *ShootFramework) AddShoot(ctx context.Context, shootName, shootNamespace
}

// seed could be temporarily offline so no specified seed is a valid state
if shoot.Spec.SeedName != nil {
if shoot.Spec.SeedName != nil && !f.Config.SkipSeedInitialization {
f.Seed, f.SeedClient, err = f.GetSeed(ctx, *shoot.Spec.SeedName)
if err != nil {
return err
Expand Down
6 changes: 4 additions & 2 deletions test/system/shoot_hibernation/hibernation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ func init() {
}

var _ = Describe("Shoot hibernation testing", func() {
f := framework.NewShootFramework(nil)
f := framework.NewShootFramework(&framework.ShootConfig{
SkipSeedInitialization: true,
})

framework.CIt("should hibernate shoot", func(ctx context.Context) {
hibernation := f.Shoot.Spec.Hibernation
if hibernation != nil && hibernation.Enabled != nil && *hibernation.Enabled {
Fail("shoot is already hibernated")
Skip("shoot is already hibernated")
}

err := f.HibernateShoot(ctx)
Expand Down
6 changes: 4 additions & 2 deletions test/system/shoot_hibernation_wakeup/hibernation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ func init() {
}

var _ = Describe("Shoot hibernation wake-up testing", func() {
f := framework.NewShootFramework(nil)
f := framework.NewShootFramework(&framework.ShootConfig{
SkipSeedInitialization: true,
})

framework.CIt("should wake up shoot", func(ctx context.Context) {
hibernation := f.Shoot.Spec.Hibernation
if hibernation == nil || hibernation.Enabled == nil || !*hibernation.Enabled {
Fail("shoot is already woken up")
Skip("shoot is already woken up")
}

err := f.WakeUpShoot(ctx)
Expand Down

0 comments on commit 921c308

Please sign in to comment.