1818rather than for podman's inability to mount, which would make a row pass for the
1919wrong reason and hide an emit bug behind a parity claim.
2020
21- Not every refusal site can have a row. `network_mode` is refused under ADR-0003, not
22- rule two, and podman honours it (#115); `nocopy` and `deploy.resources.reservations.*`
23- do not fit this shape at all (#116). The gate that every *rule-two* site has a row is
24- issue #109 phase 3, and it has to know about those exemptions before it can be written.
21+ Two more tables hold the refusals whose claim is about podman's *flag surface* rather
22+ than about a mount, which `Refusal` cannot express: its argv asserts that a flag fails,
23+ and here the claim is that no flag exists to try, or that one exists and checks nothing.
24+
25+ - `ABSENT_FLAGS` -- no such flag on `podman run`, checked by running it rather than by
26+ reading `--help`, because `--gpus` proves a flag can exist while staying out of it.
27+ - `STUB_FLAGS` -- the flag exists and accepts deliberate nonsense, so emitting it would
28+ exit 0 having done nothing, which is worse than refusing.
29+
30+ Four claims, four experiments. `network_mode` alone has no row: it is refused under
31+ ADR-0003, not rule two, and podman honours it (#115). The gate that every rule-two site
32+ has a row is issue #109 phase 3, and that is the exemption it has to know about.
2533
2634A `subpath` row measures the floor, not podman as such: podman gained the option above
2735the supported minimum (ADR-0006), so the row goes red on a runner newer than the floor,
@@ -53,14 +61,43 @@ class Limitation:
5361
5462 `host_dir` is created under the test's `tmp_path` first, because a bind whose
5563 source does not exist fails for that reason instead of the one being measured.
56- `{host}` in `podman_argv` is substituted with its absolute path.
64+ `{host}` in `podman_argv` is substituted with its absolute path. A row whose
65+ counterfactual needs no host path leaves it empty.
5766 """
5867
5968 id : str
6069 compose : dict [str , Any ]
6170 refusal_match : str
62- host_dir : str
6371 podman_argv : list [str ]
72+ host_dir : str = ""
73+
74+
75+ @dataclass (frozen = True )
76+ class AbsentFlag :
77+ """A refusal whose claim is that podman has no flag to emit for the key.
78+
79+ Each `unknown_argv` must be rejected by `podman run`. The row goes red the day
80+ podman grows one, which is the only thing keeping "no equivalent" from going stale.
81+ """
82+
83+ id : str
84+ compose : dict [str , Any ]
85+ refusal_match : str
86+ unknown_argv : list [list [str ]]
87+
88+
89+ @dataclass (frozen = True )
90+ class StubFlag :
91+ """A refusal whose claim is that podman's flag exists and validates nothing.
92+
93+ `nonsense_argv` is deliberate rubbish podman accepts anyway; the row goes red when
94+ a podman starts rejecting it, which is when the refusal deserves re-examining.
95+ """
96+
97+ id : str
98+ compose : dict [str , Any ]
99+ refusal_match : str
100+ nonsense_argv : list [str ]
64101
65102
66103def _one_volume (entry : "str | dict[str, Any]" ) -> dict [str , Any ]:
@@ -156,7 +193,27 @@ def _one_volume(entry: "str | dict[str, Any]") -> dict[str, Any]:
156193]
157194
158195
196+ def _reservation (field : str , value : object ) -> dict [str , Any ]:
197+ return {"services" : {"app" : {"image" : "busybox:1.36" , "deploy" : {"resources" : {"reservations" : {field : value }}}}}}
198+
199+
159200LIMITATIONS : list [Limitation ] = [
201+ Limitation (
202+ # Measured: `-v vol:/etc:nocopy` leaves only podman's own hosts/hostname/resolv.conf
203+ # in the volume, so the image copy-up really is suppressed.
204+ id = "volume-nocopy" ,
205+ compose = {
206+ "services" : {
207+ "app" : {
208+ "image" : "busybox:1.36" ,
209+ "volumes" : [{"type" : "volume" , "source" : "ncvol" , "target" : "/data" , "volume" : {"nocopy" : True }}],
210+ }
211+ },
212+ "volumes" : {"ncvol" : {}},
213+ },
214+ refusal_match = "use the short syntax, which emits -v" ,
215+ podman_argv = ["-v" , "c2p-nocopy-probe:/data:nocopy" ],
216+ ),
160217 Limitation (
161218 id = "drive-qualified-bind" ,
162219 compose = _one_volume ("C:\\ data:/var" ),
@@ -172,3 +229,23 @@ def _one_volume(entry: "str | dict[str, Any]") -> dict[str, Any]:
172229 podman_argv = ["--mount" , "type=bind,src={host},dst=/var" ],
173230 ),
174231]
232+
233+
234+ ABSENT_FLAGS : list [AbsentFlag ] = [
235+ AbsentFlag (
236+ id = "reservations-cpus" ,
237+ compose = _reservation ("cpus" , "0.5" ),
238+ refusal_match = "podman run has no reservation flag for it" ,
239+ unknown_argv = [["--cpu-reservation" , "1" ], ["--cpus-reservation" , "1" ]],
240+ ),
241+ ]
242+
243+
244+ STUB_FLAGS : list [StubFlag ] = [
245+ StubFlag (
246+ id = "reservations-devices" ,
247+ compose = _reservation ("devices" , [{"capabilities" : ["gpu" ]}]),
248+ refusal_match = "--gpus accepts any value and reserves nothing" ,
249+ nonsense_argv = ["--gpus" , "nonsense" ],
250+ ),
251+ ]
0 commit comments