Skip to content

Commit

Permalink
add CAP_NET_RAW to github worker running tests
Browse files Browse the repository at this point in the history
Summary: TestPing fails because of lack of CAP_NET_RAW to open RAW socket. Add this capability to test runner

Differential Revision: D67863697
  • Loading branch information
vvfedorenko authored and facebook-github-bot committed Jan 6, 2025
1 parent ad37fc4 commit 3490b4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.22
- run: sudo apt-get install libpcap-dev
- run: sudo apt-get install libpcap-dev libcap2-bin
- run: go build -v ./...
# fuzzing, need to specify each package separately
- run: go test -v -fuzz='.*' -fuzztime=10s ./ptp/protocol/
- run: go test -v -fuzz='.*' -fuzztime=10s ./ntp/protocol/
- run: go test -v -fuzz='.*' -fuzztime=10s ./ntp/chrony/
- name: Run coverage
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
run: capsh --inh=cap_net_raw --print -- -c "go test -v -race -coverprofile=coverage.txt -covermode=atomic ./..."
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

0 comments on commit 3490b4e

Please sign in to comment.