Message ID | 167871576880.783280.2390717518955954275.stgit@devnote2 (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | bootconfig: Fix testcase to increase max node | expand |
On Mon, 13 Mar 2023 22:56:09 +0900 "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote: > @@ -87,10 +88,16 @@ xfail grep -i "error" $OUTFILE > > echo "Max node number check" > > -echo -n > $TEMPCONF > -for i in `seq 1 1024` ; do > - echo "node$i" >> $TEMPCONF Do you need this extra file? > -done > +cat > $AWKFILE << EOF > +BEGIN { > + for (i = 0; i < 26; i += 1) > + printf("%c\n", 65 + i % 26) > + for (i = 26; i < 8192; i += 1) > + printf("%c%c%c\n", 65 + i % 26, 65 + (i / 26) % 26, 65 + (i / 26 / 26)) > +} > +EOF > +awk -f "$AWKFILE" > $TEMPCONF Couldn't the above just be: awk ' BEGIN { for (i = 0; i < 26; i += 1) printf("%c\n", 65 + i % 26) for (i = 26; i < 8192; i += 1) printf("%c%c%c\n", 65 + i % 26, 65 + (i / 26) % 26, 65 + (i / 26 / 26)) } ' > $TEMPCONF and not need the extra file? -- Steve > xpass $BOOTCONF -a $TEMPCONF $INITRD > > echo "badnode" >> $TEMPCONF
On Tue, 14 Mar 2023 11:12:13 -0400 Steven Rostedt <rostedt@goodmis.org> wrote: > On Mon, 13 Mar 2023 22:56:09 +0900 > "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote: > > > @@ -87,10 +88,16 @@ xfail grep -i "error" $OUTFILE > > > > echo "Max node number check" > > > > -echo -n > $TEMPCONF > > -for i in `seq 1 1024` ; do > > - echo "node$i" >> $TEMPCONF > > Do you need this extra file? > > > -done > > +cat > $AWKFILE << EOF > > +BEGIN { > > + for (i = 0; i < 26; i += 1) > > + printf("%c\n", 65 + i % 26) > > + for (i = 26; i < 8192; i += 1) > > + printf("%c%c%c\n", 65 + i % 26, 65 + (i / 26) % 26, 65 + (i / 26 / 26)) > > +} > > +EOF > > +awk -f "$AWKFILE" > $TEMPCONF > > Couldn't the above just be: > > awk ' > BEGIN { > for (i = 0; i < 26; i += 1) > printf("%c\n", 65 + i % 26) > for (i = 26; i < 8192; i += 1) > printf("%c%c%c\n", 65 + i % 26, 65 + (i / 26) % 26, 65 + (i / 26 / 26)) > } > ' > $TEMPCONF > > and not need the extra file? Indeed. Let me update this. Thank you! > > -- Steve > > > > xpass $BOOTCONF -a $TEMPCONF $INITRD > > > > echo "badnode" >> $TEMPCONF >
diff --git a/tools/bootconfig/test-bootconfig.sh b/tools/bootconfig/test-bootconfig.sh index f68e2e9eef8b..b1b77d76110d 100755 --- a/tools/bootconfig/test-bootconfig.sh +++ b/tools/bootconfig/test-bootconfig.sh @@ -14,10 +14,11 @@ ALIGN=4 INITRD=`mktemp ${TESTDIR}/initrd-XXXX` TEMPCONF=`mktemp ${TESTDIR}/temp-XXXX.bconf` OUTFILE=`mktemp ${TESTDIR}/tempout-XXXX` +AWKFILE=`mktemp ${TESTDIR}/temp-XXXX.awk` NG=0 cleanup() { - rm -f $INITRD $TEMPCONF $OUTFILE + rm -f $INITRD $TEMPCONF $OUTFILE $AWKFILE exit $NG } @@ -87,10 +88,16 @@ xfail grep -i "error" $OUTFILE echo "Max node number check" -echo -n > $TEMPCONF -for i in `seq 1 1024` ; do - echo "node$i" >> $TEMPCONF -done +cat > $AWKFILE << EOF +BEGIN { + for (i = 0; i < 26; i += 1) + printf("%c\n", 65 + i % 26) + for (i = 26; i < 8192; i += 1) + printf("%c%c%c\n", 65 + i % 26, 65 + (i / 26) % 26, 65 + (i / 26 / 26)) +} +EOF +awk -f "$AWKFILE" > $TEMPCONF + xpass $BOOTCONF -a $TEMPCONF $INITRD echo "badnode" >> $TEMPCONF