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

CI: run tests on arm64 #1245

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 34 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: ci
on:
push:
branches: [ "main" ]
Expand Down Expand Up @@ -69,13 +70,6 @@ jobs:
go build -v ./...
go test -c -o /dev/null ./... >/dev/null

- name: Cross build arm64
env:
GOARCH: arm64
run: |
go build -v ./...
go test -c -o /dev/null ./... >/dev/null

build-docs:
name: Build Documentation
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -139,6 +133,39 @@ jobs:
name: Test Results (previous stable Go)
path: junit.xml

test-on-arm64:
name: Run tests on arm64
runs-on: actuated-arm64-2cpu-8gb
needs: build-and-lint
timeout-minutes: 10
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '${{ env.prev_go_version }}'

- run: go install gotest.tools/[email protected]

- name: Test
run: gotestsum --ignore-non-json-output-lines --junitfile junit.xml -- -exec sudo -short -count 1 -json ./...

- name: Benchmark
run: go test -exec sudo -short -run '^$' -bench . -benchtime=1x ./...

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results (arm64)
path: junit.xml

- name: Show dmesg
if: failure()
run: |
sudo dmesg

vm-test:
name: Run tests on pre-built kernel
runs-on: ubuntu-latest-4cores-16gb
Expand Down
8 changes: 5 additions & 3 deletions link/uprobe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ func TestExecutableLazyLoadSymbols(t *testing.T) {
ex, err := OpenExecutable("/bin/bash")
qt.Assert(t, qt.IsNil(err))
// Addresses must be empty, will be lazy loaded.
qt.Assert(t, qt.DeepEquals(ex.addresses, map[string]uint64{}))
qt.Assert(t, qt.HasLen(ex.addresses, 0))

prog := mustLoadProgram(t, ebpf.Kprobe, 0, "")
up, err := ex.Uprobe(bashSym, prog, &UprobeOptions{Address: 123})
// Address must be a multiple of 4 on arm64, see
// https://elixir.bootlin.com/linux/v6.6.4/source/arch/arm64/kernel/probes/uprobes.c#L42
up, err := ex.Uprobe(bashSym, prog, &UprobeOptions{Address: 124})
qt.Assert(t, qt.IsNil(err))
up.Close()

// Addresses must still be empty as Address has been provided via options.
qt.Assert(t, qt.DeepEquals(ex.addresses, map[string]uint64{}))
qt.Assert(t, qt.HasLen(ex.addresses, 0))

up, err = ex.Uprobe(bashSym, prog, nil)
qt.Assert(t, qt.IsNil(err))
Expand Down