mirror of
https://github.com/vee1e/KubeArmor.git
synced 2026-09-01 10:18:29 +00:00
fix(test): increase KarmorGetLogs timeout in blockposture to reduce flakiness (#2635)
Signed-off-by: Athang69 <athangkali21@gmail.com>
This commit is contained in:
parent
1f22e362be
commit
0c3b41985d
1 changed files with 6 additions and 4 deletions
|
|
@ -6,6 +6,7 @@ package blockposture
|
|||
import (
|
||||
"time"
|
||||
|
||||
pb "github.com/kubearmor/KubeArmor/protobuf"
|
||||
"github.com/kubearmor/KubeArmor/tests/util"
|
||||
. "github.com/kubearmor/KubeArmor/tests/util"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
|
|
@ -84,11 +85,12 @@ var _ = Describe("Posture", func() {
|
|||
MatchRegexp("<!DOCTYPE html>((?:.*\r?\n?)*)</html>"), true,
|
||||
)
|
||||
// check policy violation alert
|
||||
_, alerts, err := KarmorGetLogs(10*time.Second, 1)
|
||||
res, err := KarmorGetTargetAlert(10*time.Second, &pb.Alert{
|
||||
PolicyName: "DefaultPosture",
|
||||
Action: "Block",
|
||||
})
|
||||
Expect(err).To(BeNil())
|
||||
Expect(len(alerts)).To(BeNumerically(">=", 1))
|
||||
Expect(alerts[0].PolicyName).To(Equal("DefaultPosture"))
|
||||
Expect(alerts[0].Action).To(Equal("Block"))
|
||||
Expect(res.Found).To(BeTrue())
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue