Skip to content

Create a containerized test suite for glb-director#186

Open
mpenny-github wants to merge 16 commits into
masterfrom
containerized_test_suite
Open

Create a containerized test suite for glb-director#186
mpenny-github wants to merge 16 commits into
masterfrom
containerized_test_suite

Conversation

@mpenny-github
Copy link
Copy Markdown
Contributor

@mpenny-github mpenny-github commented May 19, 2026

This is the second PR in a series to enable glb-director to run on ubuntu noble.
Previous PR: #185

This PR creates a new github action and a local script that runs the existing test suite from vagrant in a docker container. Some of the tests can't function in a containerized environment and have to be skipped.

In preperation for running this on ubuntu noble, I've update the python test framework to run on python3 rather than python2.

@mpenny-github mpenny-github marked this pull request as ready for review May 19, 2026 20:08
Copilot AI review requested due to automatic review settings May 19, 2026 20:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a containerized way to run the existing glb-director test suites (locally and in GitHub Actions) as part of the Noble enablement effort, and updates several Python/Scapy-based tests to be Python 3 compatible while conditionally skipping tests that require Vagrant-only infrastructure or host kernel features.

Changes:

  • Added a new GitHub Actions workflow to build a Docker test image and run multiple glb-* test suites inside containers.
  • Added a script/test-local helper to run the same containerized suites locally across distros.
  • Ported/adjusted multiple Python tests and helpers for Python 3, including adding targeted skip logic for non-container-compatible tests.
Show a summary per file
File Description
src/scapy-glb-gue/glb_scapy/glb_gue_scapy.py Fixes Python 3 integer division for Scapy field length calculation.
src/scapy-glb-gue/glb_scapy/init.py Switches to relative import for package correctness.
src/glb-redirect/tests/test_glb_redirect_v6_on_v4.py Updates print usage for Python 3.
src/glb-redirect/tests/test_glb_redirect_v4_on_v4.py Updates print usage for Python 3.
src/glb-redirect/tests/glb_test_utils.py Adds Vagrant-network reachability probe and SkipTest gating.
src/glb-redirect/tests/glb_test_remote_snoop.py Minor Python 3 print adjustment in debug logging.
src/glb-healthcheck/test/test-basic.sh Adds conditional skipping when Vagrant backends are unreachable; switches to python3 -m http.server.
src/glb-healthcheck/test/lib.sh Adds shell-level SKIPPED reporting + backend reachability probe + loopback IP binding for container runs.
src/glb-director/tests/test-config.json Reorders JSON keys/formatting (no semantic change intended).
src/glb-director/tests/test_rendezvous_table.py Updates hex encode/decode helpers for Python 3.
src/glb-director/tests/test_director_classify_v6.py Updates print usage for Python 3.
src/glb-director/tests/test_cli_tool.py Updates hex/bytes handling and map->list usage for Python 3.
src/glb-director/tests/pcap_tests.sh Adds skipping when hugepages are unavailable (common in containers).
src/glb-director/tests/lib/testlib.sh Adds shell-level SKIPPED reporting and hugepage availability probe.
src/glb-director/tests/glb_test_utils.py Python 3 compatibility updates + SkipTest gating for missing kernel capabilities; improves teardown robustness.
script/test-local New local helper script to build images and run suites in Docker.
script/helpers/folding.sh Updates folding output to GitHub Actions group/endgroup format.
script/Dockerfile.focal Adds Python 3 deps + requirements install + GOFLAGS buildvcs workaround + extra test deps (valgrind/jq/tcpdump).
script/cibuild-create-packages-focal Removes focal-specific wrapper in favor of a parameterized script.
script/cibuild-create-packages Generalizes package-build script to accept a distro argument and matching Dockerfile.
.github/workflows/test.yml New workflow to build Docker images once and run test suites in containers.
.github/workflows/ci.yml Updates package build job to use a distro matrix and renamed artifacts.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (2)

src/glb-director/tests/glb_test_utils.py:257

  • Same tuple-printing issue here: print(('launched as pid', self.director.pid)) will print a tuple, not a friendly message. Prefer print('launched as pid', self.director.pid) / f-string formatting.
			stdout=open('director-output.txt', 'ab'),
			stderr=subprocess.STDOUT,
			env=notify_director.updated_env(),
		)

		print(('launched as pid', self.director.pid))

src/glb-director/tests/glb_test_utils.py:484

  • print(('Waiting for packets on', iface_name, 'with timeout', timeout_seconds)) prints a single tuple, which is noisy and harder to read in test logs. Use print('Waiting for packets on', iface_name, 'with timeout', timeout_seconds) (or a formatted string) so each part is a proper print argument.
	def wait_for_packet(self, iface, condition, timeout_seconds=5):
		# Newer scapy L2ListenSocket no longer exposes `.iff`; fall back to
		# `.iface` and finally repr() so the print never crashes the test.
		iface_name = getattr(iface, 'iff', None) or getattr(iface, 'iface', None) or repr(iface)
		print(('Waiting for packets on', iface_name, 'with timeout', timeout_seconds))
		try:
  • Files reviewed: 22/22 changed files
  • Comments generated: 2

Comment thread src/glb-healthcheck/test/lib.sh Outdated
Comment thread src/glb-director/tests/glb_test_utils.py Outdated
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.

2 participants