test.sh 423 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. # SUMMARY: Check that maps are correctly represented in ELF files
  3. # LABELS:
  4. set -ex
  5. # Source libraries. Uncomment if needed/defined
  6. #. "${RT_LIB}"
  7. . "${RT_PROJECT_ROOT}/_lib/lib.sh"
  8. NAME=map_test
  9. clean_up() {
  10. rm -rf ebpf user ${NAME}.o
  11. }
  12. trap clean_up EXIT
  13. # Test code goes here
  14. compile_ebpf ${NAME}.ebpf.rs
  15. readelf --sections ${NAME}.o | grep -q "maps"
  16. readelf --syms ${NAME}.o | grep -q "BAR"
  17. exit 0