Skip to content

Commit f0a3665

Browse files
committed
Remove generic command assert and wait plugins
1 parent 020f395 commit f0a3665

12 files changed

Lines changed: 5 additions & 224 deletions

File tree

docs/guides/ssh-smoke.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ remote user. It covers:
4848
- `fs.find`, `fs.chmod`, `fs.remove`
4949
- `archive.tar`, `archive.untar`, `archive.zip`, `archive.unzip`
5050
- `transfer.upload`, `transfer.download`, `transfer.sync`
51-
- `wait.command`, `wait.file`, `wait.path`, `wait.process`
52-
- `assert.command`, `assert.file`, `assert.path`, `assert.disk`, `assert.tcp`
51+
- `wait.file`, `wait.path`, `wait.process`
52+
- `assert.file`, `assert.path`, `assert.disk`, `assert.tcp`
5353
- artifact capture for stdout/stderr/data
5454
- resume helpers through the normal run state store
5555

docs/plugins/generated.md

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -581,41 +581,6 @@ with:
581581

582582
## assert
583583

584-
### `assert.command`
585-
586-
Assert that a remote command matches the requested condition.
587-
588-
- Remote session: `true`
589-
- Dry-run support: `true`
590-
- Check mode support: `false`
591-
592-
| Parameter | Required | Type | Default | Description |
593-
|---|---:|---|---|---|
594-
| `command` | yes | `string` | | Command line to execute. |
595-
| `rc` | no | `integer` | `0` | Expected process return code. |
596-
| `equals` | no | `string` | | Expected stdout value after trimming whitespace. |
597-
| `contains` | no | `string` | | Required substring in stdout or HTTP response body. |
598-
| `not_contains` | no | `string` | | Substring that must not appear in stdout. |
599-
| `sudo` | no | `boolean` | `False` | Run the remote operation through sudo -n when supported. |
600-
| `get_pty` | no | `boolean` | `False` | Request a pseudo-terminal for the remote command. |
601-
602-
Result fields:
603-
604-
- `changed`: Whether the plugin changed the target or controller state.
605-
- `message`: Human-readable result message.
606-
- `rc`: Process or command return code when applicable.
607-
- `stdout`: Captured standard output when applicable.
608-
- `stderr`: Captured standard error when applicable.
609-
- `data`: Plugin-specific structured result data.
610-
611-
Example:
612-
613-
```yaml
614-
use: assert.command
615-
with:
616-
command: echo automax
617-
```
618-
619584
### `assert.disk`
620585

621586
Assert remote disk capacity thresholds.
@@ -11320,43 +11285,6 @@ with:
1132011285

1132111286
## wait
1132211287

11323-
### `wait.command`
11324-
11325-
Wait until a remote command matches the requested condition.
11326-
11327-
- Remote session: `true`
11328-
- Dry-run support: `true`
11329-
- Check mode support: `false`
11330-
11331-
| Parameter | Required | Type | Default | Description |
11332-
|---|---:|---|---|---|
11333-
| `command` | yes | `string` | | Command line to execute. |
11334-
| `timeout` | no | `number` | | Operation timeout in seconds. |
11335-
| `interval` | no | `number` | `2` | Polling interval in seconds. |
11336-
| `rc` | no | `integer` | `0` | Expected process return code. |
11337-
| `equals` | no | `string` | | Expected stdout value after trimming whitespace. |
11338-
| `contains` | no | `string` | | Required substring in stdout or HTTP response body. |
11339-
| `not_contains` | no | `string` | | Substring that must not appear in stdout. |
11340-
| `sudo` | no | `boolean` | `False` | Run the remote operation through sudo -n when supported. |
11341-
| `get_pty` | no | `boolean` | `False` | Request a pseudo-terminal for the remote command. |
11342-
11343-
Result fields:
11344-
11345-
- `changed`: Whether the plugin changed the target or controller state.
11346-
- `message`: Human-readable result message.
11347-
- `rc`: Process or command return code when applicable.
11348-
- `stdout`: Captured standard output when applicable.
11349-
- `stderr`: Captured standard error when applicable.
11350-
- `data`: Plugin-specific structured result data.
11351-
11352-
Example:
11353-
11354-
```yaml
11355-
use: wait.command
11356-
with:
11357-
command: echo automax
11358-
```
11359-
1136011288
### `wait.file`
1136111289

1136211290
Wait until a remote file condition is true.

docs/plugins/index.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ archive.tar
3434
archive.untar
3535
archive.unzip
3636
archive.zip
37-
assert.command
3837
assert.disk
3938
assert.file
4039
assert.path
@@ -205,6 +204,7 @@ network.bond
205204
network.bridge
206205
network.dns
207206
network.dns_assert
207+
network.dns_facts
208208
network.interface
209209
network.link_assert
210210
network.port_check
@@ -261,8 +261,6 @@ process.kill
261261
process.signal
262262
process.wait
263263
remote.command
264-
network.dns
265-
network.dns_facts
266264
secret.redact_assert
267265
secret.scan_output
268266
secret.scan_preview
@@ -348,12 +346,10 @@ user.remove
348346
user.set_password
349347
user.shell_assert
350348
user.unlock
351-
wait.command
352349
wait.file
353350
wait.path
354351
wait.process
355352
wait.tcp
356-
357353
```
358354

359355
## Manuals by category

docs/plugins/wait-assert.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,6 @@ TCP checks run from the controller.
3131
port: 443
3232
```
3333
34-
## `wait.command` and `assert.command`
35-
36-
Command checks run on the remote target.
37-
38-
```yaml
39-
- id: wait_service_active
40-
use: wait.command
41-
with:
42-
command: "systemctl is-active nginx"
43-
equals: active
44-
timeout: 120
45-
interval: 5
46-
sudo: true
47-
48-
- id: assert_version
49-
use: assert.command
50-
with:
51-
command: "/opt/myapp/bin/myapp --version"
52-
contains: "{{ vars.version }}"
53-
```
54-
55-
Supported expectations are `rc`, `equals`, `contains` and `not_contains`.
56-
5734
## `wait.file`, `wait.path`, `assert.file`, `assert.path`
5835

5936
Remote file/path checks.

examples/runbooks/RUNBOOK_INDEX.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Per-plugin runbooks only. No combined runbook, no reused runtime smoke flow, and
77
| `runbooks/01-alternatives.check.yaml` | `alternatives` | 3 |
88
| `runbooks/02-apparmor.check.yaml` | `apparmor` | 8 |
99
| `runbooks/03-archive.check.yaml` | `archive` | 6 |
10-
| `runbooks/04-assert.check.yaml` | `assert` | 5 |
10+
| `runbooks/04-assert.check.yaml` | `assert` | 4 |
1111
| `runbooks/05-auditd.check.yaml` | `auditd` | 8 |
1212
| `runbooks/06-authselect.check.yaml` | `authselect` | 1 |
1313
| `runbooks/07-backup.check.yaml` | `backup` | 9 |
@@ -68,4 +68,4 @@ Per-plugin runbooks only. No combined runbook, no reused runtime smoke flow, and
6868
| `runbooks/63-udev.check.yaml` | `udev` | 7 |
6969
| `runbooks/64-ufw.check.yaml` | `ufw` | 6 |
7070
| `runbooks/65-user.check.yaml` | `user` | 11 |
71-
| `runbooks/66-wait.check.yaml` | `wait` | 5 |
71+
| `runbooks/66-wait.check.yaml` | `wait` | 4 |

examples/runbooks/runbooks/04-assert.check.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ tasks:
1414
steps:
1515
- id: catalog
1616
substeps:
17-
- id: assert_command
18-
use: assert.command
19-
with:
20-
command: echo automax
2117
- id: assert_disk
2218
use: assert.disk
2319
with:

examples/runbooks/runbooks/66-wait.check.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ tasks:
1414
steps:
1515
- id: catalog
1616
substeps:
17-
- id: wait_command
18-
use: wait.command
19-
with:
20-
command: echo automax
2117
- id: wait_file
2218
use: wait.file
2319
with:

scripts/ssh-smoke.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ tasks:
111111
ssh_smoke_output: stdout.trim
112112
artifacts:
113113
stdout: core/read-marker.txt
114-
- id: assert_marker
115-
use: assert.command
116-
with:
117-
command: "cat result.txt"
118-
equals: automax-ssh-ok
119114
- id: exists_marker
120115
use: fs.exists
121116
with:
@@ -255,13 +250,6 @@ tasks:
255250
type: directory
256251
timeout: 10
257252
interval: 1
258-
- id: wait_command
259-
use: wait.command
260-
with:
261-
command: "cat ${WORK_DIR}/result.txt"
262-
contains: line=new
263-
timeout: 10
264-
interval: 1
265253
- id: start_background_process
266254
use: remote.command
267255
with:

src/automax/plugins/manual_preview.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ def fallback_manual_commands(plugin_name: str, params: Dict[str, Any], context:
133133
return [f"{sudo}aa-status"]
134134

135135
if plugin_name.startswith("assert."):
136-
if plugin_name == "assert.command":
137-
return [str(params.get("command", "true"))]
138136
if plugin_name in {"assert.file", "assert.path"}:
139137
return [f"test -e {_q(path)}"]
140138
if plugin_name == "assert.disk":
@@ -312,8 +310,6 @@ def fallback_manual_commands(plugin_name: str, params: Dict[str, Any], context:
312310
if plugin_name.startswith("wait."):
313311
timeout = params.get("timeout", 60)
314312
interval = params.get("interval", 2)
315-
if plugin_name == "wait.command":
316-
return [f"timeout {_q(timeout)} sh -c 'until {params.get('command', 'true')}; do sleep {_q(interval)}; done'"]
317313
if plugin_name in {"wait.file", "wait.path"}:
318314
return [f"timeout {_q(timeout)} sh -c 'until test -e {_q(path)}; do sleep {_q(interval)}; done'"]
319315
if plugin_name == "wait.process":

src/automax/plugins/registry.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,10 @@ def build_builtin_registry(extra_plugin_paths: Iterable[str] = ()) -> PluginRegi
198198
)
199199
from automax.plugins.http import HttpAssertPlugin, HttpRequestPlugin, HttpWaitPlugin
200200
from automax.plugins.wait_assert import (
201-
AssertCommandPlugin,
202201
AssertDiskPlugin,
203202
AssertFilePlugin,
204203
AssertPathPlugin,
205204
AssertTcpPlugin,
206-
WaitCommandPlugin,
207205
WaitFilePlugin,
208206
WaitPathPlugin,
209207
WaitProcessPlugin,
@@ -512,12 +510,10 @@ def build_builtin_registry(extra_plugin_paths: Iterable[str] = ()) -> PluginRegi
512510
FactsServicesPlugin(),
513511
PlatformFactsPlugin(),
514512
WaitTcpPlugin(),
515-
WaitCommandPlugin(),
516513
WaitFilePlugin(),
517514
WaitPathPlugin(),
518515
WaitProcessPlugin(),
519516
AssertTcpPlugin(),
520-
AssertCommandPlugin(),
521517
AssertFilePlugin(),
522518
AssertPathPlugin(),
523519
AssertDiskPlugin(),

0 commit comments

Comments
 (0)