Comments (8)
Hi @eclipseo
Did you have a look at https://github.com/cilium/ebpf/blob/master/.semaphore/semaphore.yml? This file reflects the configuration for the CI/CD tests, that are triggered for every PR on this repository.
from ebpf.
@eclipseo can you give details on the error you're seeing? FWIW, failing to increase the rlimit should only result in a warning, not an error:
err := unix.Setrlimit(8, &unix.Rlimit{
Cur: math.MaxUint64,
Max: math.MaxUint64,
})
if err != nil {
fmt.Println("WARNING: Failed to adjust rlimit, tests may fail")
}
from ebpf.
Here's what I get when I try running the tests:
Testing in: /builddir/build/BUILD/ebpf-5d50e74ed36f0420ef5004e84ed2cdd3e739ad3f/_build/src
PATH: /builddir/build/BUILD/ebpf-5d50e74ed36f0420ef5004e84ed2cdd3e739ad3f/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
GOPATH: /builddir/build/BUILD/ebpf-5d50e74ed36f0420ef5004e84ed2cdd3e739ad3f/_build:/usr/share/gocode
GO111MODULE: off
command: go test -buildmode pie -compiler gc -ldflags "-X github.com/cilium/ebpf/version.commit=5d50e74ed36f0420ef5004e84ed2cdd3e739ad3f -X github.com/cilium/ebpf/version=0 -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '"
testing: github.com/cilium/ebpf
github.com/cilium/ebpf
WARNING: Failed to adjust rlimit, tests may fail
--- FAIL: TestCollectionSpecRewriteMaps (0.00s)
collection_test.go:149: can't test program: can't run test: operation not permitted
--- FAIL: TestLoadCollectionSpec (0.00s)
--- FAIL: TestLoadCollectionSpec/loader-clang-6.0.elf (0.00s)
elf_reader_test.go:76: map hash_map: map create: operation not permitted
--- FAIL: TestLoadCollectionSpec/loader-clang-7.elf (0.00s)
elf_reader_test.go:76: map hash_map: map create: operation not permitted
--- FAIL: TestLoadCollectionSpec/loader-clang-8.elf (0.00s)
elf_reader_test.go:76: map hash_map: map create: operation not permitted
--- FAIL: TestLoadCollectionSpec/loader-clang-9.elf (0.00s)
elf_reader_test.go:76: map array_of_hash_map: map create: operation not permitted
--- FAIL: TestLink (0.00s)
linker_test.go:35: 0: MovReg dst: r0 src: r1
1: Call -1 <my_func>
2: Exit
my_func:
3: LdImmDW dst: r0 imm: 1337
5: Exit
linker_test.go:41: can't load program: operation not permitted
--- FAIL: TestMap (0.00s)
map_test.go:33: map create: operation not permitted
--- FAIL: TestMapClose (0.00s)
map_test.go:72: map create: operation not permitted
--- FAIL: TestMapPin (0.00s)
map_test.go:99: map create: operation not permitted
--- FAIL: TestMapQueue (0.00s)
map_test.go:162: map create: operation not permitted
--- FAIL: TestMapInMap (0.00s)
--- FAIL: TestMapInMap/ArrayOfMaps (0.00s)
map_test.go:226: map create: operation not permitted
--- FAIL: TestMapInMap/HashOfMaps (0.00s)
map_test.go:226: map create: operation not permitted
--- FAIL: TestNewMapInMapFromFD (0.00s)
map_test.go:287: map create: operation not permitted
--- FAIL: TestPerfEventArray (0.00s)
map_test.go:309: Can't create perf event array from PerfEventArray(keySize=0, valueSize=0, maxEntries=0, flags=0): map create: operation not permitted
map_test.go:309: Can't create perf event array from PerfEventArray(keySize=4, valueSize=0, maxEntries=0, flags=0): map create: operation not permitted
map_test.go:309: Can't create perf event array from PerfEventArray(keySize=0, valueSize=4, maxEntries=0, flags=0): map create: operation not permitted
--- FAIL: TestMapInMapValueSize (0.00s)
map_test.go:356: map create: operation not permitted
--- FAIL: TestIterateEmptyMap (0.00s)
panic: map create: operation not permitted [recovered]
panic: map create: operation not permitted
goroutine 45 [running]:
testing.tRunner.func1.1(0x56096849c1e0, 0xc000170800)
/usr/lib/golang/src/testing/testing.go:942 +0x3d2
testing.tRunner.func1(0xc000174000)
/usr/lib/golang/src/testing/testing.go:945 +0x3fb
panic(0x56096849c1e0, 0xc000170800)
/usr/lib/golang/src/runtime/panic.go:967 +0x161
github.com/cilium/ebpf.createHash(0xc00016d5f0)
/builddir/build/BUILD/ebpf-5d50e74ed36f0420ef5004e84ed2cdd3e739ad3f/_build/src/github.com/cilium/ebpf/map_test.go:879 +0xb9
github.com/cilium/ebpf.TestIterateEmptyMap(0xc000174000)
/builddir/build/BUILD/ebpf-5d50e74ed36f0420ef5004e84ed2cdd3e739ad3f/_build/src/github.com/cilium/ebpf/map_test.go:374 +0x46
testing.tRunner(0xc000174000, 0x5609684c8c68)
/usr/lib/golang/src/testing/testing.go:993 +0xde
created by testing.(*T).Run
/usr/lib/golang/src/testing/testing.go:1044 +0x359
exit status 2
FAIL github.com/cilium/ebpf 0.016s
from ebpf.
linker_test.go:41: can't load program: operation not permitted
This error happens because loading an XDP program requires root. I'd have to look at the map errors, but I suspect they happen for a similar reason.
In general, it's not possible to run the tests without root, because a lot of eBPF is gated behind CAP_SYS_ADMIN. Is that what you are trying to do? If yes, you might be able to work around this using run-tests.sh
, as Florian pointed outed. That requires that you have access to KVM if you want tests to run in a reasonable amount of time.
from ebpf.
run-tests.sh
requires network access which is not possible within our CI. Thanks anyway.
from ebpf.
Instead of calling run-tests.sh
you maybe can take it as source to configure your CI/CD tests and provide the required sources locally?
from ebpf.
I'm open to fix run-tests.sh so that it works without network access if that is useful to you.
from ebpf.
I'm closing this issue for now, feel free to re-open it if necessary.
from ebpf.
Related Issues (20)
- Can't load CO-RE eBPF code that accesses enum values HOT 2
- Add test suite for netkit devices HOT 8
- loader: `__ksym` support for variables
- loader: handle missing kfunc gracefully
- Support for CORE type matches relocation
- NewMapFromID() needs a warning in docstring HOT 2
- Add support for cgroup unix socket address hooks HOT 1
- CI: TestMapBatch/Hash is flaky (arm64?) HOT 1
- dae can not recognize pppoe dial-up interface and route out correctly. HOT 1
- Kernel version detection does not work with vDSO disabled HOT 6
- Allow changing line info data in btf.Line HOT 11
- load program: invalid argument: unknown func bpf_redirect_peer#155 (51 line(s) omitted)
- With the program type raw_tracepoint, no data is generated.error: loading objects: field TraceSchedWakeup: program trace_sched_wakeup: load program: permission denied: 5: (61) r1 = *(u32 *)(r7 +2784): R7 invalid mem access 'inv' (5 line(s) omitted HOT 1
- Test TestPerfReaderWakeupEvents gets stuck on some runs HOT 9
- With Linux 4.9, loadBpfObjects() failed, error=argument list too long HOT 1
- program: relocation of program targeting a module fails if CONFIG_DEBUG_INFO_BTF_MODULES is disabled HOT 3
- Unusual `go` directive in `go.mod`
- flake: TestMapIteratorAllocations
- TestHaveProgramType/Extension fails on kernels >6.7 HOT 2
- ci: arm64 tests fail HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ebpf.