Skip to content

Commit 0cb68c3

Browse files
mhiramatgregkh
authored andcommitted
bootconfig: Fix testcase to increase max node
[ Upstream commit b69245126a48e50882021180fa5d264dc7149ccc ] Since commit 6c40624930c5 ("bootconfig: Increase max nodes of bootconfig from 1024 to 8192 for DCC support") increased the max number of bootconfig node to 8192, the bootconfig testcase of the max number of nodes fails. To fix this issue, we can not simply increase the number in the test script because the test bootconfig file becomes too big (>32KB). To fix that, we can use a combination of three alphabets (26^3 = 17576). But with that, we can not express the 8193 (just one exceed from the limitation) because it also exceeds the max size of bootconfig. So, the first 26 nodes will just use one alphabet. With this fix, test-bootconfig.sh passes all tests. Link: https://lore.kernel.org/all/167888844790.791176.670805252426835131.stgit@devnote2/ Reported-by: Heinz Wiesinger <[email protected]> Link: https://lore.kernel.org/all/[email protected] Fixes: 6c40624930c5 ("bootconfig: Increase max nodes of bootconfig from 1024 to 8192 for DCC support") Signed-off-by: Masami Hiramatsu (Google) <[email protected]> Reviewed-by: Steven Rostedt (Google) <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 90874b7 commit 0cb68c3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/bootconfig/test-bootconfig.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,14 @@ xfail grep -i "error" $OUTFILE
8787

8888
echo "Max node number check"
8989

90-
echo -n > $TEMPCONF
91-
for i in `seq 1 1024` ; do
92-
echo "node$i" >> $TEMPCONF
93-
done
90+
awk '
91+
BEGIN {
92+
for (i = 0; i < 26; i += 1)
93+
printf("%c\n", 65 + i % 26)
94+
for (i = 26; i < 8192; i += 1)
95+
printf("%c%c%c\n", 65 + i % 26, 65 + (i / 26) % 26, 65 + (i / 26 / 26))
96+
}
97+
' > $TEMPCONF
9498
xpass $BOOTCONF -a $TEMPCONF $INITRD
9599

96100
echo "badnode" >> $TEMPCONF

0 commit comments

Comments
 (0)