qa-orchestrator 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qa_orchestrator-0.1.0/.gitignore +15 -0
- qa_orchestrator-0.1.0/LICENSE +202 -0
- qa_orchestrator-0.1.0/NOTICE +32 -0
- qa_orchestrator-0.1.0/PKG-INFO +171 -0
- qa_orchestrator-0.1.0/README.md +151 -0
- qa_orchestrator-0.1.0/pyproject.toml +55 -0
- qa_orchestrator-0.1.0/scenarios/fixtures/board.json +14 -0
- qa_orchestrator-0.1.0/scenarios/sensor-removed.yaml +49 -0
- qa_orchestrator-0.1.0/scenarios/stuck-at.yaml +71 -0
- qa_orchestrator-0.1.0/src/qa_orchestrator/__init__.py +10 -0
- qa_orchestrator-0.1.0/src/qa_orchestrator/backends/__init__.py +70 -0
- qa_orchestrator-0.1.0/src/qa_orchestrator/backends/mock.py +115 -0
- qa_orchestrator-0.1.0/src/qa_orchestrator/backends/qemu.py +167 -0
- qa_orchestrator-0.1.0/src/qa_orchestrator/backends/testbed.py +42 -0
- qa_orchestrator-0.1.0/src/qa_orchestrator/cli.py +111 -0
- qa_orchestrator-0.1.0/src/qa_orchestrator/compare.py +156 -0
- qa_orchestrator-0.1.0/src/qa_orchestrator/referee.py +125 -0
- qa_orchestrator-0.1.0/src/qa_orchestrator/run.py +145 -0
- qa_orchestrator-0.1.0/src/qa_orchestrator/scenario.py +316 -0
- qa_orchestrator-0.1.0/tests/test_backends.py +111 -0
- qa_orchestrator-0.1.0/tests/test_boundary.py +82 -0
- qa_orchestrator-0.1.0/tests/test_compare.py +163 -0
- qa_orchestrator-0.1.0/tests/test_readme.py +146 -0
- qa_orchestrator-0.1.0/tests/test_scenario.py +210 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
.pytest_cache/
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
*.egg-info/
|
|
7
|
+
.venv/
|
|
8
|
+
venv/
|
|
9
|
+
|
|
10
|
+
# Walks recorded from a real machine. A Redfish walk carries serial numbers, asset
|
|
11
|
+
# tags and MAC addresses, so a capture is a fleet inventory disclosure. Scenario
|
|
12
|
+
# runs write walks to a temporary directory for exactly this reason; anything
|
|
13
|
+
# landing here was put here deliberately and should be looked at before committing.
|
|
14
|
+
walks/
|
|
15
|
+
*.capture.json
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
qa-orchestrator
|
|
2
|
+
Copyright 2026 James Sheen
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
6
|
+
License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
11
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
12
|
+
CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
|
|
14
|
+
DEPENDENCIES
|
|
15
|
+
|
|
16
|
+
One at runtime. The scenario format is YAML and the standard library has no
|
|
17
|
+
reader for it; everything else here is stdlib, because this has to run on the
|
|
18
|
+
same bring-up bench the audit tool holds itself to.
|
|
19
|
+
|
|
20
|
+
PyYAML MIT
|
|
21
|
+
|
|
22
|
+
Two optional, neither of them imported for a verdict:
|
|
23
|
+
|
|
24
|
+
bmc-sensor-audit Apache-2.0 the referee, run as a subprocess and read
|
|
25
|
+
through its exit code and its report --
|
|
26
|
+
see referee.py, and the test that parses
|
|
27
|
+
this package's imports to keep it that way
|
|
28
|
+
pytest MIT tests only; not installed by a plain
|
|
29
|
+
`pip install qa-orchestrator`
|
|
30
|
+
|
|
31
|
+
Licences read from each distribution's own metadata, not from a list written
|
|
32
|
+
somewhere else and copied.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: qa-orchestrator
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Inject faults, drive walks, and check the audit tool reached the verdict it should have.
|
|
5
|
+
Project-URL: Homepage, https://github.com/james-sheen/qa-orchestrator
|
|
6
|
+
Project-URL: Source, https://github.com/james-sheen/qa-orchestrator
|
|
7
|
+
Project-URL: Issues, https://github.com/james-sheen/qa-orchestrator/issues
|
|
8
|
+
Author: James Sheen
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: NOTICE
|
|
12
|
+
Keywords: bmc,certification,fault-injection,openbmc,qa,redfish
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Requires-Dist: pyyaml>=6
|
|
15
|
+
Provides-Extra: dev
|
|
16
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
17
|
+
Provides-Extra: referee
|
|
18
|
+
Requires-Dist: bmc-sensor-audit[detect]<0.2,>=0.1; extra == 'referee'
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# qa-orchestrator
|
|
22
|
+
|
|
23
|
+
Inject faults, drive walks, and check the audit tool reached the verdict it should have.
|
|
24
|
+
|
|
25
|
+
[`bmc-sensor-audit`](https://github.com/james-sheen/bmc-sensor-audit) judges firmware:
|
|
26
|
+
it diffs what an OpenBMC declaration promises against what the machine reports. This
|
|
27
|
+
drives both sides. It perturbs a machine in ways whose correct verdict is known in
|
|
28
|
+
advance — a sensor removed, one switched off, a reading frozen — and checks the tool
|
|
29
|
+
reached it.
|
|
30
|
+
|
|
31
|
+
## Why this is a separate program
|
|
32
|
+
|
|
33
|
+
**The audit tool is the judge of the outcome, so it cannot also be the injector.**
|
|
34
|
+
A referee that shipped its own fault injection would be certifying itself: every
|
|
35
|
+
scenario would be written against the behaviour the tool happens to have, and a
|
|
36
|
+
tool that stopped detecting something would quietly stop being asked about it.
|
|
37
|
+
|
|
38
|
+
So the injector lives outside and consumes only the referee's published surfaces —
|
|
39
|
+
exit codes, the JSON report, the attestation. `referee.py` does not import
|
|
40
|
+
`bmc_sensor_audit`, and a test asserts that by reading the file. If a scenario needs
|
|
41
|
+
something the published surface does not carry, that is a feature request against
|
|
42
|
+
the tool, not a reason to reach past it.
|
|
43
|
+
|
|
44
|
+
## A scenario
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
format: qa-scenario/1
|
|
48
|
+
backend: mock
|
|
49
|
+
mode: coverage
|
|
50
|
+
config: fixtures/board.json # resolved beside this file, not from the cwd
|
|
51
|
+
|
|
52
|
+
machine:
|
|
53
|
+
sensors:
|
|
54
|
+
- {name: Inlet, reading: 21.0, upper_critical: 80, upper_warning: 70}
|
|
55
|
+
- {name: Outlet, reading: 27.5, upper_critical: 80, upper_warning: 70}
|
|
56
|
+
|
|
57
|
+
phases:
|
|
58
|
+
- walks: 1
|
|
59
|
+
expect:
|
|
60
|
+
audit: {exit: 0}
|
|
61
|
+
|
|
62
|
+
- action: {remove: Outlet}
|
|
63
|
+
walks: 1
|
|
64
|
+
expect:
|
|
65
|
+
audit:
|
|
66
|
+
exit: 1
|
|
67
|
+
finding: "not reported by the machine at all"
|
|
68
|
+
names: [Outlet]
|
|
69
|
+
not_names: [Inlet]
|
|
70
|
+
firmware: {Outlet: absent, Inlet: reading}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Released — 0.1.0**, tagged `v0.1.0`, Apache-2.0, on PyPI as `qa-orchestrator`.
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
pip install qa-orchestrator
|
|
77
|
+
|
|
78
|
+
qa-orchestrator check <scenario.yaml> # parse only; needs no machine
|
|
79
|
+
qa-orchestrator run <scenario.yaml>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The two worked scenarios are named with a placeholder above rather than by
|
|
83
|
+
filename, because a wheel carries only what lives under the package directory: a
|
|
84
|
+
`pip install` gives you the command and not the examples. They ship in this
|
|
85
|
+
repository and in the sdist, under `scenarios/`. From a clone,
|
|
86
|
+
`pip install -e .` puts the same script on the path and the scenarios beside it.
|
|
87
|
+
|
|
88
|
+
**`audit` and `firmware` are different claims and both are worth making.** *The
|
|
89
|
+
sensor is gone* and *the tool noticed it is gone* are separate facts. A scenario
|
|
90
|
+
that could only express the second could never tell a broken injector from a blind
|
|
91
|
+
referee — the run would be green either way.
|
|
92
|
+
|
|
93
|
+
**`not_names` is half of every detection claim.** Naming the frozen sensor shows
|
|
94
|
+
the tool found something; showing the sensor beside it was *not* named is what
|
|
95
|
+
makes that evidence of detection rather than of a check that flags everything.
|
|
96
|
+
|
|
97
|
+
## The format refuses what it cannot run
|
|
98
|
+
|
|
99
|
+
A phase with no walks, an `expect` block that sets nothing, an action verb this
|
|
100
|
+
build does not implement, a `drive` with fewer values than walks, `exit_code` where
|
|
101
|
+
`exit` was meant — all rejected at parse time with the phase named. Each of them
|
|
102
|
+
would otherwise produce a run that executed, reported clean, and tested nothing,
|
|
103
|
+
which is indistinguishable from a real pass at the exit code.
|
|
104
|
+
|
|
105
|
+
## Three tiers, and one of them says so
|
|
106
|
+
|
|
107
|
+
| Backend | What it is | State |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| `mock` | the audit tool's own `MockBMC`, in process | working; needs no hardware |
|
|
110
|
+
| `qemu` | attaches to a running instance, injects over QMP | wire format tested, integration not |
|
|
111
|
+
| `testbed` | relay boards and real fans | **not implemented, and refuses** |
|
|
112
|
+
|
|
113
|
+
The tiers exist so one scenario runs at increasing cost and realism without being
|
|
114
|
+
rewritten. That only holds if a tier which cannot do something refuses instead of
|
|
115
|
+
approximating it. `testbed` raises at construction and its refusal lists what a
|
|
116
|
+
real implementation needs — a specification, not an apology. A stub that accepted
|
|
117
|
+
injections and did nothing would report that real fans were pulled having touched
|
|
118
|
+
nothing, and every phase after it would judge an unperturbed machine and pass.
|
|
119
|
+
|
|
120
|
+
`qemu` attaches to an already-running instance whose QMP socket the scenario names.
|
|
121
|
+
**It does not boot one.** Owning the boot recipe — image build id, machine type, FRU
|
|
122
|
+
provisioning — is real work that is not done here, and claiming it would be worse
|
|
123
|
+
than not having it. The QMP conversation is tested against a fake socket, so the
|
|
124
|
+
greeting, handshake, framing and error path are covered; no real QEMU has run it.
|
|
125
|
+
|
|
126
|
+
## Exit codes
|
|
127
|
+
|
|
128
|
+
The same three-valued contract the audit tool uses, because this sits in the same
|
|
129
|
+
pipeline and a fourth vocabulary at this layer is one more thing for a gate to get
|
|
130
|
+
wrong:
|
|
131
|
+
|
|
132
|
+
| | |
|
|
133
|
+
|---|---|
|
|
134
|
+
| `0` | every expectation held |
|
|
135
|
+
| `1` | a verdict disagreed with the scenario |
|
|
136
|
+
| `2` | the run could not be completed |
|
|
137
|
+
|
|
138
|
+
**`2` never reads as clean.** A scenario that could not reach its backend has judged
|
|
139
|
+
nothing. Could-not-complete outranks disagreement, because a run that stopped early
|
|
140
|
+
has not evaluated the phases it never reached.
|
|
141
|
+
|
|
142
|
+
A run also reports how many phases asserted anything. A scenario of phases that
|
|
143
|
+
assert nothing is green and worthless, and the exit code cannot tell that from a
|
|
144
|
+
real pass — so it is said in words instead.
|
|
145
|
+
|
|
146
|
+
## The acceptance scenario
|
|
147
|
+
|
|
148
|
+
`scenarios/stuck-at.yaml` reproduces the experiment the audit tool already ships: a
|
|
149
|
+
sensor driven to a new value before each of twelve walks, then left alone for
|
|
150
|
+
sixteen. The engine is silent while everything moves and names exactly the frozen
|
|
151
|
+
sensor once one freezes, with a control sensor still moving beside it.
|
|
152
|
+
|
|
153
|
+
That experiment is the acceptance test for this harness, because its outcome is
|
|
154
|
+
already known. **If the orchestrator cannot express it, the DSL is wrong** — and at
|
|
155
|
+
first it could not: `drive` took one sensor and a phase may carry only one action,
|
|
156
|
+
so there was no way to keep a control moving beside the frozen one. The general
|
|
157
|
+
`drive: {sensors: {...}}` form exists because this file needed it.
|
|
158
|
+
|
|
159
|
+
Two things it does not show. Freezing a reading through a mock is an experiment, not
|
|
160
|
+
a sensor failing on its own. And the declaration it runs against carries thresholds
|
|
161
|
+
deliberately: a sensor declaring none is excluded from the liveness model entirely,
|
|
162
|
+
so a thresholdless board produces an empty model and a clean run that checked
|
|
163
|
+
nothing.
|
|
164
|
+
|
|
165
|
+
## Not built yet
|
|
166
|
+
|
|
167
|
+
- The redundancy scenario against the audit tool's supplemental template.
|
|
168
|
+
- The `qemu` boot recipe; this build attaches to a running instance.
|
|
169
|
+
- The `testbed` tier, which needs a lab.
|
|
170
|
+
|
|
171
|
+
Apache-2.0.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# qa-orchestrator
|
|
2
|
+
|
|
3
|
+
Inject faults, drive walks, and check the audit tool reached the verdict it should have.
|
|
4
|
+
|
|
5
|
+
[`bmc-sensor-audit`](https://github.com/james-sheen/bmc-sensor-audit) judges firmware:
|
|
6
|
+
it diffs what an OpenBMC declaration promises against what the machine reports. This
|
|
7
|
+
drives both sides. It perturbs a machine in ways whose correct verdict is known in
|
|
8
|
+
advance — a sensor removed, one switched off, a reading frozen — and checks the tool
|
|
9
|
+
reached it.
|
|
10
|
+
|
|
11
|
+
## Why this is a separate program
|
|
12
|
+
|
|
13
|
+
**The audit tool is the judge of the outcome, so it cannot also be the injector.**
|
|
14
|
+
A referee that shipped its own fault injection would be certifying itself: every
|
|
15
|
+
scenario would be written against the behaviour the tool happens to have, and a
|
|
16
|
+
tool that stopped detecting something would quietly stop being asked about it.
|
|
17
|
+
|
|
18
|
+
So the injector lives outside and consumes only the referee's published surfaces —
|
|
19
|
+
exit codes, the JSON report, the attestation. `referee.py` does not import
|
|
20
|
+
`bmc_sensor_audit`, and a test asserts that by reading the file. If a scenario needs
|
|
21
|
+
something the published surface does not carry, that is a feature request against
|
|
22
|
+
the tool, not a reason to reach past it.
|
|
23
|
+
|
|
24
|
+
## A scenario
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
format: qa-scenario/1
|
|
28
|
+
backend: mock
|
|
29
|
+
mode: coverage
|
|
30
|
+
config: fixtures/board.json # resolved beside this file, not from the cwd
|
|
31
|
+
|
|
32
|
+
machine:
|
|
33
|
+
sensors:
|
|
34
|
+
- {name: Inlet, reading: 21.0, upper_critical: 80, upper_warning: 70}
|
|
35
|
+
- {name: Outlet, reading: 27.5, upper_critical: 80, upper_warning: 70}
|
|
36
|
+
|
|
37
|
+
phases:
|
|
38
|
+
- walks: 1
|
|
39
|
+
expect:
|
|
40
|
+
audit: {exit: 0}
|
|
41
|
+
|
|
42
|
+
- action: {remove: Outlet}
|
|
43
|
+
walks: 1
|
|
44
|
+
expect:
|
|
45
|
+
audit:
|
|
46
|
+
exit: 1
|
|
47
|
+
finding: "not reported by the machine at all"
|
|
48
|
+
names: [Outlet]
|
|
49
|
+
not_names: [Inlet]
|
|
50
|
+
firmware: {Outlet: absent, Inlet: reading}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Released — 0.1.0**, tagged `v0.1.0`, Apache-2.0, on PyPI as `qa-orchestrator`.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
pip install qa-orchestrator
|
|
57
|
+
|
|
58
|
+
qa-orchestrator check <scenario.yaml> # parse only; needs no machine
|
|
59
|
+
qa-orchestrator run <scenario.yaml>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The two worked scenarios are named with a placeholder above rather than by
|
|
63
|
+
filename, because a wheel carries only what lives under the package directory: a
|
|
64
|
+
`pip install` gives you the command and not the examples. They ship in this
|
|
65
|
+
repository and in the sdist, under `scenarios/`. From a clone,
|
|
66
|
+
`pip install -e .` puts the same script on the path and the scenarios beside it.
|
|
67
|
+
|
|
68
|
+
**`audit` and `firmware` are different claims and both are worth making.** *The
|
|
69
|
+
sensor is gone* and *the tool noticed it is gone* are separate facts. A scenario
|
|
70
|
+
that could only express the second could never tell a broken injector from a blind
|
|
71
|
+
referee — the run would be green either way.
|
|
72
|
+
|
|
73
|
+
**`not_names` is half of every detection claim.** Naming the frozen sensor shows
|
|
74
|
+
the tool found something; showing the sensor beside it was *not* named is what
|
|
75
|
+
makes that evidence of detection rather than of a check that flags everything.
|
|
76
|
+
|
|
77
|
+
## The format refuses what it cannot run
|
|
78
|
+
|
|
79
|
+
A phase with no walks, an `expect` block that sets nothing, an action verb this
|
|
80
|
+
build does not implement, a `drive` with fewer values than walks, `exit_code` where
|
|
81
|
+
`exit` was meant — all rejected at parse time with the phase named. Each of them
|
|
82
|
+
would otherwise produce a run that executed, reported clean, and tested nothing,
|
|
83
|
+
which is indistinguishable from a real pass at the exit code.
|
|
84
|
+
|
|
85
|
+
## Three tiers, and one of them says so
|
|
86
|
+
|
|
87
|
+
| Backend | What it is | State |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| `mock` | the audit tool's own `MockBMC`, in process | working; needs no hardware |
|
|
90
|
+
| `qemu` | attaches to a running instance, injects over QMP | wire format tested, integration not |
|
|
91
|
+
| `testbed` | relay boards and real fans | **not implemented, and refuses** |
|
|
92
|
+
|
|
93
|
+
The tiers exist so one scenario runs at increasing cost and realism without being
|
|
94
|
+
rewritten. That only holds if a tier which cannot do something refuses instead of
|
|
95
|
+
approximating it. `testbed` raises at construction and its refusal lists what a
|
|
96
|
+
real implementation needs — a specification, not an apology. A stub that accepted
|
|
97
|
+
injections and did nothing would report that real fans were pulled having touched
|
|
98
|
+
nothing, and every phase after it would judge an unperturbed machine and pass.
|
|
99
|
+
|
|
100
|
+
`qemu` attaches to an already-running instance whose QMP socket the scenario names.
|
|
101
|
+
**It does not boot one.** Owning the boot recipe — image build id, machine type, FRU
|
|
102
|
+
provisioning — is real work that is not done here, and claiming it would be worse
|
|
103
|
+
than not having it. The QMP conversation is tested against a fake socket, so the
|
|
104
|
+
greeting, handshake, framing and error path are covered; no real QEMU has run it.
|
|
105
|
+
|
|
106
|
+
## Exit codes
|
|
107
|
+
|
|
108
|
+
The same three-valued contract the audit tool uses, because this sits in the same
|
|
109
|
+
pipeline and a fourth vocabulary at this layer is one more thing for a gate to get
|
|
110
|
+
wrong:
|
|
111
|
+
|
|
112
|
+
| | |
|
|
113
|
+
|---|---|
|
|
114
|
+
| `0` | every expectation held |
|
|
115
|
+
| `1` | a verdict disagreed with the scenario |
|
|
116
|
+
| `2` | the run could not be completed |
|
|
117
|
+
|
|
118
|
+
**`2` never reads as clean.** A scenario that could not reach its backend has judged
|
|
119
|
+
nothing. Could-not-complete outranks disagreement, because a run that stopped early
|
|
120
|
+
has not evaluated the phases it never reached.
|
|
121
|
+
|
|
122
|
+
A run also reports how many phases asserted anything. A scenario of phases that
|
|
123
|
+
assert nothing is green and worthless, and the exit code cannot tell that from a
|
|
124
|
+
real pass — so it is said in words instead.
|
|
125
|
+
|
|
126
|
+
## The acceptance scenario
|
|
127
|
+
|
|
128
|
+
`scenarios/stuck-at.yaml` reproduces the experiment the audit tool already ships: a
|
|
129
|
+
sensor driven to a new value before each of twelve walks, then left alone for
|
|
130
|
+
sixteen. The engine is silent while everything moves and names exactly the frozen
|
|
131
|
+
sensor once one freezes, with a control sensor still moving beside it.
|
|
132
|
+
|
|
133
|
+
That experiment is the acceptance test for this harness, because its outcome is
|
|
134
|
+
already known. **If the orchestrator cannot express it, the DSL is wrong** — and at
|
|
135
|
+
first it could not: `drive` took one sensor and a phase may carry only one action,
|
|
136
|
+
so there was no way to keep a control moving beside the frozen one. The general
|
|
137
|
+
`drive: {sensors: {...}}` form exists because this file needed it.
|
|
138
|
+
|
|
139
|
+
Two things it does not show. Freezing a reading through a mock is an experiment, not
|
|
140
|
+
a sensor failing on its own. And the declaration it runs against carries thresholds
|
|
141
|
+
deliberately: a sensor declaring none is excluded from the liveness model entirely,
|
|
142
|
+
so a thresholdless board produces an empty model and a clean run that checked
|
|
143
|
+
nothing.
|
|
144
|
+
|
|
145
|
+
## Not built yet
|
|
146
|
+
|
|
147
|
+
- The redundancy scenario against the audit tool's supplemental template.
|
|
148
|
+
- The `qemu` boot recipe; this build attaches to a running instance.
|
|
149
|
+
- The `testbed` tier, which needs a lab.
|
|
150
|
+
|
|
151
|
+
Apache-2.0.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "qa-orchestrator"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Inject faults, drive walks, and check the audit tool reached the verdict it should have."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE", "NOTICE"]
|
|
13
|
+
authors = [{ name = "James Sheen" }]
|
|
14
|
+
keywords = ["openbmc", "redfish", "bmc", "qa", "fault-injection", "certification"]
|
|
15
|
+
|
|
16
|
+
# PyYAML only. The scenario format is YAML and there is no standard-library
|
|
17
|
+
# reader for it; everything else here is stdlib on purpose, because this has to
|
|
18
|
+
# run on the same bring-up bench the audit tool holds itself to.
|
|
19
|
+
dependencies = ["pyyaml>=6"]
|
|
20
|
+
|
|
21
|
+
[project.optional-dependencies]
|
|
22
|
+
# The referee. Invoked as a subprocess, never imported for its verdicts -- see
|
|
23
|
+
# referee.py. Declared as an extra rather than a hard dependency so `check`
|
|
24
|
+
# (parse-only) works with nothing else installed.
|
|
25
|
+
referee = ["bmc-sensor-audit[detect]>=0.1,<0.2"]
|
|
26
|
+
dev = ["pytest>=7"]
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
qa-orchestrator = "qa_orchestrator.cli:main"
|
|
30
|
+
|
|
31
|
+
# Metadata is immutable per version, and a page with no way back to the source
|
|
32
|
+
# is the shape a released 0.1.0 gets stuck with. Declared before the first
|
|
33
|
+
# upload rather than after it.
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/james-sheen/qa-orchestrator"
|
|
36
|
+
Source = "https://github.com/james-sheen/qa-orchestrator"
|
|
37
|
+
Issues = "https://github.com/james-sheen/qa-orchestrator/issues"
|
|
38
|
+
|
|
39
|
+
[tool.hatch.version]
|
|
40
|
+
path = "src/qa_orchestrator/__init__.py"
|
|
41
|
+
|
|
42
|
+
[tool.hatch.build.targets.wheel]
|
|
43
|
+
packages = ["src/qa_orchestrator"]
|
|
44
|
+
|
|
45
|
+
# The two worked scenarios reach the sdist and not the wheel: a wheel carries
|
|
46
|
+
# only what lives under the package directory. The README says where they are
|
|
47
|
+
# rather than showing a command that needs them, because a quickstart an
|
|
48
|
+
# installing reader cannot run is worse than one that names a placeholder.
|
|
49
|
+
[tool.hatch.build.targets.sdist]
|
|
50
|
+
include = ["src/", "tests/", "scenarios/", "README.md", "LICENSE", "NOTICE",
|
|
51
|
+
"pyproject.toml"]
|
|
52
|
+
|
|
53
|
+
[tool.pytest.ini_options]
|
|
54
|
+
testpaths = ["tests"]
|
|
55
|
+
pythonpath = ["src"]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_why": "A minimal entity-manager declaration for the acceptance scenario. Thresholds are declared, and that is load-bearing rather than decorative: the model generator excludes a sensor that declares none, so a thresholdless board produces an empty liveness model and a clean run that checked nothing. The mock serves the same numbers, so coverage stays quiet and the scenario is about liveness alone.",
|
|
3
|
+
"Name": "QA Reference Board",
|
|
4
|
+
"Exposes": [
|
|
5
|
+
{"Name": "Inlet", "Type": "TMP75",
|
|
6
|
+
"Thresholds": [
|
|
7
|
+
{"Name": "upper critical", "Severity": 1, "Direction": "greater than", "Value": 80},
|
|
8
|
+
{"Name": "upper warning", "Severity": 0, "Direction": "greater than", "Value": 70}]},
|
|
9
|
+
{"Name": "Outlet", "Type": "TMP75",
|
|
10
|
+
"Thresholds": [
|
|
11
|
+
{"Name": "upper critical", "Severity": 1, "Direction": "greater than", "Value": 80},
|
|
12
|
+
{"Name": "upper warning", "Severity": 0, "Direction": "greater than", "Value": 70}]}
|
|
13
|
+
]
|
|
14
|
+
}
|