All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] (no subject)
@ 2013-08-05 14:44 Stanislav Kholmanskikh
  2013-08-05 14:44 ` [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes Stanislav Kholmanskikh
  0 siblings, 1 reply; 20+ messages in thread
From: Stanislav Kholmanskikh @ 2013-08-05 14:44 UTC (permalink / raw)
  To: ltp-list; +Cc: vasily.isaenko


Hi!

This is a little fix to run quota_remount_test01.sh with SELinux enabled. 
Some distros (CentOS 6.x and, likely, RHEL 6) prevent from creation of quota 
files in 'file_t' directories, some - don't care. 
I tried this fix on CentOS 5.x/6.x and Oracle Linux, Debian 7. Seems, It's ok, and
should not break anything else.

And the test couldn't be invoked under 3.x kernels because of its kernel check. 
Changed it to use tst_kvercmp.

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes
  2013-08-05 14:44 [LTP] (no subject) Stanislav Kholmanskikh
@ 2013-08-05 14:44 ` Stanislav Kholmanskikh
  2013-08-05 15:45   ` chrubis
  2013-08-07 11:42   ` chrubis
  0 siblings, 2 replies; 20+ messages in thread
From: Stanislav Kholmanskikh @ 2013-08-05 14:44 UTC (permalink / raw)
  To: ltp-list; +Cc: vasily.isaenko

From: Stanislav kholmanskikh <stanislav.kholmanskikh@oracle.com>

* now it uses tst_kvercmp (to support kernels >= 3)
* some distros doesn't allow creation of quota files in
directories with SELinux file_t type. Now we explicitly
change file type of the test directory to tmp_t

Signed-off-by: Stanislav kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
 .../fs/quota_remount/quota_remount_test01.sh       |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/testcases/kernel/fs/quota_remount/quota_remount_test01.sh b/testcases/kernel/fs/quota_remount/quota_remount_test01.sh
index 98b15d6..7790d16 100755
--- a/testcases/kernel/fs/quota_remount/quota_remount_test01.sh
+++ b/testcases/kernel/fs/quota_remount/quota_remount_test01.sh
@@ -47,14 +47,8 @@ then
 fi
 MNTDIR=$TMPDIR/mnt
 
-uname -r | {
-	IFS='.-'
-	read MAJOR MINOR RELEASE REST
-	if [ "$MAJOR" -lt 2 -o "$MINOR" -lt 6 -o "$RELEASE" -lt 26 ]; then
-		exit 1
-	fi
-	exit 0; }
-if [ $? -gt 0 ]; then
+tst_kvercmp 2 6 26
+if [ $? -eq 0 ]; then
         tst_resm TCONF "Remounting with quotas enabled is not supported!"
         tst_resm TCONF "You should have kernel 2.6.26 and above running....."
         exit 0
@@ -83,6 +77,13 @@ mkdir $MNTDIR || die 2 "Could not create the mountpoint"
 mount -t ext3 -o loop,usrquota,grpquota $IMAGE $MNTDIR || die 2 "Could not mount the filesystem"
 tst_resm TINFO "Successfully mounted the File System"
 
+# some distros (CentOS 6.x, for example) doesn't permit creating
+# of quota files in a directory with SELinux file_t type
+if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
+	chcon -t tmp_t $MNTDIR || die 2 "Could not change SELinux file type"
+	tst_resm TINFO "Successfully changed SELinux file type"
+fi
+
 quotacheck -cug $MNTDIR || die 2 "Could not create quota files"
 tst_resm TINFO "Successfully Created Quota Files"
 
-- 
1.7.1


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes
  2013-08-05 14:44 ` [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes Stanislav Kholmanskikh
@ 2013-08-05 15:45   ` chrubis
  2013-08-07 11:42   ` chrubis
  1 sibling, 0 replies; 20+ messages in thread
From: chrubis @ 2013-08-05 15:45 UTC (permalink / raw)
  To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list

Hi!
> * now it uses tst_kvercmp (to support kernels >= 3)
> * some distros doesn't allow creation of quota files in
> directories with SELinux file_t type. Now we explicitly
> change file type of the test directory to tmp_t

I can't check that the selinux specific bits works as they should, but
general idea of this patch is fine.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes
  2013-08-05 14:44 ` [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes Stanislav Kholmanskikh
  2013-08-05 15:45   ` chrubis
@ 2013-08-07 11:42   ` chrubis
  1 sibling, 0 replies; 20+ messages in thread
From: chrubis @ 2013-08-07 11:42 UTC (permalink / raw)
  To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list

Hi!
> * now it uses tst_kvercmp (to support kernels >= 3)
> * some distros doesn't allow creation of quota files in
> directories with SELinux file_t type. Now we explicitly
> change file type of the test directory to tmp_t

Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* [LTP] (no subject)
  2024-04-19  7:07 [LTP] [PATCH v2] Add case about arch_prctl syscall lufei
  2024-04-21  7:15 ` [LTP] (no subject) lufei
@ 2024-04-28  7:44 ` lufei
  1 sibling, 0 replies; 20+ messages in thread
From: lufei @ 2024-04-28  7:44 UTC (permalink / raw)
  To: jstancek; +Cc: ltp

Thanks a lot.


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] (no subject)
       [not found] <tencent_048887541FB562D43FE2D104@qq.com>
@ 2024-04-28  7:16 ` =?gb18030?B?wrfssw==?=
  0 siblings, 0 replies; 20+ messages in thread
From: =?gb18030?B?wrfssw==?= @ 2024-04-28  7:16 UTC (permalink / raw)
  To: =?gb18030?B?Q3lyaWwgSHJ1Ymlz?=; +Cc: =?gb18030?B?bHRw?=

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 742 bytes --]

It¡¯s fault in my code. supported_archs just works fine.


Sorry.
 

 	----------Reply to Message----------
 	On Fri, Apr 26, 2024 6:30 PM Cyril Hrubis <chrubis@suse.cz&gt; wrote:
      		Hi!
&gt; I tried using NULL, but met `TBROK: Test killed by SIGSEGV!`.&amp;nbsp;

That means that the manual page is wrong and the address is not ignored.

&gt; And the last time you mentioned in response to using
&gt; `supported_archs`, this seems not work properly by now, the ltp
&gt; document(section of writing_tests) says "not applicable".

The supported_archs is supposed to work. How did you set it (the value)
and what happened?

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] (no subject)
  2024-04-26 12:27         ` 路斐
@ 2024-04-26 12:47           ` Jan Stancek
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Stancek @ 2024-04-26 12:47 UTC (permalink / raw)
  To: 路斐; +Cc: ltp

On Fri, Apr 26, 2024 at 2:27 PM 路斐 <lufei@uniontech.com> wrote:
>
> Hi, Cyril.
> Here is my case:
>
>
> ```
> [root@rocky arch_prctl]# gcc --version
> gcc (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2)
> Copyright (C) 2021 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.&nbsp; There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> [root@rocky arch_prctl]# uname -a
> Linux rocky 5.14.0-362.18.1.el9_3.0.1.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Feb 11 13:49:23 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
>
> [root@rocky arch_prctl]# cat arch_prctl01.c&nbsp;
> // SPDX-License-Identifier: GPL-2.0-or-later
> /*
> &nbsp;* Copyright (c) UnionTech Software Technology Co.,Ltd., 2024
> &nbsp;* Author: Lu Fei <lufei@uniontech.com&gt;
> &nbsp;*/
>
>
> /*\
> &nbsp;* [Description]
> &nbsp;*
> &nbsp;* Simple test on arch_prctl to set and get cpuid instruction of test thread.
> &nbsp;*/
>
>
> #include "tst_test.h"
> #include "lapi/syscalls.h"
> #include <stdlib.h&gt;
> #ifdef HAVE_ASM_PRCTL_H
> #include <asm/prctl.h&gt;
>
>
> static int arch_prctl_get(int code, unsigned long *addr)
> {
>         return tst_syscall(__NR_arch_prctl, code, *addr);
                                            ^^
you are de-refencing here, while kernel expects a pointer

> }
>
>
> static int arch_prctl_set(int code, unsigned long addr)
> {
>         return tst_syscall(__NR_arch_prctl, code, addr);
> }
>
>
> static void run(unsigned int index)
> {
>         unsigned long *addr = malloc(sizeof(long));
>
>
>         // index == 0 for disable cpuid, 1 for enable cpuid.
>         TST_EXP_PASS(arch_prctl_set(ARCH_SET_CPUID, index));
>
>
>         TEST(arch_prctl_get(ARCH_GET_CPUID, addr));
>
>
>         if (TST_RET == index)
>                 tst_res(TPASS, "get cpuid succeed.");
>         else
>                 tst_res(TFAIL, "get cpuid failed.");
> }
>
>
> static struct tst_test test = {
>         .test = run,
>         .tcnt = 2,
>         .min_kver = "4.12",
>         .supported_archs = {"x86_64", "x86", NULL},
> };
>
>
> #else /* HAVE_ASM_PRCTL_H */
> TST_TEST_TCONF("missing <asm/prctl.h&gt;");
> #endif
> [root@rocky arch_prctl]# make clean
> rm -f -f -r arch_prctl01&nbsp; *.o *.pyc .cache.mk *.dwo .*.dwo
> [root@rocky arch_prctl]# make check
> CHECK testcases/kernel/syscalls/arch_prctl/arch_prctl01.c
> arch_prctl01.c:48:10: warning: bogus scalar initializer
> [root@rocky arch_prctl]# make
> make -C "/root/Develop/ltp/lib" -f "/root/Develop/ltp/lib/Makefile" all
> make[1]: Entering directory '/root/Develop/ltp/lib'
> GEN ltp-version.h
> make[2]: Nothing to be done for 'all'.
> make[2]: Nothing to be done for 'all'.
> make[1]: Leaving directory '/root/Develop/ltp/lib'
> arch_prctl01.c:48:9: warning: braces around scalar initializer
> &nbsp; &nbsp;48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.supported_archs = {"x86_64", "x86", NULL},
> &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^
> arch_prctl01.c:48:9: note: (near initialization for ‘test.supported_archs’)
> arch_prctl01.c:48:29: warning: initialization of ‘const char * const*’ from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
> &nbsp; &nbsp;48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.supported_archs = {"x86_64", "x86", NULL},
> &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^~~~~~~~
> arch_prctl01.c:48:29: note: (near initialization for ‘test.supported_archs’)
> arch_prctl01.c:48:39: warning: excess elements in scalar initializer
> &nbsp; &nbsp;48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.supported_archs = {"x86_64", "x86", NULL},
> &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^~~~~
> arch_prctl01.c:48:39: note: (near initialization for ‘test.supported_archs’)
> arch_prctl01.c:48:46: warning: excess elements in scalar initializer
> &nbsp; &nbsp;48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.supported_archs = {"x86_64", "x86", NULL},
> &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~
> arch_prctl01.c:48:46: note: (near initialization for ‘test.supported_archs’)
> CC testcases/kernel/syscalls/arch_prctl/arch_prctl01
> ```
>
>
>
>
>
>
>
>  路斐 Fei.Lu
> Uniontech Technology
> site: www.uniontech.com
> tel: 18501012352
> addr: Xi'an China
>
>
>
>
>
> &nbsp;
> &nbsp;
> &nbsp;
> ------------------&nbsp;Original&nbsp;------------------
> From: &nbsp;"Cyril&nbsp;Hrubis"<chrubis@suse.cz&gt;;
> Date: &nbsp;Fri, Apr 26, 2024 06:30 PM
> To: &nbsp;"路斐"<lufei@uniontech.com&gt;;
> Cc: &nbsp;"ltp"<ltp@lists.linux.it&gt;;
> Subject: &nbsp;Re: Re:
>
> &nbsp;
>
> Hi!
> &gt; I tried using NULL, but met `TBROK: Test killed by SIGSEGV!`.&amp;nbsp;
>
> That means that the manual page is wrong and the address is not ignored.
>
> &gt; And the last time you mentioned in response to using
> &gt; `supported_archs`, this seems not work properly by now, the ltp
> &gt; document(section of writing_tests) says "not applicable".
>
> The supported_archs is supposed to work. How did you set it (the value)
> and what happened?
>
> --
> Cyril Hrubis
> chrubis@suse.cz
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] (no subject)
  2024-04-26 10:28       ` Cyril Hrubis
@ 2024-04-26 12:27         ` 路斐
  2024-04-26 12:47           ` Jan Stancek
  0 siblings, 1 reply; 20+ messages in thread
From: 路斐 @ 2024-04-26 12:27 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi, Cyril.
Here is my case:


```
[root@rocky arch_prctl]# gcc --version
gcc (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.&nbsp; There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@rocky arch_prctl]# uname -a
Linux rocky 5.14.0-362.18.1.el9_3.0.1.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Feb 11 13:49:23 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

[root@rocky arch_prctl]# cat arch_prctl01.c&nbsp;
// SPDX-License-Identifier: GPL-2.0-or-later
/*
&nbsp;* Copyright (c) UnionTech Software Technology Co.,Ltd., 2024
&nbsp;* Author: Lu Fei <lufei@uniontech.com&gt;
&nbsp;*/


/*\
&nbsp;* [Description]
&nbsp;*
&nbsp;* Simple test on arch_prctl to set and get cpuid instruction of test thread.
&nbsp;*/


#include "tst_test.h"
#include "lapi/syscalls.h"
#include <stdlib.h&gt;
#ifdef HAVE_ASM_PRCTL_H
#include <asm/prctl.h&gt;


static int arch_prctl_get(int code, unsigned long *addr)
{
	return tst_syscall(__NR_arch_prctl, code, *addr);
}


static int arch_prctl_set(int code, unsigned long addr)
{
	return tst_syscall(__NR_arch_prctl, code, addr);
}


static void run(unsigned int index)
{
	unsigned long *addr = malloc(sizeof(long));


	// index == 0 for disable cpuid, 1 for enable cpuid.
	TST_EXP_PASS(arch_prctl_set(ARCH_SET_CPUID, index));


	TEST(arch_prctl_get(ARCH_GET_CPUID, addr));


	if (TST_RET == index)
		tst_res(TPASS, "get cpuid succeed.");
	else
		tst_res(TFAIL, "get cpuid failed.");
}


static struct tst_test test = {
	.test = run,
	.tcnt = 2,
	.min_kver = "4.12",
	.supported_archs = {"x86_64", "x86", NULL},
};


#else /* HAVE_ASM_PRCTL_H */
TST_TEST_TCONF("missing <asm/prctl.h&gt;");
#endif
[root@rocky arch_prctl]# make clean
rm -f -f -r arch_prctl01&nbsp; *.o *.pyc .cache.mk *.dwo .*.dwo
[root@rocky arch_prctl]# make check
CHECK testcases/kernel/syscalls/arch_prctl/arch_prctl01.c
arch_prctl01.c:48:10: warning: bogus scalar initializer
[root@rocky arch_prctl]# make
make -C "/root/Develop/ltp/lib" -f "/root/Develop/ltp/lib/Makefile" all
make[1]: Entering directory '/root/Develop/ltp/lib'
GEN ltp-version.h
make[2]: Nothing to be done for 'all'.
make[2]: Nothing to be done for 'all'.
make[1]: Leaving directory '/root/Develop/ltp/lib'
arch_prctl01.c:48:9: warning: braces around scalar initializer
&nbsp; &nbsp;48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.supported_archs = {"x86_64", "x86", NULL},
&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^
arch_prctl01.c:48:9: note: (near initialization for ‘test.supported_archs’)
arch_prctl01.c:48:29: warning: initialization of ‘const char * const*’ from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
&nbsp; &nbsp;48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.supported_archs = {"x86_64", "x86", NULL},
&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^~~~~~~~
arch_prctl01.c:48:29: note: (near initialization for ‘test.supported_archs’)
arch_prctl01.c:48:39: warning: excess elements in scalar initializer
&nbsp; &nbsp;48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.supported_archs = {"x86_64", "x86", NULL},
&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^~~~~
arch_prctl01.c:48:39: note: (near initialization for ‘test.supported_archs’)
arch_prctl01.c:48:46: warning: excess elements in scalar initializer
&nbsp; &nbsp;48 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.supported_archs = {"x86_64", "x86", NULL},
&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~
arch_prctl01.c:48:46: note: (near initialization for ‘test.supported_archs’)
CC testcases/kernel/syscalls/arch_prctl/arch_prctl01
```







 路斐 Fei.Lu
Uniontech Technology
site: www.uniontech.com
tel: 18501012352
addr: Xi'an China



 

&nbsp;
&nbsp;
&nbsp;
------------------&nbsp;Original&nbsp;------------------
From: &nbsp;"Cyril&nbsp;Hrubis"<chrubis@suse.cz&gt;;
Date: &nbsp;Fri, Apr 26, 2024 06:30 PM
To: &nbsp;"路斐"<lufei@uniontech.com&gt;; 
Cc: &nbsp;"ltp"<ltp@lists.linux.it&gt;; 
Subject: &nbsp;Re: Re:

&nbsp;

Hi!
&gt; I tried using NULL, but met `TBROK: Test killed by SIGSEGV!`.&amp;nbsp;

That means that the manual page is wrong and the address is not ignored.

&gt; And the last time you mentioned in response to using
&gt; `supported_archs`, this seems not work properly by now, the ltp
&gt; document(section of writing_tests) says "not applicable".

The supported_archs is supposed to work. How did you set it (the value)
and what happened?

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] (no subject)
  2024-04-26  9:42     ` 路斐
@ 2024-04-26 10:28       ` Cyril Hrubis
  2024-04-26 12:27         ` 路斐
  0 siblings, 1 reply; 20+ messages in thread
From: Cyril Hrubis @ 2024-04-26 10:28 UTC (permalink / raw)
  To: 路斐; +Cc: ltp

Hi!
> I tried using NULL, but met `TBROK: Test killed by SIGSEGV!`.&nbsp;

That means that the manual page is wrong and the address is not ignored.

> And the last time you mentioned in response to using
> `supported_archs`, this seems not work properly by now, the ltp
> document(section of writing_tests) says "not applicable".

The supported_archs is supposed to work. How did you set it (the value)
and what happened?

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] (no subject)
  2024-04-26  8:36   ` Cyril Hrubis
@ 2024-04-26  9:42     ` 路斐
  2024-04-26 10:28       ` Cyril Hrubis
  0 siblings, 1 reply; 20+ messages in thread
From: 路斐 @ 2024-04-26  9:42 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

I tried using NULL, but met `TBROK: Test killed by SIGSEGV!`.&nbsp;


And the last time you mentioned in response to using `supported_archs`, this seems not work properly by now, the ltp document(section of writing_tests) says "not applicable".
&nbsp;






 路斐 Fei.Lu
平台测试部 高级测试开发工程师
统信软件
企业官网:www.uniontech.com
联系方式:18501012352
办公地址:西安市雁塔区云水一路与天谷八路口软件新城二期C2-20层



  

&nbsp;
&nbsp;
&nbsp;
------------------&nbsp;Original&nbsp;------------------
From: "Cyril&nbsp;Hrubis"; 
Date: 2024年4月26日(星期五) 上午8:37
To: "lufei"; 
Cc: "ltp"; 
Subject: Re:

&nbsp;
Hi!
&gt; Some of your point has been fixed. Some are not:
&gt; 1. I'm using gcc (GCC) 11.4.1 20230605, `addr` without initialization would output some warnings.
&gt; 2. I read the manpage of arch_prctl, the ARCH_GET_CPUID seems return the flag, instead of storing `addr`:
&gt; ```
&gt; ARCH_GET_CPUID (since Linux 4.12)
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return the setting of the flag manipulated by ARCH_SET_CPUID as the result of the system call (1&nbsp; for&nbsp; enabled,&nbsp; 0&nbsp; for
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; disabled).&nbsp; addr is ignored.
&gt; ```

Ah right, if addr is ignored just pass NULL there instead.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] (no subject)
  2024-04-21  7:15 ` [LTP] (no subject) lufei
@ 2024-04-26  8:36   ` Cyril Hrubis
  2024-04-26  9:42     ` 路斐
  0 siblings, 1 reply; 20+ messages in thread
From: Cyril Hrubis @ 2024-04-26  8:36 UTC (permalink / raw)
  To: lufei; +Cc: ltp

Hi!
> Some of your point has been fixed. Some are not:
> 1. I'm using gcc (GCC) 11.4.1 20230605, `addr` without initialization would output some warnings.
> 2. I read the manpage of arch_prctl, the ARCH_GET_CPUID seems return the flag, instead of storing `addr`:
> ```
> ARCH_GET_CPUID (since Linux 4.12)
>               Return the setting of the flag manipulated by ARCH_SET_CPUID as the result of the system call (1  for  enabled,  0  for
>               disabled).  addr is ignored.
> ```

Ah right, if addr is ignored just pass NULL there instead.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] (no subject)
  2024-04-19  7:07 [LTP] [PATCH v2] Add case about arch_prctl syscall lufei
@ 2024-04-21  7:15 ` lufei
  2024-04-26  8:36   ` Cyril Hrubis
  2024-04-28  7:44 ` lufei
  1 sibling, 1 reply; 20+ messages in thread
From: lufei @ 2024-04-21  7:15 UTC (permalink / raw)
  To: chrubis, ltp


Hi Cyril.
Thanks for you quickly response.

Some of your point has been fixed. Some are not:
1. I'm using gcc (GCC) 11.4.1 20230605, `addr` without initialization would output some warnings.
2. I read the manpage of arch_prctl, the ARCH_GET_CPUID seems return the flag, instead of storing `addr`:
```
ARCH_GET_CPUID (since Linux 4.12)
              Return the setting of the flag manipulated by ARCH_SET_CPUID as the result of the system call (1  for  enabled,  0  for
              disabled).  addr is ignored.
```
I'm not sure if this is a problem of my environment. 


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] (no subject)
@ 2021-11-15  8:15 Joerg Vehlow
  0 siblings, 0 replies; 20+ messages in thread
From: Joerg Vehlow @ 2021-11-15  8:15 UTC (permalink / raw)
  To: ltp, bogdan.lezhepekov

Subject: [PATCH 0/3] realtime/matrix_mult: Fix test execution

Hi,

this fixes the test execution of matrix_mult.
The workload function was optimized away, because the variables
used for calculations were unreachable outside of the function.

Joerg



-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] (no subject)
  2019-10-07  6:45 Joerg Vehlow
@ 2019-10-07  6:53 ` Joerg Vehlow
  0 siblings, 0 replies; 20+ messages in thread
From: Joerg Vehlow @ 2019-10-07  6:53 UTC (permalink / raw)
  To: ltp

> Added changes suggested by Cyril.
> BTW: The kernel is still tainted, even if the license is set, because
> of out-of-tree module:
>> ltp_lsmod01: loading out-of-tree module taints kernel.
Sorry, didn't meant to sent this...

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

* [LTP] (no subject)
@ 2019-10-07  6:45 Joerg Vehlow
  2019-10-07  6:53 ` Joerg Vehlow
  0 siblings, 1 reply; 20+ messages in thread
From: Joerg Vehlow @ 2019-10-07  6:45 UTC (permalink / raw)
  To: ltp

Added changes suggested by Cyril.
BTW: The kernel is still tainted, even if the license is set, because
of out-of-tree module:
> ltp_lsmod01: loading out-of-tree module taints kernel.



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

* [LTP] (no subject)
  2019-08-21  2:25 Jim Woo
@ 2019-08-22 12:45 ` Cyril Hrubis
  0 siblings, 0 replies; 20+ messages in thread
From: Cyril Hrubis @ 2019-08-22 12:45 UTC (permalink / raw)
  To: ltp

Hi!
> I want to ask if I can use ltp for stressing CPU and Memory with Linux OS?

What kind of stress do you have in mind?

I guess that for CPU stress something as compiling kernel in a loop with
large enough -j parameter will suffice.

There are some test for OOM and memory overcommit, these are part of the
mm runtest file.

> If the answer is yes, Can I get the detailed explanation about the hierachy
> of ltp because I think the document of ltp did not explain that.

Unforunately that part of LTP is undercommented, you have to mostly
explore on your own, sorry.

-- 
Cyril Hrubis
chrubis@suse.cz

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

* [LTP] (no subject)
@ 2019-08-21  2:25 Jim Woo
  2019-08-22 12:45 ` Cyril Hrubis
  0 siblings, 1 reply; 20+ messages in thread
From: Jim Woo @ 2019-08-21  2:25 UTC (permalink / raw)
  To: ltp

Hi, all:

I want to ask if I can use ltp for stressing CPU and Memory with Linux OS?
If the answer is yes, Can I get the detailed explanation about the hierachy
of ltp because I think the document of ltp did not explain that.

Thanks very much !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190821/97888cd9/attachment.htm>

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

* [LTP] (no subject)
  2014-03-07 11:39 [LTP] [PATCH 1/2] add tst_get_unused_port() Jan Stancek
@ 2014-03-10 14:22 ` Jan Stancek
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Stancek @ 2014-03-10 14:22 UTC (permalink / raw)
  To: ltp-list

From: Jan Stancek <jstancek@redhat.com>
Date: Fri, 7 Mar 2014 10:08:30 +0100
Subject: [PATCH v2 1/2] add tst_get_unused_port()

Returns unused port number for specified domain/type.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 include/test.h |    7 +++++
 lib/tst_net.c  |   80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+), 0 deletions(-)
 create mode 100644 lib/tst_net.c

Changes in v2:
- use sockaddr_storage as suggested by Mike

diff --git a/include/test.h b/include/test.h
index 81fca3e..49a0f47 100644
--- a/include/test.h
+++ b/include/test.h
@@ -288,6 +288,13 @@ int tst_fill_file(const char *path, char pattern, size_t bs, size_t bcount);
 uid_t tst_get_unused_uid(void);
 gid_t tst_get_unused_gid(void);
 
+/* lib/tst_net.c
+ *
+ * Return unused port
+ */
+unsigned short tst_get_unused_port(unsigned short family, int type,
+	void (cleanup_fn)(void));
+
 #ifdef TST_USE_COMPAT16_SYSCALL
 #define TCID_BIT_SUFFIX "_16"
 #elif  TST_USE_NEWER64_SYSCALL
diff --git a/lib/tst_net.c b/lib/tst_net.c
new file mode 100644
index 0000000..3391dee
--- /dev/null
+++ b/lib/tst_net.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2014 Linux Test Project, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it
+ * is free of the rightful claim of any third person regarding
+ * infringement or the like.  Any license provided herein, whether
+ * implied or otherwise, applies only to this software file.  Patent
+ * licenses, if any, provided herein do not apply to combinations of
+ * this program with other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation, Inc.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#include "test.h"
+
+unsigned short tst_get_unused_port(unsigned short family, int type,
+	void (cleanup_fn)(void))
+{
+	int sock;
+	socklen_t slen;
+	struct sockaddr_storage _addr;
+	struct sockaddr *addr = (struct sockaddr *)&_addr;
+	struct sockaddr_in *addr4 = (struct sockaddr_in *)addr;
+	struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr;
+
+	switch (family) {
+	case AF_INET:
+		addr4->sin_family = AF_INET;
+		addr4->sin_port = 0;
+		addr4->sin_addr.s_addr = INADDR_ANY;
+		slen = sizeof(*addr4);
+		break;
+
+	case AF_INET6:
+		addr6->sin6_family = AF_INET6;
+		addr6->sin6_port = 0;
+		addr6->sin6_addr = in6addr_any;
+		slen = sizeof(*addr6);
+		break;
+
+	default:
+		tst_brkm(TBROK, cleanup_fn,
+			"tst_get_unused_port unknown family");
+	}
+
+	sock = socket(addr->sa_family, type, 0);
+	if (sock < 0)
+		tst_brkm(TBROK | TERRNO, cleanup_fn, "socket failed");
+
+	if (bind(sock, addr, slen) < 0)
+		tst_brkm(TBROK | TERRNO, cleanup_fn, "bind failed");
+
+	if (getsockname(sock, addr, &slen) == -1)
+		tst_brkm(TBROK | TERRNO, cleanup_fn, "getsockname failed");
+
+	if (close(sock) == -1)
+		tst_brkm(TBROK | TERRNO, cleanup_fn, "close failed");
+
+	switch (family) {
+	case AF_INET:
+		return addr4->sin_port;
+	case AF_INET6:
+		return addr6->sin6_port;
+	default:
+		return -1;
+	}
+}
-- 
1.7.1


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* [LTP] (no subject)
@ 2009-07-01 20:08 Henry Yei
  0 siblings, 0 replies; 20+ messages in thread
From: Henry Yei @ 2009-07-01 20:08 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

It looks like the io_*.sh files are now not needed since the test source has been modified to check for an autoconf definition.
This patch modifies the syscalls runtest file to call those test directly. (io_cancel, io_destroy01, io_getevents01, 
io_setup01, io_submit01)

As the scripts are not needed any more, can we remove the following?

ltp/testcases/kernel/syscalls/io_cancel01.sh
ltp/testcases/kernel/syscalls/io_destroy01.sh
ltp/testcases/kernel/syscalls/io_getevents0101.sh
ltp/testcases/kernel/syscalls/io_setup01.sh
ltp/testcases/kernel/syscalls/io_submit01.sh

These scripts were not being copied into testcases/bin anyway and so AFAIK, did not run correctly by pan anyway.

Henry Yei
MontaVista Software, Inc.
hyei@mvista.com


 

[-- Attachment #2: syscalls-io.patch --]
[-- Type: application/octet-stream, Size: 496 bytes --]

--- community/ltp/runtest/syscalls	2009-07-01 12:52:08.137504800 -0700
+++ ltp/runtest/syscalls	2009-07-01 12:52:08.340627200 -0700
@@ -441,11 +441,11 @@
 iopl01 iopl01
 iopl02 iopl02
 
-io_cancel01 run-io_cancel.sh
-io_destroy01 run-io_destroy.sh
-io_getevents01 run-io_getevents.sh
-io_setup01 run-io_setup.sh
-io_submit01 run-io_submit.sh
+io_cancel01 io_cancel01
+io_destroy01 io_destroy01
+io_getevents01 io_getevents01
+io_setup01 io_setup01
+io_submit01 io_submit01
 
 keyctl01 keyctl01
 

[-- Attachment #3: Type: text/plain, Size: 79 bytes --]

------------------------------------------------------------------------------

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* [LTP] (no subject)
@ 2009-06-24 22:58 Henry Yei
  0 siblings, 0 replies; 20+ messages in thread
From: Henry Yei @ 2009-06-24 22:58 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

Submitting a patch for the splice01 test. Previously the test was checking if the current working directory was NFS based as which the test. The patch changes this test to check whether the test directory is on NFS, as that is actually where the test gets run. 

Henry Yei (QA)
MontaVista Software, Inc.
hyei@mvista.com


 

[-- Attachment #2: splice01.patch --]
[-- Type: application/octet-stream, Size: 549 bytes --]

--- ltp-full-20090531/testcases/kernel/syscalls/splice/splice01.c	2009-03-23 06:36:06.000000000 -0700
+++ ltp/testcases/kernel/syscalls/splice/splice01.c	2009-06-23 13:37:31.017333600 -0700
@@ -96,12 +96,14 @@
 	setup();
 
 	/*
-	 * check if the current filesystem is nfs
+	 * check if the current filesystem of the test directory is nfs
 	 */
+	tst_tmpdir();
 	if (tst_is_cwd_nfs()) {
 		tst_brkm(TCONF, cleanup,
 			 "Cannot do splice on a file located on an NFS filesystem");
 	}
+	tst_rmdir();
 
 	/*
 	 * check looping state if -c option given

[-- Attachment #3: Type: text/plain, Size: 79 bytes --]

------------------------------------------------------------------------------

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2024-04-28  7:45 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-05 14:44 [LTP] (no subject) Stanislav Kholmanskikh
2013-08-05 14:44 ` [LTP] [PATCH] quota_remount_test01: SELinux workaround and other fixes Stanislav Kholmanskikh
2013-08-05 15:45   ` chrubis
2013-08-07 11:42   ` chrubis
     [not found] <tencent_048887541FB562D43FE2D104@qq.com>
2024-04-28  7:16 ` [LTP] (no subject) =?gb18030?B?wrfssw==?=
  -- strict thread matches above, loose matches on Subject: below --
2024-04-19  7:07 [LTP] [PATCH v2] Add case about arch_prctl syscall lufei
2024-04-21  7:15 ` [LTP] (no subject) lufei
2024-04-26  8:36   ` Cyril Hrubis
2024-04-26  9:42     ` 路斐
2024-04-26 10:28       ` Cyril Hrubis
2024-04-26 12:27         ` 路斐
2024-04-26 12:47           ` Jan Stancek
2024-04-28  7:44 ` lufei
2021-11-15  8:15 Joerg Vehlow
2019-10-07  6:45 Joerg Vehlow
2019-10-07  6:53 ` Joerg Vehlow
2019-08-21  2:25 Jim Woo
2019-08-22 12:45 ` Cyril Hrubis
2014-03-07 11:39 [LTP] [PATCH 1/2] add tst_get_unused_port() Jan Stancek
2014-03-10 14:22 ` [LTP] (no subject) Jan Stancek
2009-07-01 20:08 Henry Yei
2009-06-24 22:58 Henry Yei

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.