.github/workflows: add privileged tests workflow

We had missed regressions from privileged tests not running, now they
can run.

Updates #cleanup
Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
James Tucker 2023-10-18 11:22:28 -07:00 committed by James Tucker
parent 0f5e031133
commit 0b16620b80
2 changed files with 14 additions and 1 deletions

View File

@ -183,6 +183,19 @@ jobs:
# the equals signs cause great confusion. # the equals signs cause great confusion.
run: go test ./... -bench . -benchtime 1x -run "^$" run: go test ./... -bench . -benchtime 1x -run "^$"
privileged:
runs-on: ubuntu-22.04
container:
image: golang:latest
options: --privileged
steps:
- name: checkout
uses: actions/checkout@v4
- name: chown
run: chown -R $(id -u):$(id -g) $PWD
- name: privileged tests
run: ./tool/go test ./util/linuxfw
vm: vm:
runs-on: ["self-hosted", "linux", "vm"] runs-on: ["self-hosted", "linux", "vm"]
# VM tests run with some privileges, don't let them run on 3p PRs. # VM tests run with some privileges, don't let them run on 3p PRs.

View File

@ -866,7 +866,7 @@ func (n *nftablesRunner) createDummyPostroutingChains() (retErr error) {
return fmt.Errorf("create nat table: %w", err) return fmt.Errorf("create nat table: %w", err)
} }
defer func(fm nftables.TableFamily) { defer func(fm nftables.TableFamily) {
if err := deleteTableIfExists(n.conn, table.Proto, tsDummyTableName); err != nil && retErr == nil { if err := deleteTableIfExists(n.conn, fm, tsDummyTableName); err != nil && retErr == nil {
retErr = fmt.Errorf("delete %q table: %w", tsDummyTableName, err) retErr = fmt.Errorf("delete %q table: %w", tsDummyTableName, err)
} }
}(table.Proto) }(table.Proto)