| 98 | |
| 99 | |
| 100 | def bounds(context, case): |
| 101 | runner, marker = untouched_runner(case) |
| 102 | options = ["--max-output-bytes", "--max-total-output-bytes", "--max-profile-bytes", |
| 103 | "--max-total-profile-bytes", "--max-profile-files", "--conversion-timeout", |
| 104 | "--max-map-bytes", "--reduction-timeout", "--timeout"] |
| 105 | for number, option in enumerate(options): |
| 106 | directory = case / ("zero-%d" % number) |
| 107 | directory.mkdir() |
| 108 | registry = context.registry(directory, image=digest(runner)) |
| 109 | process, destination = context.collect(directory, registry, runner=runner, extra=[option, "0"]) |
| 110 | no_marker(process, destination) |
| 111 | require(not marker.exists(), "invalid positive bounds reached runner") |
| 112 | directory = case / "native-output-bound" |
| 113 | directory.mkdir() |
| 114 | registry = context.registry(directory) |
| 115 | process, destination = context.collect(directory, registry, extra=["--max-output-bytes", "1"]) |
| 116 | no_marker(process, destination) |
| 117 | directory = case / "native-file-count-bound" |
| 118 | directory.mkdir() |
| 119 | registry = context.registry(directory) |
| 120 | process, destination = context.collect(directory, registry, extra=["--max-profile-files", "1"]) |
| 121 | no_marker(process, destination) |
| 122 | require(len(retained_profiles(destination)) >= 2, "profile bound was not reached after real native evidence") |
| 123 | return {"class": "administrative-bounds-with-native-file-control", "positive_options": options} |
| 124 | |
| 125 | |
| 126 | def converter_errors(context, case): |