Skip to content

Commit

Permalink
test: Fix cleanup after PolicyAuditMode test
Browse files Browse the repository at this point in the history
This test set the PolicyAuditMode, but didn't revert it afterwards. This
meant that subsequent tests could potentially fail because they didn't
expect this setting to be configured.

Fix it by adding an AfterAll() that turns the feature back off.

Fixes: 6cd69ed ("Implement policy audit mode for the daemon")
Fixes: #10486

CC: ap4y <aevstifeev@gitlab.com>
Signed-off-by: Joe Stringer <joe@cilium.io>
  • Loading branch information
joestringer authored and aanm committed Mar 6, 2020
1 parent 99e6bc8 commit 2a49a0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/runtime/Policies.go
@@ -1,4 +1,4 @@
// Copyright 2017-2019 Authors of Cilium
// Copyright 2017-2020 Authors of Cilium
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1471,6 +1471,10 @@ var _ = Describe("RuntimePolicies", func() {
vm.ExecCilium("config PolicyAuditMode=Enabled").ExpectSuccess("unable to change daemon configuration")
})

AfterAll(func() {
vm.ExecCilium("config PolicyAuditMode=Disabled").ExpectSuccess("unable to change daemon configuration")
})

It("tests ingress", func() {
ctx, cancel := context.WithCancel(context.Background())
By("Starting cilium monitor in background")
Expand Down

0 comments on commit 2a49a0b

Please sign in to comment.