Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripts for testing and development #26

Merged
merged 8 commits into from
Aug 2, 2024

Conversation

erthalion
Copy link
Collaborator

Using network workload requires some infrastructure in place. Add few scripts to make it easier, plus one "proto" integration test to verify the dynamic configuration is generating some connections.

Using network workload requires some infrastructure in place. Add few
scripts to make it easier, plus one "proto" integration test to verify
the dynamic configuration is generating some connections.
@JoukoVirtanen
Copy link
Contributor

JoukoVirtanen commented Jun 18, 2024

The script for the smoke test is a good idea, but I am having difficulty getting it to run and pass. A docker image that could run it would be nice. Here is what I have tried so far. I modified Dockerfile so that it has the following contents

FROM builder:latest as builder

FROM registry.fedoraproject.org/fedora:38

RUN mkdir /etc/berserker

RUN dnf install bpftrace bpftool which -y

COPY --from=builder /berserker/target/release/berserker /usr/local/bin/berserker
COPY --from=builder /berserker/workload.toml /etc/berserker/workload.toml
COPY --from=builder /berserker/stub /usr/local/bin/stub
COPY --from=builder /berserker /berserker

ENV PATH="${PATH}:/usr/local/bin"

ENTRYPOINT berserker

Ran the following commands.

make

docker image ls | grep berserker
berserker                                              latest                                         e214c88f10e2   2 days ago      1.33GB
quay.io/rhacs-eng/collector-performance                berserker-1.1.3                                3a3b278be61a   9 days ago      185MB


docker run -it --privileged --cap-add=SYS_ADMIN --cap-add=SYS_PTRACE --cap-add=NET_ADMIN --entrypoint /bin/bash e214c88f10e2

Within the docker container

cd berserker

mount -t debugfs none /sys/kernel/debug
mount -t tracefs none /sys/kernel/debug/tracing

sudo dnf install iproute
sudo dnf install iptables
sudo dnf install procps-ng

./scripts/network/prepare-tap.sh

tests/workers/network/smoke.sh 
Cleanup...
Starting bpftrace...
Starting the server...
Starting the client...
Stopping...
Verifying the results...
FAIL
Attaching 2 probes...

@JoukoVirtanen
Copy link
Contributor

I got this to pass. I changed tests/workers/network/sys_accept.bt to

k:__sys_accept* /comm == "berserker"/
{
   printf("accept berserker\n");
}

It also seems flaky, since it did not pass on the first try.

erthalion and others added 7 commits August 2, 2024 15:22
Make the user option to expect an argument

Co-authored-by: Jouko Virtanen <jvirtane@redhat.com>
Wording

Co-authored-by: Jouko Virtanen <jvirtane@redhat.com>
Wording

Co-authored-by: Jouko Virtanen <jvirtane@redhat.com>
Braces for the command invokation

Co-authored-by: Jouko Virtanen <jvirtane@redhat.com>
Set shell options

Co-authored-by: Jouko Virtanen <jvirtane@redhat.com>
Set shell options

Co-authored-by: Jouko Virtanen <jvirtane@redhat.com>
Along the way fix the issue about searching for a wrong text in the
tcpaccept test.
@JoukoVirtanen
Copy link
Contributor

I have tested this after the latest changes and it is working.

@JoukoVirtanen JoukoVirtanen merged commit 5f620d2 into main Aug 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants