Skip to content

Commit 7240ea6

Browse files
committed
update integration test pods to refresh logs
Several of the tests, particularly TestApplicationGoCounter in app_test.go, because packet counts in the logs aren't incrementing. This change causes the logs to refresh the logs so the packet count changes can be detected. Signed-off-by: Billy McFall <[email protected]>
1 parent 1cc7c2c commit 7240ea6

File tree

9 files changed

+16238
-7
lines changed

9 files changed

+16238
-7
lines changed

release-v0.5.6/bpfman-crds-install.yaml

Lines changed: 7664 additions & 0 deletions
Large diffs are not rendered by default.

release-v0.5.6/bpfman-operator-install.yaml

Lines changed: 8567 additions & 0 deletions
Large diffs are not rendered by default.

test/integration/app_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func TestApplicationGoCounter(t *testing.T) {
6565
}
6666

6767
for idx, f := range checkFunctions {
68-
req := env.Cluster().Client().CoreV1().Pods(appGoCounterUserspaceNs).GetLogs(goAppCounterPod.Name, &corev1.PodLogOptions{})
68+
req := env.Cluster().Client().CoreV1().Pods(appGoCounterUserspaceNs).GetLogs(goAppCounterPod.Name, &corev1.PodLogOptions{Follow: true})
6969
require.Eventually(t, func() bool {
7070
logs, err := req.Stream(ctx)
7171
require.NoError(t, err)

test/integration/kprobe_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestKprobeGoCounter(t *testing.T) {
4343
require.NoError(t, err)
4444
goKprobeCounterPod := pods.Items[0]
4545

46-
req := env.Cluster().Client().CoreV1().Pods(kprobeGoCounterUserspaceNs).GetLogs(goKprobeCounterPod.Name, &corev1.PodLogOptions{})
46+
req := env.Cluster().Client().CoreV1().Pods(kprobeGoCounterUserspaceNs).GetLogs(goKprobeCounterPod.Name, &corev1.PodLogOptions{Follow: true})
4747
require.Eventually(t, func() bool {
4848
logs, err := req.Stream(ctx)
4949
require.NoError(t, err)

test/integration/tc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestTcGoCounter(t *testing.T) {
4343
require.NoError(t, err)
4444
gotcCounterPod := pods.Items[0]
4545

46-
req := env.Cluster().Client().CoreV1().Pods(tcGoCounterUserspaceNs).GetLogs(gotcCounterPod.Name, &corev1.PodLogOptions{})
46+
req := env.Cluster().Client().CoreV1().Pods(tcGoCounterUserspaceNs).GetLogs(gotcCounterPod.Name, &corev1.PodLogOptions{Follow: true})
4747

4848
require.Eventually(t, func() bool {
4949
logs, err := req.Stream(ctx)

test/integration/tcx_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestTcxGoCounter(t *testing.T) {
4343
require.NoError(t, err)
4444
gotcxCounterPod := pods.Items[0]
4545

46-
req := env.Cluster().Client().CoreV1().Pods(tcxGoCounterUserspaceNs).GetLogs(gotcxCounterPod.Name, &corev1.PodLogOptions{})
46+
req := env.Cluster().Client().CoreV1().Pods(tcxGoCounterUserspaceNs).GetLogs(gotcxCounterPod.Name, &corev1.PodLogOptions{Follow: true})
4747

4848
require.Eventually(t, func() bool {
4949
logs, err := req.Stream(ctx)

test/integration/tracepoint_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestTracepointGoCounter(t *testing.T) {
4343
require.NoError(t, err)
4444
goTracepointCounterPod := pods.Items[0]
4545

46-
req := env.Cluster().Client().CoreV1().Pods(tracepointGoCounterUserspaceNs).GetLogs(goTracepointCounterPod.Name, &corev1.PodLogOptions{})
46+
req := env.Cluster().Client().CoreV1().Pods(tracepointGoCounterUserspaceNs).GetLogs(goTracepointCounterPod.Name, &corev1.PodLogOptions{Follow: true})
4747
require.Eventually(t, func() bool {
4848
logs, err := req.Stream(ctx)
4949
require.NoError(t, err)

test/integration/uprobe_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestUprobeGoCounter(t *testing.T) {
6262
require.NoError(t, err)
6363
goUprobeCounterPod := pods.Items[0]
6464

65-
req := env.Cluster().Client().CoreV1().Pods(uprobeGoCounterUserspaceNs).GetLogs(goUprobeCounterPod.Name, &corev1.PodLogOptions{})
65+
req := env.Cluster().Client().CoreV1().Pods(uprobeGoCounterUserspaceNs).GetLogs(goUprobeCounterPod.Name, &corev1.PodLogOptions{Follow: true})
6666
require.Eventually(t, func() bool {
6767
logs, err := req.Stream(ctx)
6868
require.NoError(t, err)

test/integration/xdp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func TestXdpGoCounter(t *testing.T) {
125125
require.NoError(t, err)
126126
goXdpCounterPod := pods.Items[0]
127127

128-
req := env.Cluster().Client().CoreV1().Pods(xdpGoCounterUserspaceNs).GetLogs(goXdpCounterPod.Name, &corev1.PodLogOptions{})
128+
req := env.Cluster().Client().CoreV1().Pods(xdpGoCounterUserspaceNs).GetLogs(goXdpCounterPod.Name, &corev1.PodLogOptions{Follow: true})
129129

130130
require.Eventually(t, func() bool {
131131
logs, err := req.Stream(ctx)

0 commit comments

Comments
 (0)