Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH] selftests: splice: Add splice_read.sh and hint
@ 2024-08-28  3:40 Rong Tao
  2024-08-30 12:37 ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Rong Tao @ 2024-08-28  3:40 UTC (permalink / raw)
  To: shuah; +Cc: rongtao, Rong Tao, open list, open list:KERNEL SELFTEST FRAMEWORK

From: Rong Tao <rongtao@cestc.cn>

Add test scripts and prompts.

Signed-off-by: Rong Tao <rongtao@cestc.cn>
---
 tools/testing/selftests/splice/splice_read.c  | 1 +
 tools/testing/selftests/splice/splice_read.sh | 9 +++++++++
 2 files changed, 10 insertions(+)
 create mode 100755 tools/testing/selftests/splice/splice_read.sh

diff --git a/tools/testing/selftests/splice/splice_read.c b/tools/testing/selftests/splice/splice_read.c
index 46dae6a25cfb..194b075f6bc0 100644
--- a/tools/testing/selftests/splice/splice_read.c
+++ b/tools/testing/selftests/splice/splice_read.c
@@ -49,6 +49,7 @@ int main(int argc, char *argv[])
 		      size, SPLICE_F_MOVE);
 	if (spliced < 0) {
 		perror("splice");
+		fprintf(stderr, "May try: %s /etc/os-release | cat\n", argv[0]);
 		return EXIT_FAILURE;
 	}
 
diff --git a/tools/testing/selftests/splice/splice_read.sh b/tools/testing/selftests/splice/splice_read.sh
new file mode 100755
index 000000000000..10fd5d738a2d
--- /dev/null
+++ b/tools/testing/selftests/splice/splice_read.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+set -e
+nl=$(./splice_read /etc/os-release | wc -l)
+
+test "$nl" != 0 && exit 0
+
+echo "splice_read broken"
+exit 1
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests: splice: Add splice_read.sh and hint
  2024-08-28  3:40 [PATCH] selftests: splice: Add splice_read.sh and hint Rong Tao
@ 2024-08-30 12:37 ` Shuah Khan
  2024-08-31  5:25   ` Rong Tao
  0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2024-08-30 12:37 UTC (permalink / raw)
  To: Rong Tao, shuah
  Cc: rongtao, open list, open list:KERNEL SELFTEST FRAMEWORK,
	Shuah Khan

On 8/27/24 21:40, Rong Tao wrote:
> From: Rong Tao <rongtao@cestc.cn>
> 
> Add test scripts and prompts.

Can you give more details on what these scripts and prompts do?

> 
> Signed-off-by: Rong Tao <rongtao@cestc.cn>
> ---
>   tools/testing/selftests/splice/splice_read.c  | 1 +
>   tools/testing/selftests/splice/splice_read.sh | 9 +++++++++
>   2 files changed, 10 insertions(+)
>   create mode 100755 tools/testing/selftests/splice/splice_read.sh
> 
> diff --git a/tools/testing/selftests/splice/splice_read.c b/tools/testing/selftests/splice/splice_read.c
> index 46dae6a25cfb..194b075f6bc0 100644
> --- a/tools/testing/selftests/splice/splice_read.c
> +++ b/tools/testing/selftests/splice/splice_read.c
> @@ -49,6 +49,7 @@ int main(int argc, char *argv[])
>   		      size, SPLICE_F_MOVE);
>   	if (spliced < 0) {
>   		perror("splice");
> +		fprintf(stderr, "May try: %s /etc/os-release | cat\n", argv[0]);

Is this supposed to be usage or help message?

>   		return EXIT_FAILURE;
>   	}
>   
> diff --git a/tools/testing/selftests/splice/splice_read.sh b/tools/testing/selftests/splice/splice_read.sh
> new file mode 100755
> index 000000000000..10fd5d738a2d
> --- /dev/null
> +++ b/tools/testing/selftests/splice/splice_read.sh
> @@ -0,0 +1,9 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0
> +set -e
> +nl=$(./splice_read /etc/os-release | wc -l)
> +
> +test "$nl" != 0 && exit 0
> +
> +echo "splice_read broken"
> +exit 1

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests: splice: Add splice_read.sh and hint
  2024-08-30 12:37 ` Shuah Khan
@ 2024-08-31  5:25   ` Rong Tao
  0 siblings, 0 replies; 3+ messages in thread
From: Rong Tao @ 2024-08-31  5:25 UTC (permalink / raw)
  To: Shuah Khan, shuah; +Cc: rongtao, open list, open list:KERNEL SELFTEST FRAMEWORK


On 8/30/24 8:37 PM, Shuah Khan wrote:
> On 8/27/24 21:40, Rong Tao wrote:
>> From: Rong Tao <rongtao@cestc.cn>
>>
>> Add test scripts and prompts.
>
> Can you give more details on what these scripts and prompts do?
>
I just push 
v2(https://lore.kernel.org/lkml/tencent_0AEA8FB622DE1A740841643D5F36ABF8BD0A@qq.com/)

At the first time, I just want to do the same thing that 
default_file_splice_read.sh did,

and splice_read.sh looks like useless, i just remove splice_read.sh in v2.

>>
>> Signed-off-by: Rong Tao <rongtao@cestc.cn>
>> ---
>>   tools/testing/selftests/splice/splice_read.c  | 1 +
>>   tools/testing/selftests/splice/splice_read.sh | 9 +++++++++
>>   2 files changed, 10 insertions(+)
>>   create mode 100755 tools/testing/selftests/splice/splice_read.sh
>>
>> diff --git a/tools/testing/selftests/splice/splice_read.c 
>> b/tools/testing/selftests/splice/splice_read.c
>> index 46dae6a25cfb..194b075f6bc0 100644
>> --- a/tools/testing/selftests/splice/splice_read.c
>> +++ b/tools/testing/selftests/splice/splice_read.c
>> @@ -49,6 +49,7 @@ int main(int argc, char *argv[])
>>                 size, SPLICE_F_MOVE);
>>       if (spliced < 0) {
>>           perror("splice");
>> +        fprintf(stderr, "May try: %s /etc/os-release | cat\n", 
>> argv[0]);
>
> Is this supposed to be usage or help message?

Yes, I just add usage() function to splice_read.c in 
v2(https://lore.kernel.org/lkml/tencent_0AEA8FB622DE1A740841643D5F36ABF8BD0A@qq.com/)

Please review, thanks.

>
>>           return EXIT_FAILURE;
>>       }
>>   diff --git a/tools/testing/selftests/splice/splice_read.sh 
>> b/tools/testing/selftests/splice/splice_read.sh
>> new file mode 100755
>> index 000000000000..10fd5d738a2d
>> --- /dev/null
>> +++ b/tools/testing/selftests/splice/splice_read.sh
>> @@ -0,0 +1,9 @@
>> +#!/bin/sh
>> +# SPDX-License-Identifier: GPL-2.0
>> +set -e
>> +nl=$(./splice_read /etc/os-release | wc -l)
>> +
>> +test "$nl" != 0 && exit 0
>> +
>> +echo "splice_read broken"
>> +exit 1
>
> thanks,
> -- Shuah

Thank you.

Rong Tao


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-31  5:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28  3:40 [PATCH] selftests: splice: Add splice_read.sh and hint Rong Tao
2024-08-30 12:37 ` Shuah Khan
2024-08-31  5:25   ` Rong Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox