issue-5: regression tests for start/stop/startall/stopall CLI semantics #6

Open
sgcommand wants to merge 1 commits from issue-5-targeted-start-stop into main
Member

Add focused regression tests ensuring 'start' and 'stop' require exactly one unit name, build correct exec commands per runtime, and that startall/stopall sort by Order with proper tiebreakers and skip disabled/uninstalled units.

Add focused regression tests ensuring 'start' and 'stop' require exactly one unit name, build correct exec commands per runtime, and that startall/stopall sort by Order with proper tiebreakers and skip disabled/uninstalled units.
sgcommand added 1 commit 2026-07-16 21:04:20 +00:00
Add cmd/start_test.go and systemd/start_stop_test.go with regression
tests covering:

- Start/Stop require exactly one unit name argument (cobra.ExactArgs(1)
  semantics verified via ValidateArgs)
- Start/Stop build correct exec commands per runtime
- StartAll sorts units by Order asc, then Name asc as tiebreaker
- StopAll sorts units by Order desc, then Name desc as tiebreaker
- StartAll skips disabled units (Enabled=false)
- StopAll skips uninstalled units

These tests enforce the CLI semantics that 'start' starts only a specific
unit and 'stop' stops only a specific unit; 'startall' and 'stopall'
operate on all matching units.

Run: make test
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-5-targeted-start-stop:issue-5-targeted-start-stop
git checkout issue-5-targeted-start-stop
Sign in to join this conversation.