All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: shuah <shuah@kernel.org>, Joe Perches <joe@perches.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Darren Hart <dvhart@infradead.org>,
	Christian Brauner <christian@brauner.io>,
	Tycho Andersen <tycho@tycho.ws>, Serge Hallyn <serge@hallyn.com>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 0/8] selftests: Move test output to diagnostic lines
Date: Thu, 25 Apr 2019 10:11:20 -0700	[thread overview]
Message-ID: <CAGXu5jLoOJydOOxmmiYYL2k_0K-MOD6j=gV8_4BUNhTTyWNsVQ@mail.gmail.com> (raw)
In-Reply-To: <CAGXu5jJChvx-_E8RMTi3ioUZGuQGViy6gcAMpmvYZzms=zc6dQ@mail.gmail.com>

On Thu, Apr 25, 2019 at 10:05 AM Kees Cook <keescook@chromium.org> wrote:
> WARNING: Misplaced SPDX-License-Identifier tag - use line 1 instead
> #37: FILE: tools/testing/selftests/kselftest/runner.sh:2:
>  # SPDX-License-Identifier: GPL-2.0
>
> This is a shell script. It can't be on line 1:
>
> $ head -n3 tools/testing/selftests/kselftest/runner.sh
> #!/bin/sh
> # SPDX-License-Identifier: GPL-2.0
> #
>
> That looks like a bug in checkpatch not resetting the expected line or
> something.

It doesn't like patch 3 and doesn't notice that diff offset starts at line 2:

diff --git a/tools/testing/selftests/kselftest/runner.sh
b/tools/testing/selftests/kselftest/runner.sh
index e1117d703887..f12b0a631273 100644
--- a/tools/testing/selftests/kselftest/runner.sh
+++ b/tools/testing/selftests/kselftest/runner.sh
@@ -2,17 +2,20 @@
 # SPDX-License-Identifier: GPL-2.0
 #
 # Runs a set of tests in a given subdirectory.
+export KSFT_TAP_LEVEL=1

Joe, looks like the problem is here:

                if ($realline == $checklicenseline) {
realline == 2, checklicenseline == 1
so this is skipped, including the "#!/" check to move checklicenseline to 2.
then:
                if ($realline != $checklicenseline &&
                    $rawline =~ /\bSPDX-License-Identifier:/ &&
realline == 2, checklicenseline == 1
throws warning.

Seems like checklicenseline should be unconditionally set to 2 for
".sh" files? I don't see a way to fix this for just missing the #!/
line from a context diff, though...

-- 
Kees Cook

WARNING: multiple messages have this Message-ID (diff)
From: keescook at chromium.org (Kees Cook)
Subject: [PATCH v2 0/8] selftests: Move test output to diagnostic lines
Date: Thu, 25 Apr 2019 10:11:20 -0700	[thread overview]
Message-ID: <CAGXu5jLoOJydOOxmmiYYL2k_0K-MOD6j=gV8_4BUNhTTyWNsVQ@mail.gmail.com> (raw)
In-Reply-To: <CAGXu5jJChvx-_E8RMTi3ioUZGuQGViy6gcAMpmvYZzms=zc6dQ@mail.gmail.com>

On Thu, Apr 25, 2019 at 10:05 AM Kees Cook <keescook at chromium.org> wrote:
> WARNING: Misplaced SPDX-License-Identifier tag - use line 1 instead
> #37: FILE: tools/testing/selftests/kselftest/runner.sh:2:
>  # SPDX-License-Identifier: GPL-2.0
>
> This is a shell script. It can't be on line 1:
>
> $ head -n3 tools/testing/selftests/kselftest/runner.sh
> #!/bin/sh
> # SPDX-License-Identifier: GPL-2.0
> #
>
> That looks like a bug in checkpatch not resetting the expected line or
> something.

It doesn't like patch 3 and doesn't notice that diff offset starts at line 2:

diff --git a/tools/testing/selftests/kselftest/runner.sh
b/tools/testing/selftests/kselftest/runner.sh
index e1117d703887..f12b0a631273 100644
--- a/tools/testing/selftests/kselftest/runner.sh
+++ b/tools/testing/selftests/kselftest/runner.sh
@@ -2,17 +2,20 @@
 # SPDX-License-Identifier: GPL-2.0
 #
 # Runs a set of tests in a given subdirectory.
+export KSFT_TAP_LEVEL=1

Joe, looks like the problem is here:

                if ($realline == $checklicenseline) {
realline == 2, checklicenseline == 1
so this is skipped, including the "#!/" check to move checklicenseline to 2.
then:
                if ($realline != $checklicenseline &&
                    $rawline =~ /\bSPDX-License-Identifier:/ &&
realline == 2, checklicenseline == 1
throws warning.

Seems like checklicenseline should be unconditionally set to 2 for
".sh" files? I don't see a way to fix this for just missing the #!/
line from a context diff, though...

-- 
Kees Cook

WARNING: multiple messages have this Message-ID (diff)
From: keescook@chromium.org (Kees Cook)
Subject: [PATCH v2 0/8] selftests: Move test output to diagnostic lines
Date: Thu, 25 Apr 2019 10:11:20 -0700	[thread overview]
Message-ID: <CAGXu5jLoOJydOOxmmiYYL2k_0K-MOD6j=gV8_4BUNhTTyWNsVQ@mail.gmail.com> (raw)
Message-ID: <20190425171120._2Vkzi9xAKnjFEgS4cfDokYcGTIo4g8e3k-hgXY-5H8@z> (raw)
In-Reply-To: <CAGXu5jJChvx-_E8RMTi3ioUZGuQGViy6gcAMpmvYZzms=zc6dQ@mail.gmail.com>

On Thu, Apr 25, 2019@10:05 AM Kees Cook <keescook@chromium.org> wrote:
> WARNING: Misplaced SPDX-License-Identifier tag - use line 1 instead
> #37: FILE: tools/testing/selftests/kselftest/runner.sh:2:
>  # SPDX-License-Identifier: GPL-2.0
>
> This is a shell script. It can't be on line 1:
>
> $ head -n3 tools/testing/selftests/kselftest/runner.sh
> #!/bin/sh
> # SPDX-License-Identifier: GPL-2.0
> #
>
> That looks like a bug in checkpatch not resetting the expected line or
> something.

It doesn't like patch 3 and doesn't notice that diff offset starts at line 2:

diff --git a/tools/testing/selftests/kselftest/runner.sh
b/tools/testing/selftests/kselftest/runner.sh
index e1117d703887..f12b0a631273 100644
--- a/tools/testing/selftests/kselftest/runner.sh
+++ b/tools/testing/selftests/kselftest/runner.sh
@@ -2,17 +2,20 @@
 # SPDX-License-Identifier: GPL-2.0
 #
 # Runs a set of tests in a given subdirectory.
+export KSFT_TAP_LEVEL=1

Joe, looks like the problem is here:

                if ($realline == $checklicenseline) {
realline == 2, checklicenseline == 1
so this is skipped, including the "#!/" check to move checklicenseline to 2.
then:
                if ($realline != $checklicenseline &&
                    $rawline =~ /\bSPDX-License-Identifier:/ &&
realline == 2, checklicenseline == 1
throws warning.

Seems like checklicenseline should be unconditionally set to 2 for
".sh" files? I don't see a way to fix this for just missing the #!/
line from a context diff, though...

-- 
Kees Cook

  reply	other threads:[~2019-04-25 17:11 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 23:12 [PATCH v2 0/8] selftests: Move test output to diagnostic lines Kees Cook
2019-04-24 23:12 ` Kees Cook
2019-04-24 23:12 ` keescook
2019-04-24 23:12 ` [PATCH v2 1/8] selftests: Extract single-test shell logic from lib.mk Kees Cook
2019-04-24 23:12   ` Kees Cook
2019-04-24 23:12   ` keescook
2019-04-24 23:12 ` [PATCH v2 2/8] selftests: Use runner.sh for emit targets Kees Cook
2019-04-24 23:12   ` Kees Cook
2019-04-24 23:12   ` keescook
2019-04-24 23:12 ` [PATCH v2 3/8] selftests: Extract logic for multiple test runs Kees Cook
2019-04-24 23:12   ` Kees Cook
2019-04-24 23:12   ` keescook
2019-04-24 23:12 ` [PATCH v2 4/8] selftests: Add plan line and fix result line syntax Kees Cook
2019-04-24 23:12   ` Kees Cook
2019-04-24 23:12   ` keescook
2019-04-24 23:12 ` [PATCH v2 5/8] selftests: Distinguish between missing and non-executable Kees Cook
2019-04-24 23:12   ` Kees Cook
2019-04-24 23:12   ` keescook
2019-04-24 23:12 ` [PATCH v2 6/8] selftests: Move test output to diagnostic lines Kees Cook
2019-04-24 23:12   ` Kees Cook
2019-04-24 23:12   ` keescook
2019-04-24 23:12 ` [PATCH v2 7/8] selftests: Remove KSFT_TAP_LEVEL Kees Cook
2019-04-24 23:12   ` Kees Cook
2019-04-24 23:12   ` keescook
2019-04-25 16:36   ` shuah
2019-04-25 16:36     ` shuah
2019-04-25 16:36     ` shuah
2019-04-25 16:56     ` Kees Cook
2019-04-25 16:56       ` Kees Cook
2019-04-25 16:56       ` keescook
2019-04-25 17:06       ` shuah
2019-04-25 17:06         ` shuah
2019-04-25 17:06         ` shuah
2019-04-24 23:12 ` [PATCH v2 8/8] selftests: Add test plan API to kselftest.h and adjust callers Kees Cook
2019-04-24 23:12   ` Kees Cook
2019-04-24 23:12   ` keescook
2019-04-25 16:52 ` [PATCH v2 0/8] selftests: Move test output to diagnostic lines shuah
2019-04-25 16:52   ` shuah
2019-04-25 16:52   ` shuah
2019-04-25 17:05   ` Kees Cook
2019-04-25 17:05     ` Kees Cook
2019-04-25 17:05     ` keescook
2019-04-25 17:11     ` Kees Cook [this message]
2019-04-25 17:11       ` Kees Cook
2019-04-25 17:11       ` keescook
2019-04-25 20:39     ` shuah
2019-04-25 20:39       ` shuah
2019-04-25 20:39       ` shuah
2019-04-25 21:19       ` Kees Cook
2019-04-25 21:19         ` Kees Cook
2019-04-25 21:19         ` keescook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGXu5jLoOJydOOxmmiYYL2k_0K-MOD6j=gV8_4BUNhTTyWNsVQ@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=christian@brauner.io \
    --cc=dvhart@infradead.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=serge@hallyn.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tycho@tycho.ws \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.