Skip to content

Introduce GitHub Actions CI - #119

Open
breakertt wants to merge 3 commits into
PlatformLab:mainfrom
breakertt:feat/introduce-ci
Open

breakertt wants to merge 3 commits into
PlatformLab:mainfrom
breakertt:feat/introduce-ci

Conversation

@breakertt

Copy link
Copy Markdown
Contributor

This PR adds basic CI: on every push and pull request, build homa.ko and util/, then run the unit tests with and without --ipv4.

To get the tests running in CI, we also fix some existing problems in HomaModule:

  • ./unit always exited 0, even when tests failed
  • --ipv4 was ignored by the first test in a run
  • two tests failed under --ipv4 (one test bug, one real GSO type bug)

This PR includes three commits:

  1. Fix GSO type for IPv4 packets sent from IPv6 sockets
    • gso_type was picked from the socket family, but homa_route_xmit picks IPv4/IPv6 from the peer address
    • so an IPv6 socket replying to an IPv4 client sent IPv4 packets marked TCPV6
    • tcp4_gso_segment rejects these with TCP hijacking and software GSO (by code reading, not reproduced)
  2. Fix the unit tests' exit status and --ipv4
    • ./unit returns the test result
    • --ipv4 also applies to the first test
    • homa_rpc_get_info__basics calls mock_set_ipv6
  3. Introduce GitHub Actions CI
    • Linux 6.17.8 from kernel.org: defconfig, the options the mocks need, make modules_prepare
    • build homa.ko
    • build util/ (no tests there to run)
    • run the unit tests (IPv6 by default)
    • run the unit tests with --ipv4
    • about 1.5 minutes per run

Our Actions runs: https://github.com/breakertt/HomaModule/actions

Notes:

  • As of today, GitHub Actions quota is unlimited for public repos, so this costs nothing
  • When HomaModule moves to another Linux version, LINUX_VERSION in .github/workflows/ci.yml needs to change with it

Future plans:

  • when I have time, fix the unit tests of the strip version and add them to CI. Question for you: should the strip version always compile against the latest Linux release, net-next, or the latest rc?
  • not included for now, as they would likely need resources beyond the free GitHub-hosted runners:
    • basic AI review on PRs
    • real kernel tests like netdev's CI, which boots a kernel and runs selftests on it

homa_tx_skb_alloc chose SKB_GSO_TCPV4 vs. SKB_GSO_TCPV6 from the
socket family, but an IPv6 socket also sends IPv4 packets to IPv4
peers (e.g. replies to IPv4 clients). Those packets were marked
TCPV6, which tcp4_gso_segment rejects when TCP hijacking is on and
GSO is done in software. Use the peer address instead, as
homa_route_xmit does.
* ./unit exited 0 even when tests failed: main() dropped
  test_harness_run()'s return value, so make test never failed.
* --ipv4 had no effect on the first test in a run (mock_ipv6 was only
  set from mock_ipv6_default in the cleanup after each test), so
  running a single test with --ipv4 actually tested IPv6.
* homa_rpc_get_info__basics assumed an IPv6 socket; call mock_set_ipv6
  like other IPv6-only tests.
Every push and pull request builds homa.ko and the programs in util,
then runs the unit tests with both IPv6 and IPv4 as the default
family, against a Linux 6.17.8 tree prepared from kernel.org with
defconfig plus the options the unit tests' mocks assume.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant