Skip to content

Commit

Permalink
e2e, monitoring: test CnaoNmstateMigration alert
Browse files Browse the repository at this point in the history
Signed-off-by: Radim Hrazdil <rhrazdil@redhat.com>
  • Loading branch information
Radim Hrazdil committed Apr 4, 2022
1 parent fe63723 commit 04ceb17
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion test/e2e/monitoring/alerts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

cnao "github.com/kubevirt/cluster-network-addons-operator/pkg/apis/networkaddonsoperator/shared"
"github.com/kubevirt/cluster-network-addons-operator/pkg/components"
"github.com/kubevirt/cluster-network-addons-operator/test/kubectl"
. "github.com/kubevirt/cluster-network-addons-operator/test/check"
"github.com/kubevirt/cluster-network-addons-operator/test/kubectl"
. "github.com/kubevirt/cluster-network-addons-operator/test/operations"
)

Expand Down Expand Up @@ -58,6 +58,26 @@ var _ = Context("Prometheus Alerts", func() {
})
})

Context("when nmstate is deployed with CNAO", func() {
BeforeEach(func() {
configSpec = cnao.NetworkAddonsConfigSpec{
NMState: &cnao.NMState{},
}

By("delpoying CNAO CR with nmstate")
gvk := GetCnaoV1GroupVersionKind()
UpdateConfig(gvk, configSpec)
CheckConfigCondition(gvk, ConditionAvailable, ConditionTrue, 15*time.Minute, CheckDoNotRepeat)
})

It("should issue CnaoNmstateMigration alert", func() {
By("waiting for the amount of time it takes the alert to fire")
time.Sleep(5 * time.Minute)
By("checking existence of alert")
prometheusClient.checkForAlert("CnaoNmstateMigration")
})
})

AfterEach(func() {
By("removing CNAO CR")
gvk := GetCnaoV1GroupVersionKind()
Expand Down

0 comments on commit 04ceb17

Please sign in to comment.