Accept empty subordinate ID allocation files
This commit is contained in:
1 parent
e5a4dab5f3
commit
52027ecf81
2 files changed
+7
-1
No files matched your search
@@ -7,7 +7,7 @@ NF != 3 || $2 !~ /^[0-9]+$/ || $3 !~ /^[0-9]+$/ || $3 < 1 { invalid = 1; next }
|
|||||||
files[FILENAME] = 1
|
files[FILENAME] = 1
|
||||||
}
|
}
|
||||||
END {
|
END {
|
||||||
if (invalid || length(files) != 2) exit 2
|
if (invalid) exit 2
|
||||||
for (base = 100000; base + 65535 <= 4294901760; base += 65536) {
|
for (base = 100000; base + 65535 <= 4294901760; base += 65536) {
|
||||||
overlap = 0
|
overlap = 0
|
||||||
for (file in files)
|
for (file in files)
|
||||||
|
|||||||
@@ -40,6 +40,12 @@ printf 'codex:100000:65536\n' >"$fixture"
|
|||||||
printf 'codex:165000:1000\n' >"$fixture_g"
|
printf 'codex:165000:1000\n' >"$fixture_g"
|
||||||
range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g")
|
range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g")
|
||||||
[[ $range == 231072-296607 ]]
|
[[ $range == 231072-296607 ]]
|
||||||
|
: >"$fixture_g"
|
||||||
|
range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g")
|
||||||
|
[[ $range == 165536-231071 ]]
|
||||||
|
: >"$fixture"
|
||||||
|
range=$(awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g")
|
||||||
|
[[ $range == 100000-165535 ]]
|
||||||
printf 'broken\n' >"$fixture_g"
|
printf 'broken\n' >"$fixture_g"
|
||||||
if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then
|
if awk -f infra/runner/find-free-subid-range.awk "$fixture" "$fixture_g" >/dev/null 2>&1; then
|
||||||
echo 'Malformed subordinate ID allocation was accepted' >&2
|
echo 'Malformed subordinate ID allocation was accepted' >&2
|
||||||
|
|||||||
Reference in new issue
Block a user