-
Notifications
You must be signed in to change notification settings - Fork 11
/
test.go
56 lines (47 loc) · 2.33 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
52
53
54
55
56
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Gardener contributors
//
// SPDX-License-Identifier: Apache-2.0
/**
TODO(vpnachev): Update the tests to fit lakom case
Overview
- Tests the health checks for the shoot-lakom-service extension.
Prerequisites
- A Shoot exists.
Test-case:
1) Extension CRD
1.1) HealthCondition Type: ShootControlPlaneHealthy
- update the ManagedResource 'extension-shoot-lakom-service-seed' and verify the health check conditions in the Extension CRD status.
1.2) HealthCondition Type: ShootSystemComponentsHealthy
- update the ManagedResource 'extension-shoot-lakom-service-shoot' and verify the health check conditions in the Extension CRD status.
**/
package healthcheck
import (
"context"
"fmt"
"time"
"github.com/gardener/gardener-extension-shoot-lakom-service/pkg/constants"
gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
"github.com/gardener/gardener/test/framework"
healthcheckoperation "github.com/gardener/gardener/test/testmachinery/extensions/healthcheck"
ginkgov2 "github.com/onsi/ginkgo/v2"
)
const (
timeout = 5 * time.Minute
)
var _ = ginkgov2.Describe("Extension-shoot-lakom-service integration test: health checks", func() {
f := framework.NewShootFramework(nil)
ginkgov2.Context("Extension", func() {
ginkgov2.Context("Condition type: ShootControlPlaneHealthy", func() {
f.Serial().Release().CIt(fmt.Sprintf("Extension CRD should contain unhealthy condition due to ManagedResource '%s' is unhealthy", constants.ManagedResourceNamesSeed), func(ctx context.Context) {
err := healthcheckoperation.ExtensionHealthCheckWithManagedResource(ctx, timeout, f, "shoot-lakom-service", constants.ManagedResourceNamesSeed, gardencorev1beta1.ShootControlPlaneHealthy)
framework.ExpectNoError(err)
}, timeout)
})
ginkgov2.Context("Condition type: ShootSystemComponentsHealthy", func() {
f.Serial().Release().CIt(fmt.Sprintf("Extension CRD should contain unhealthy condition due to ManagedResource '%s' is unhealthy", constants.ManagedResourceNamesShoot), func(ctx context.Context) {
err := healthcheckoperation.ExtensionHealthCheckWithManagedResource(ctx, timeout, f, "shoot-lakom-service", constants.ManagedResourceNamesShoot, gardencorev1beta1.ShootSystemComponentsHealthy)
framework.ExpectNoError(err)
}, timeout)
})
})
})