Skip to content

inttest/cli: test with systemd based docker image#7315

Open
ncopa wants to merge 4 commits into
k0sproject:mainfrom
ncopa:inttest-systemd
Open

inttest/cli: test with systemd based docker image#7315
ncopa wants to merge 4 commits into
k0sproject:mainfrom
ncopa:inttest-systemd

Conversation

@ncopa
Copy link
Copy Markdown
Collaborator

@ncopa ncopa commented Mar 19, 2026

Description

Add Ubuntu image for bootloose so we can test that k0s install/start/stop works with systemd units.

ref: #7053

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Checklist

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@ncopa ncopa requested review from a team as code owners March 19, 2026 11:19
@ncopa ncopa requested review from kke and makhov March 19, 2026 11:19
@twz123
Copy link
Copy Markdown
Member

twz123 commented Mar 19, 2026

Phew, a big change for just testing systemctl start/stop wrappers.

@kke
Copy link
Copy Markdown
Contributor

kke commented Mar 19, 2026

Bootloose's own debian image has systemd?

@ncopa ncopa force-pushed the inttest-systemd branch 2 times, most recently from 509ef3a to 2fae79e Compare April 8, 2026 12:33
@ncopa
Copy link
Copy Markdown
Collaborator Author

ncopa commented Apr 13, 2026

Its now based on bootloose image

Copy link
Copy Markdown

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

Adds a systemd-based bootloose test image and a new LaunchModeSystemd path so the CLI integration tests can exercise k0s install/start/stop via systemd units (as a complement to the existing OpenRC/alpine coverage).

Changes:

  • Add bootloose-systemd Docker image build + assets (systemd unit, nginx config, troubleshoot bundle config).
  • Add LaunchModeSystemd and a systemdLaunchDelegate to start/stop k0s via systemctl and collect logs via journalctl.
  • Split CLI inttest flow to run an install/start/stop smoke test for both the existing suite and a new systemd-based suite.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
inttest/Makefile Adds a build stamp + target dependency to build the new bootloose-systemd image for check-cli.
inttest/common/launchdelegate.go Introduces LaunchModeSystemd and a systemdLaunchDelegate that manages k0s via systemd units.
inttest/common/bootloosesuite.go Wires LaunchModeSystemd into BootlooseSuite’s delegate selection.
inttest/cli/cli_test.go Refactors CLI flow and adds a new systemd-based CLI suite.
inttest/bootloose-systemd/root/usr/local/bin/troubleshoot-k0s-inttest.sh Adds support-bundle collection script for the systemd image.
inttest/bootloose-systemd/root/etc/troubleshoot/k0s-inttest.yaml Adds troubleshoot support-bundle spec for systemd image.
inttest/bootloose-systemd/root/etc/systemd/system/k0s-seed.service Adds systemd unit intended to seed /usr/local/bin/k0s from /dist/k0s.
inttest/bootloose-systemd/root/etc/nginx/sites-available/default Adds nginx default site config (mirrors alpine image behavior).
inttest/bootloose-systemd/Dockerfile Defines the new systemd-based bootloose image and installs required tooling (systemd, ssh, nginx, helm, troubleshoot, etc.).

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

Comment thread inttest/cli/cli_test.go
Comment thread inttest/bootloose-systemd/root/etc/systemd/system/k0s-seed.service
Comment thread inttest/bootloose-systemd/Dockerfile
@ncopa
Copy link
Copy Markdown
Collaborator Author

ncopa commented May 13, 2026

Phew, a big change for just testing systemctl start/stop wrappers.

This also give us the ability to test anything on systemd if ever needed. We could for example add tests to verify that the cgroups are handled as expected on systemd.

ncopa added 4 commits May 18, 2026 13:18
Use upstream bootloose ubuntu image.

Signed-off-by: Natanael Copa <ncopa@mirantis.com>
Signed-off-by: Natanael Copa <ncopa@mirantis.com>
…methods

Signed-off-by: Natanael Copa <ncopa@mirantis.com>
This allows us to test that k0s install/start/stop works with systemd.

Signed-off-by: Natanael Copa <ncopa@mirantis.com>
@ncopa ncopa force-pushed the inttest-systemd branch from 2fae79e to 490e263 Compare May 18, 2026 11:19
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.

4 participants