Skip to content

Commit

Permalink
chore: unloadpolicy after load
Browse files Browse the repository at this point in the history
Signed-off-by: sadath-12 <[email protected]>

chore: do not wait

Signed-off-by: sadath-12 <[email protected]>

unload crdUnloadCRDString

Signed-off-by: sadath-12 <[email protected]>

tests: Unload policy after load

Signed-off-by: sadath-12 <[email protected]>
  • Loading branch information
sadath-12 committed Jan 4, 2024
1 parent a250225 commit 339dc5e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/e2e/tests/policyfilter/policyfilter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ func TestNamespacedPolicy(t *testing.T) {
}
return ctx
}).
Assess("uninstall policy", func(ctx context.Context, _ *testing.T, c *envconf.Config) context.Context {
ctx, err := helpers.UnloadCRDString(policyNamespace, namespacedPolicy, false)(ctx, c)
if err != nil {
klog.ErrorS(err, "failed to uninstall policy")
t.Fail()
}
return ctx
}).
Feature()

runner.TestInParallel(t, runWorkload, runEventChecker)
Expand Down Expand Up @@ -241,6 +249,14 @@ func TestPodLabelFilters(t *testing.T) {
}
return ctx
}).
Assess("uninstall policy", func(ctx context.Context, _ *testing.T, c *envconf.Config) context.Context {
ctx, err := helpers.UnloadCRDString(podlblNamespace, podlblPolicy, false)(ctx, c)
if err != nil {
klog.ErrorS(err, "failed to uninstall policy")
t.Fail()
}
return ctx
}).
Feature()

runner.TestInParallel(t, runWorkload, runEventChecker)
Expand Down
8 changes: 8 additions & 0 deletions tests/e2e/tests/skeleton/skeleton_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ func TestSkeletonBasic(t *testing.T) {
t.Fail()
}
return ctx
}).
Assess("Run Workload", func(ctx context.Context, _ *testing.T, c *envconf.Config) context.Context {
ctx, err := helpers.UnloadCRDString(namespace, curlPod, true)(ctx, c)
if err != nil {
klog.ErrorS(err, "failed to spawn workload")
t.Fail()
}
return ctx
}).Feature()

// We run our features using testenv.Test() or testenv.TestInParallel(). These take
Expand Down

0 comments on commit 339dc5e

Please sign in to comment.