Move test scripts inside tests/ folder

This commit is contained in:
Harshavardhan Musanalli
2025-10-22 10:13:57 +02:00
parent b15ae9b4a9
commit c4ef586a00
5 changed files with 0 additions and 0 deletions

43
tests/test_ebpf_direct.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
# Direct eBPF test to verify functionality
echo "Testing eBPF Cilium Manager directly..."
# Test if bpftrace works
echo "Checking bpftrace availability..."
if ! command -v bpftrace &> /dev/null; then
echo "❌ bpftrace not found - installing..."
sudo apt update && sudo apt install -y bpftrace
fi
echo "✅ bpftrace available"
# Test a simple UDP probe
echo "Testing UDP probe for 10 seconds..."
timeout 10s sudo bpftrace -e '
BEGIN {
printf("Starting UDP monitoring...\n");
}
kprobe:udp_sendmsg {
printf("UDP_SEND|%d|%s|%d|%s\n", nsecs, probe, pid, comm);
}
kprobe:udp_recvmsg {
printf("UDP_RECV|%d|%s|%d|%s\n", nsecs, probe, pid, comm);
}
END {
printf("UDP monitoring completed\n");
}'
echo "✅ Direct bpftrace test completed"
# Test if there's any network activity
echo "Generating some network activity..."
ping -c 3 8.8.8.8 &
nslookup google.com &
wait
echo "✅ Network activity generated"
echo "Now testing our Go eBPF implementation..."