Skip to content

Commit

Permalink
Merge branch 'main' of github.com:acassen/gtp-guard
Browse files Browse the repository at this point in the history
  • Loading branch information
acassen committed Aug 14, 2024
2 parents e6f07ae + 6660d4c commit 7d5f37e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 21 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/actions-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ on:
jobs:
build-gtp-guard:
name: Build gtp-guard
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
arch: [x86_64, arm64]
compiler: [ gcc, clang ]
steps:
- name: add missing packages
Expand All @@ -30,14 +32,19 @@ jobs:
- name: Upload gtp-guard artifacts
uses: actions/upload-artifact@v4
with:
name : artifact-gtp-guard-${{ matrix.compiler }}
name : artifact-gtp-guard-${{ matrix.compiler }}-${{ matrix.arch }}
path : |
bin/gtp-guard
src/bpf/*.bpf
bin/*.bpf
test/
build-gtping:
name: Build gtping
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
arch: [x86_64, arm64]
needs: build-gtp-guard
steps:
- name: gtping from upstream
Expand All @@ -54,12 +61,17 @@ jobs:
- name: Upload gtping artifacts
uses: actions/upload-artifact@v4
with:
name : artifact-gtping
name : artifact-gtping-${{ matrix.arch }}
path : src/gtping
test-using-gtping:
name: gtp-guard test using gtping
needs: build-gtping
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
arch: [x86_64, arm64]
compiler: [ gcc, clang ]
steps:
- name: add missing packages
uses: ConorMacBride/install-package@v1
Expand Down Expand Up @@ -89,17 +101,19 @@ jobs:
- name: run the test
shell: bash
run : |
APATH="bin/artifact-gtp-guard-${{ matrix.compiler }}-${{ matrix.arch }}"
APING="bin/artifact-gtping-${{ matrix.arch }}"
ls -R -la
chmod 755 bin/artifact-gtp-guard-gcc/bin/gtp-guard
chmod 755 bin/artifact-gtping/gtping
chmod 755 bin/artifact-gtp-guard-gcc/test/testenv.sh
chmod 755 bin/artifact-gtp-guard-gcc/test/gtpu-ping.py
sudo bin/artifact-gtp-guard-gcc/test/testenv.sh \
-i bin/artifact-gtping/gtping \
-u bin/artifact-gtp-guard-gcc/test/gtpu-ping.py \
-g bin/artifact-gtp-guard-gcc/bin/gtp-guard \
chmod 755 $APATH/bin/gtp-guard
chmod 755 $APING/gtping
chmod 755 $APATH/test/testenv.sh
chmod 755 $APATH/test/gtpu-ping.py
sudo $APATH/test/testenv.sh \
-i $APING/gtping \
-u $APATH/test/gtpu-ping.py \
-g $APATH/bin/gtp-guard \
-c etc/gtp-guard.conf \
-f bin/artifact-gtp-guard-gcc/src/bpf/gtp_fwd.bpf \
-r bin/artifact-gtp-guard-gcc/src/bpf/gtp_route.bpf \
-m bin/artifact-gtp-guard-gcc/src/bpf/gtp_mirror.bpf \
-f $APATH/bin/gtp_fwd.bpf \
-r $APATH/bin/gtp_route.bpf \
-m $APATH/bin/gtp_mirror.bpf \
-k no
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ VERSION := $(shell cat VERSION)
TARBALL = $(EXEC)-$(VERSION).tar.xz
TARFILES = AUTHOR VERSION LICENSE README.md bin src lib Makefile libbpf

prefix = /usr/local
exec_prefix = ${prefix}
sbindir = ${exec_prefix}/sbin
sysconfdir = ${prefix}/etc
prefix ?= /usr/local
exec_prefix ?= ${prefix}
sbindir ?= ${exec_prefix}/sbin
sysconfdir ?= ${prefix}/etc
init_script = etc/init.d/gtp-guard.init
conf_file = etc/gtp-guard/gtp-guard.conf

Expand Down Expand Up @@ -66,7 +66,7 @@ uninstall:
rm -f $(sbindir)/$(EXEC)

install:
install -d $(prefix)
install -d $(sbindir)
install -m 700 $(BIN)/$(EXEC) $(sbindir)/$(EXEC)-$(VERSION)
ln -sf $(sbindir)/$(EXEC)-$(VERSION) $(sbindir)/$(EXEC)

Expand Down
1 change: 1 addition & 0 deletions src/bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ clean:
dependencies: verify_cmds verify_target_bpf
verify_cmds: $(CLANG) $(LLC)
@for TOOL in $^ ; do \
which $${TOOL} ;\
if ! (which -- "$${TOOL}" > /dev/null 2>&1); then \
echo "*** ERROR: Cannot find LLVM tool $${TOOL}" ;\
exit 1; \
Expand Down
Binary file removed tools/selftests/resolv-naptr/test-resolv
Binary file not shown.

0 comments on commit 7d5f37e

Please sign in to comment.