Skip to content

Commit

Permalink
test: remove "Check Endpoint PolicyMap Generation" test
Browse files Browse the repository at this point in the history
We test whether policymaps are correctly plumbed for endpoints implicitly via
our policy tests in the CI. There is no need to have a test which explicitly
tests for their creation.

Signed-off by: Ian Vernon <ian@cilium.io>
  • Loading branch information
Ian Vernon authored and ianvernon committed Jul 18, 2019
1 parent 30ad6cb commit 0d7d198
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions test/runtime/Policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"context"
"fmt"
"os"
"strconv"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -1905,39 +1903,6 @@ var _ = Describe("RuntimePolicyImportTests", func() {
})
})

It("Check Endpoint PolicyMap Generation", func() {
endpointIDMap, err := vm.GetEndpointsIds()
Expect(err).Should(BeNil(), "Unable to get endpoint IDs")

for _, endpointID := range endpointIDMap {
epID, _ := strconv.Atoi(endpointID)
By("Checking that endpoint policy map exists for endpoint %s", endpointID)
epPolicyMap := fmt.Sprintf("/sys/fs/bpf/tc/globals/cilium_policy_%05d", epID)
vm.Exec(fmt.Sprintf("test -f %s", epPolicyMap)).ExpectSuccess(fmt.Sprintf("Endpoint policy map %s does not exist", epPolicyMap))
}

vm.SampleContainersActions(helpers.Delete, helpers.CiliumDockerNetwork)

areEndpointsDeleted := vm.WaitEndpointsDeleted()
Expect(areEndpointsDeleted).To(BeTrue())

By("Getting ID of cilium-health endpoint")
res := vm.Exec(`cilium endpoint list -o jsonpath="{[?(@.status.labels.security-relevant[0]=='reserved:health')].id}"`)
Expect(res).Should(Not(BeNil()), "Unable to get cilium-health ID")

healthID := strings.TrimSpace(res.GetStdOut())

expected := "/sys/fs/bpf/tc/globals/cilium_policy"

policyMapsInVM := vm.Exec(fmt.Sprintf("find /sys/fs/bpf/tc/globals/cilium_policy* | grep -v reserved | grep -v %s", healthID))

By("Checking that all policy maps for endpoints have been deleted")
Expect(strings.TrimSpace(policyMapsInVM.GetStdOut())).To(Equal(expected), "Only %s PolicyMap should be present", expected)

By("Creating endpoints after deleting them to restore test state")
vm.SampleContainersActions(helpers.Create, helpers.CiliumDockerNetwork)
})

It("checks policy trace output", func() {

httpd2Label := "id.httpd2"
Expand Down

0 comments on commit 0d7d198

Please sign in to comment.