Skip to content

Commit

Permalink
test/runtime: Remove test for agent restart
Browse files Browse the repository at this point in the history
We already have several tests covering the agent restarts in the k8s
test suite, with policies applied. Although they don't check exactly
the same things, they would fail all the same in case of endpoint
restoration or connectivity bug.

Signed-off-by: Paul Chaignon <[email protected]>
  • Loading branch information
pchaigno committed Aug 15, 2024
1 parent 29029dd commit 8deceed
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 152 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/conformance-runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ jobs:
###
# RuntimeAgentChaos Cilium agent Checking for file-descriptor leak
# RuntimeAgentChaos Cilium agent removing leftover Cilium interfaces
# RuntimeAgentChaos Connectivity over restarts Checking that during restart no traffic is dropped using Egress + Ingress Traffic
# RuntimeAgentChaos Endpoint Endpoint recovery on restart
# RuntimeAgentChaos KVStore Delete event on KVStore with CIDR identities
# RuntimeAgentChaos KVStore Validate that delete events on KVStore do not release in use identities
# RuntimeAgentFQDNPolicies Can update L7 DNS policy rules
Expand Down
1 change: 0 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ Makefile* @cilium/build
/test/k8s/updates.go @cilium/sig-agent @cilium/ci-structure
/test/runtime/kvstore.go @cilium/kvstore @cilium/ci-structure
/test/runtime/chaos_agent.go @cilium/sig-agent @cilium/ci-structure
/test/runtime/chaos_endpoint.go @cilium/endpoint @cilium/ci-structure
/tools/ @cilium/contributing
/USERS.md @cilium/community
Vagrantfile @cilium/ci-structure
Expand Down
4 changes: 0 additions & 4 deletions test/runtime/chaos.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ var _ = Describe("RuntimeAgentChaos", func() {
vm.ReportFailed()
})

Context("Endpoint", endpointChaosTest)

Context("Cilium agent", agentChaosTests)

Context("Connectivity over restarts", restartChaosTest)

Context("KVStore", kvstoreChaosTests)
})
74 changes: 0 additions & 74 deletions test/runtime/chaos_endpoint.go

This file was deleted.

71 changes: 0 additions & 71 deletions test/runtime/connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
package RuntimeTest

import (
"context"
"sync"
"time"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -290,72 +288,3 @@ var runtimeConntrackTest = func(datapathMode string) func() {
})
}
}

var restartChaosTest = func() {
var vm *helpers.SSHMeta

BeforeAll(func() {
vm = helpers.InitRuntimeHelper(helpers.Runtime, logger)
})

AfterAll(func() {
vm.CloseSSHClient()
})

It("Checking that during restart no traffic is dropped using Egress + Ingress Traffic", func() {
By("Installing sample containers")
vm.SampleContainersActions(helpers.Create, helpers.CiliumDockerNetwork)
vm.PolicyDelAll().ExpectSuccess("Cannot deleted all policies")

_, err := vm.PolicyImportAndWait(vm.GetFullPath(policiesL4Json), helpers.HelperTimeout)
Expect(err).Should(BeNil(), "Cannot install L4 policy")

Expect(vm.WaitEndpointsReady()).Should(BeTrue(), "Endpoints are not ready after timeout")

By("Starting background connection from app2 to httpd1 container")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
srvIP, err := vm.ContainerInspectNet(helpers.Httpd1)
Expect(err).Should(BeNil(), "Cannot get httpd1 server address")
type BackgroundTestAsserts struct {
res *helpers.CmdRes
time time.Time
}
backgroundChecks := []*BackgroundTestAsserts{}
var wg sync.WaitGroup
wg.Add(1)
go func() {
for {
select {
default:
res := vm.ContainerExec(
helpers.App1,
helpers.CurlFail("http://%s/", srvIP[helpers.IPv4]))
assert := &BackgroundTestAsserts{
res: res,
time: time.Now(),
}
backgroundChecks = append(backgroundChecks, assert)
case <-ctx.Done():
wg.Done()
return
}
}
}()
// Sleep a bit to make sure that the goroutine starts.
time.Sleep(50 * time.Millisecond)

err = vm.RestartCilium()
Expect(err).Should(BeNil(), "restarting Cilium failed")

By("Stopping background connections")
cancel()
wg.Wait()

GinkgoPrint("Made %d connections in total", len(backgroundChecks))
Expect(backgroundChecks).ShouldNot(BeEmpty(), "No background connections were made")
for _, check := range backgroundChecks {
check.res.ExpectSuccess("Curl from app2 to httpd1 should work but it failed at %s", check.time)
}
})
}

0 comments on commit 8deceed

Please sign in to comment.