/
test.go
51 lines (40 loc) · 1.74 KB
/
test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
//
// SPDX-License-Identifier: Apache-2.0
/**
Overview
- Tests the health checks for the shoot-dns-service extension.
Prerequisites
- A Shoot exists.
Test-case:
1) Extension CRD
1.1) HealthCondition Type: ShootControlPlaneHealthy
- update the ManagedResource 'extension-shoot-dns-service-seed' and verify the health check conditions in the Extension CRD status.
1.2) HealthCondition Type: ShootSystemComponentsHealthy
- update the ManagedResource 'extension-shoot-dns-service-shoot' and verify the health check conditions in the Extension CRD status.
**/
package healthcheck
import (
"context"
"fmt"
"time"
gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
"github.com/gardener/gardener/test/framework"
healthcheckoperation "github.com/gardener/gardener/test/testmachinery/extensions/healthcheck"
"github.com/onsi/ginkgo/v2"
"github.com/gardener/gardener-extension-shoot-dns-service/pkg/controller/lifecycle"
)
const (
timeout = 5 * time.Minute
)
var _ = ginkgo.Describe("Extension-shoot-dns-service integration test: health checks", func() {
f := framework.NewShootFramework(nil)
ginkgo.Context("Extension", func() {
ginkgo.Context("Condition type: ShootControlPlaneHealthy", func() {
f.Serial().Release().CIt(fmt.Sprintf("Extension CRD should contain unhealthy condition due to ManagedResource '%s' is unhealthy", lifecycle.SeedResourcesName), func(ctx context.Context) {
err := healthcheckoperation.ExtensionHealthCheckWithManagedResource(ctx, timeout, f, "shoot-dns-service", lifecycle.SeedResourcesName, gardencorev1beta1.ShootControlPlaneHealthy)
framework.ExpectNoError(err)
}, timeout)
})
})
})