Re: [LTP] [PATCH]the function name conflict with libc in LTP

2009-05-12 Thread Subrata Modak
On Tue, 2009-05-12 at 07:40 +0800, CAI Qian wrote: 
 From: Gui Xiaohua gu...@cn.fujitsu.com
 Subject: Re: [LTP] [PATCH]the function name conflict with libc in LTP
 Date: Mon, 11 May 2009 13:21:33 +0800
 
  The accept4 will available in glbic v2.10
  # man accept4
  ...
  The accept4() system call is available starting with Linux 2.6.28; support 
  in glibc is available starting with version 2.10.
  ...
  In v2.9, the function was be declared. So i do some changes like folw:
 
 Interesting, it was declared there. It looks like you might use a
 pre-released version?
 
 glibc-headers-2.9.90-8.1.x86_64
 
  Signed-off-by: Gui Xiaohua gu...@cn.fujitsu.com
  --- a/kernel/syscalls/accept4/accept4_01.c  2009-05-05 16:58:49.0 
  +0800
  +++ b/kernel/syscalls/accept4/accept4_01.c  2009-05-11 12:05:45.0 
  +0800
  @@ -141,9 +141,9 @@ void setup()
  TEST_PAUSE;
  tst_tmpdir();
   }
  -
  +#if !(__GLIBC_PREREQ(2,10))
 
 The cleaner approach is use autoconf to detect those situations outlined
 by Masatake YAMATO,
 
 The step to use autoconf in your test case:
 
 0. update ltp (via cvs or git); the install autoconf  2.61
 
 1. Added ltp-SYSTEMCALLNAME.m4 to m4 directory.
e.g. pseudo code(ltp-unshare.m4)
 
AC_DEFUN([LTP_CHECK_SYSCALL_UNSHARE],[
AC_CHECK_FUNCS(unshare)
])
 
 2. Added the macro name to configure.ac like
 
m4_include([m4/ltp-unshare.m4])
LTP_CHECK_SYSCALL_UNSHARE
 
 3. make autoconf
 
 4. modify your test case.
 4.1 include config.h (see signalfd01.c)
 4.2
 
 #if defined HAVE_UNSHARED
 ...code for  test case...
 #else
 ...stub reports this environment doesn't support unshare syscall...
 #endif
 
 5. ./configure
 
 6. cd lib;make;cd ..
 7  cd testcases/kernel/syscall/unshare; make
 
 8. Read include config.h and search HAVE_UNSHARED
You can see the result of configure.
if HAVE_UNSHARED is defined your platform may have the systemcall.
 

Gui,

Please see if you can introduce a m4 rule file for this test.

 Also, we can then remove the kernel part of the checking here,
 
 int
 main(int argc, char *argv[])
 {
#if defined(__NR_accept4) || defined(__NR_socketcall)
 
   static int
  -accept4(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
  +accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int 
  flags)
   {
   #ifdef DEBUG
  tst_resm(TINFO, Calling accept4(): flags = %x, flags);
  @@ -173,6 +173,7 @@ accept4(int fd, struct sockaddr *sockadd
  return syscall(__NR_accept4, fd, sockaddr, addrlen, flags);
   #endif
   }
  +#endif
   
   /**/
   
  @@ -197,8 +198,13 @@ do_test(int lfd, struct sockaddr_in *con
  die(Connect Error);
   
  addrlen = sizeof(struct sockaddr_in);
  +   #if !(__GLIBC_PREREQ(2,10))
  +   acceptfd = accept4_01(lfd, (struct sockaddr *)claddr, addrlen,
  +   closeonexec_flag | nonblock_flag);
  +   #else
  acceptfd = accept4(lfd, (struct sockaddr *)claddr, addrlen,
 closeonexec_flag | nonblock_flag);
  +   #endif
  if (acceptfd == -1) {
  tst_resm(TCONF,
   syscall __NR_accept4 not supported on your arch);
  
 
 I don't have a system to test this right now, but it looks OK for me,
 
 Acked-by: CAI Qian caiq...@cclom.cn

Thanks.

Regards--
Subrata

 
  CAI Qian wrote:
  
  From: Gui Xiaohua gu...@cn.fujitsu.com
  Subject: [LTP] [PATCH]the function name conflict with libc in LTP
  To: ltp-list@lists.sourceforge.net
  Date: Wednesday, May 6, 2009, 1:16 PM
  There is an error occured during i
  compiled ltp which was 
  released in 20090430:
accept4_01.c:146: error: static declaration of
  ‘accept4’ 
follows non-static declaration
  /usr/include/sys/socket.h:222: 
note: previous declaration of ‘accept4’ was
  here.
  Note:
The OS is Fedora11Beta, the glibc version is 
glibc-headers-2.9.90-8.1.x86_64.
 
  
  
  Well, if glibc has already provided accept4(), we can use it unless it is
  really necessary to use syscall(). In the future, we probably don't want 
  to maintain a separate version of accept4() here. Is it possible to check
  if the glibc version is available? If so, use the glibc one. Otherwise,
  use the static one here?
  
  CAI Qian
  
  
  
 --
 The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
 production scanning environment may not be a perfect world - but thanks to
 Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
 Series Scanner you'll get full speed at 300 dpi even with all image 
 processing features enabled. http://p.sf.net/sfu/kodak-com
 ___
 Ltp-list mailing list
 Ltp-list@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ltp-list



Re: [LTP] [PATCH] Update the ltp selinux testsuite README

2009-05-12 Thread Subrata Modak
On Mon, 2009-05-11 at 09:06 -0400, Stephen Smalley wrote: 
 On Mon, 2009-05-11 at 14:47 +0530, Subrata Modak wrote:
  Thanks. With this, i think all the patches sent by you has been merged.
  Please let me know if i had missed something.
 
 Yes, looks correct.  Thanks.  A further patch is below to address a
 comment from Serge.
 
 Update the ltp selinux testsuite README to note the requirement for the
 libselinux headers and static library, and provide URLs from which to
 obtain the SELinux core userland and reference policy if the base
 distribution does not already include them.
 
 Signed-off-by:  Stephen Smalley s...@tycho.nsa.gov

Thanks.

Regards--
Subrata

 
 ---
 
  testcases/kernel/security/selinux-testsuite/README |   16 +++-
  1 file changed, 15 insertions(+), 1 deletion(-)
 
 Index: testcases/kernel/security/selinux-testsuite/README
 ===
 RCS file: 
 /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/README,v
 retrieving revision 1.7
 diff -u -r1.7 README
 --- testcases/kernel/security/selinux-testsuite/README11 May 2009 
 09:04:23 -  1.7
 +++ testcases/kernel/security/selinux-testsuite/README11 May 2009 
 12:45:57 -
 @@ -169,11 +169,17 @@
  SELinux, using either the old example policy or the reference policy
  as the baseline.  It also requires the core SELinux userland packages
  (libsepol, checkpolicy, libselinux, policycoreutils, and if using
 -reference policy, libsemanage) to be installed.  The test scripts also
 +modular policy, libsemanage) to be installed.  The test scripts also
  rely upon the SELinux extensions being integrated into the coreutils
  package, with support for the chcon and runcon commands as well as the
  SELinux options to existing utilities such as ls and mkdir.
 
 +In addition to the libselinux shared library, the libselinux headers
 +and the libselinux static library are required in order to build
 +certain testcases.  These can be found in the libselinux-devel and
 +libselinux-static packages respectively in modern Fedora releases, or
 +in the libselinux-devel package in RHEL 5.
 +
  On systems whose policy was derived from the old example policy
  (e.g. RHEL 4), the base policy sources must be installed on the
  system, e.g. the selinux-policy-targeted-sources package in RHEL 4.
 @@ -188,3 +194,11 @@
  will look in $POLICYDEVEL as defined in
  selinux-testsuite/refpolicy/Makefile for the policy module development
  files.
 +
 +If the base distribution does not include the SELinux userland, then
 +the source code for the core SELinux userland packages can be obtained from:
 +http://userspace.selinuxproject.org
 +
 +If the base distribution does not include a policy configuration, then
 +the reference policy can be obtained from:
 +http://oss.tresys.com/projects/refpolicy
 


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH v2 0/7] can: CAN network device driver interface and drivers

2009-05-12 Thread Subrata Modak
Hi Oliver/Wolfgang,

 Hello,
 
 here comes v2 of the patch series posted some time ago. See
 
  http://marc.info/?l=linux-netdevm=123507025810612w=4.
 
 Changes since v1:
 
 - The SysFS interface has been replaced by the Netlink interface as
  suggested by Patrick. For further information have a look to
  chapter 6.5 of Documentation/networking/can.txt and the header
  file include/linux/can/netdev.h. The patch for the ip program of
  the iproute2 utility suite will be provided separately.
 
 - The restart function is now properly protected by dev-tx_lock
  using the netif_tx_[lock|unlock] functions.
 
 - For the  restart, the device driver must now handle CAN_MODE_STOP as
  well, apart from CAN_MODE_START to avoid race conditions.
 
 - The irq_lock member of struct can_priv has been removed. The CAN
  controller driver may should provide its own synchronization if
  necessary.
 
 - The restart function is now protected by dev-tx_lock using the
  netif_tx_lock/unlock functions.
 
 - Cleanup timer usage for the restart function.
 
 - The unused do_set/get_ctrlmode member of struct can_priv have been
  removed.
 
 - const has been added to struct net_device for some functions not
  allowed to touch that structure.
 
 - The library functions can_set_bittiming and can_close_cleanup have
  been renamed to the more general names open_candev and
  close_candev, respectively.
 
 - Use del_timer_sync instead of del_timer for the  re-start timer.
 
 - The macro ND2D() has been replaced by dev-dev.parent as it does
  not make the code more readable.
 
 - Fix improper BTR setting for triple-sampling for the SJA1000 as
  pointed out by Oliver.
 
 - Dont use __u8 but __u32 as before for some members of struct
  can_bittiming[_const] to avoid alignment trouble.
 
 - Definitions shared with user-space applications have been moved to
  include/linux/can/netlink.h.
 
 - Various other minor correction suggested on the netdev ML.
 
 - The MSCAN driver for the MPC5200 has been removed. It needs to be
  presented on the Linuxppc-dev and Devicetree-discuss ML as well,
  which will be done by a sub-sequent patch.
 
 - Add more source code documentation, especially for the structures
  and functions related to bit-timing.
 
 The PF_CAN protocol family for the Controller Area Network is available
 in the kernel since version 2.6.25 but drivers for real CAN devices are
 still missing. This patch series adds a generic CAN network device
 driver interface and, as a start, a few drivers. It is the result of the
 on-going discussion and development of the Socket-CAN project hosted at
 the BerliOS web-server (http://developer.berlios.de/projects/socketcan).
 The patch series consists of the following patches:
 
  1/8) can: Documentation for the CAN device driver interface
  2/8) can: Update MAINTAINERS and CREDITS file
  3/8) can: CAN Network device driver and Netlink interface
  4/8) can: Driver for the SJA1000 CAN controller
  5/8) can: SJA1000 generic platform bus driver
  6/8) can: SJA1000 driver for EMS PCI cards
  7/8) can: SJA1000 driver for Kvaser PCI cards

Would you also like to send a patch to update the testcases for CAN in LTP
(http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/network/can/filter-tests/)
 ?
These tests were originally picked up from:
http://svn.berlios.de/wsvn/socketcan/trunk/test/?rev=877amp;sc=1

Regards--
Subrata

 
 Please consider these patches for inclusion.
 
 Thanks,
 
 Wolfgang.
 
 

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


[LTP] Fwd: umount02 and umount03 issue.

2009-05-12 Thread rohit verma
Hi,

Please find attached the patch for umount02 and umount03 issue.


Regards,
rohit


-- Forwarded message --
From: CAI Qian caiq...@cclom.cn
Date: Tue, May 12, 2009 at 1:15 AM
Subject: Re: [LTP] umount02 and umount03 issue.
To: rohit.170...@gmail.com


From: rohit verma rohit.170...@gmail.com
Subject: Re: [LTP] umount02 and umount03 issue.
Date: Tue, 12 May 2009 12:32:09 +0530

 Hi,

 Attached is the patch that consists old modifications and those
 suggested by you.. Hope the indentations are right this time.

 Verify the same... And, let me know about it...

 Regards,
 rohit

It works well. Please submit it with my ACK to the mailing list for
inclusion.

Acked-by: CAI Qian caiq...@cclom.cn

Thanks,
CAI Qian
diff -ruxB ltp-full-20090331_orig/testcases/kernel/syscalls/umount/umount02.c 
ltp-full-20090331/testcases/kernel/syscalls/umount/umount02.c
--- ltp-full-20090331_orig/testcases/kernel/syscalls/umount/umount02.c  
2009-03-23 19:06:13.0 +0530
+++ ltp-full-20090331/testcases/kernel/syscalls/umount/umount02.c   
2009-05-12 12:04:22.0 +0530
@@ -171,9 +171,9 @@
if (Tflag == 1) {
strncpy(Type, fstype,
(FSTYPE_LEN 
-strlen(fstype)) ? FSTYPE_LEN : strlen(fstype));
+(strlen(fstype)+1)) ? FSTYPE_LEN : (strlen(fstype)+1));
} else {
-   strncpy(Type, DEFAULT_FSTYPE, strlen(DEFAULT_FSTYPE));
+   strncpy(Type, DEFAULT_FSTYPE, strlen(DEFAULT_FSTYPE)+1);
}
 
if (STD_COPIES != 1) {
@@ -252,12 +252,17 @@
switch (i) {
case 0:
/* Setup for umount(2) returning errno EBUSY. */
+   if(access(Device,F_OK)) {
+   tst_brkm(TBROK, cleanup,
+   Device %s does not exist, Device);
+   return 1;
+   }
 
TEST(mount(Device, Mntpoint, Fstype, Flag, NULL));
 
if (TEST_RETURN == -1) {
tst_brkm(TBROK, cleanup, mount(2) failed to mount 
-device %s at mountpoint %s, Got errno - %s :
+device %s at mountpoint %s, Got errno - %d :
  %s, Device, Mntpoint, TEST_ERRNO,
 strerror(TEST_ERRNO));
return 1;
diff -ruxB ltp-full-20090331_orig/testcases/kernel/syscalls/umount/umount03.c 
ltp-full-20090331/testcases/kernel/syscalls/umount/umount03.c
--- ltp-full-20090331_orig/testcases/kernel/syscalls/umount/umount03.c  
2009-03-23 19:06:13.0 +0530
+++ ltp-full-20090331/testcases/kernel/syscalls/umount/umount03.c   
2009-05-12 12:11:50.0 +0530
@@ -149,9 +149,9 @@
if (Tflag == 1) {
strncpy(Type, fstype,
(FSTYPE_LEN 
-strlen(fstype)) ? FSTYPE_LEN : strlen(fstype));
+(strlen(fstype)+1)) ? FSTYPE_LEN : (strlen(fstype)+1));
} else {
-   strncpy(Type, DEFAULT_FSTYPE, strlen(DEFAULT_FSTYPE));
+   strncpy(Type, DEFAULT_FSTYPE, strlen(DEFAULT_FSTYPE)+1);
}
 
if (STD_COPIES != 1) {
@@ -273,6 +273,11 @@
/* set up expected error numbers */
TEST_EXP_ENOS(exp_enos);
 
+   if(access(device,F_OK)) {
+   tst_brkm(TBROK, cleanup1,
+   Device '%s' does not exist, device);
+   }
+
TEST(mount(device, mntpoint, Type, 0, NULL));
 
if (TEST_RETURN != 0) {
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH v2 0/7] can: CAN network device driver interface and drivers

2009-05-12 Thread Wolfgang Grandegger
Subrata Modak wrote:
 Hi Oliver/Wolfgang,
 
 Hello,

 here comes v2 of the patch series posted some time ago. See

  http://marc.info/?l=linux-netdevm=123507025810612w=4.

 Changes since v1:
[...]
 Would you also like to send a patch to update the testcases for CAN in LTP
 (http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/network/can/filter-tests/)
  ?
 These tests were originally picked up from:
 http://svn.berlios.de/wsvn/socketcan/trunk/test/?rev=877amp;sc=1

The existing tests uses the vcan (virtual CAN) driver, which is not
affected by these patches. Are you thinking about tests using *real* CAN
devices?

Wolfgang.

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Update the ltp selinux testsuite README

2009-05-12 Thread Serge E. Hallyn
Quoting Subrata Modak (subr...@linux.vnet.ibm.com):
 On Mon, 2009-05-11 at 09:06 -0400, Stephen Smalley wrote: 
  On Mon, 2009-05-11 at 14:47 +0530, Subrata Modak wrote:
   Thanks. With this, i think all the patches sent by you has been merged.
   Please let me know if i had missed something.
  
  Yes, looks correct.  Thanks.  A further patch is below to address a
  comment from Serge.
  
  Update the ltp selinux testsuite README to note the requirement for the
  libselinux headers and static library, and provide URLs from which to
  obtain the SELinux core userland and reference policy if the base
  distribution does not already include them.
  
  Signed-off-by:  Stephen Smalley s...@tycho.nsa.gov
 
 Thanks.
 
 Regards--
 Subrata

Thanks, Stephen.  I intend to test on rhel4/5 in the next few days.

-serge

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Update the ltp selinux testsuite README

2009-05-12 Thread Serge E. Hallyn
Quoting Stephen Smalley (s...@tycho.nsa.gov):
 On Tue, 2009-05-12 at 07:04 -0500, Serge E. Hallyn wrote:
  Quoting Subrata Modak (subr...@linux.vnet.ibm.com):
   On Mon, 2009-05-11 at 09:06 -0400, Stephen Smalley wrote: 
On Mon, 2009-05-11 at 14:47 +0530, Subrata Modak wrote:
 Thanks. With this, i think all the patches sent by you has been 
 merged.
 Please let me know if i had missed something.

Yes, looks correct.  Thanks.  A further patch is below to address a
comment from Serge.

Update the ltp selinux testsuite README to note the requirement for the
libselinux headers and static library, and provide URLs from which to
obtain the SELinux core userland and reference policy if the base
distribution does not already include them.

Signed-off-by:  Stephen Smalley s...@tycho.nsa.gov
   
   Thanks.
   
   Regards--
   Subrata
  
  Thanks, Stephen.  I intend to test on rhel4/5 in the next few days.
 
 Ok.  Just to be clear:
 RHEL4 systems use the test policy under policy/.
 RHEL5 systems use the test policy under refpolicy/redhat/5/.
 
 test_selinux.sh will select the policy/ or refpolicy/ subdirectory
 automatically, and then the top-level refpolicy Makefile will descend to
 refpolicy/redhat/5 when running on rhel5.
 
 The type bounds testcase (SELinux39) will fail on RHEL5 and RHEL4 due to
 lack of kernel support.
 
 The dyntrace/dyntrans test cases (SELinux37, SELinux38) will fail on
 RHEL4 due to lack of kernel support.

Ah but the tests/Makefile does not install those tests by default on
those systems, so I actually get no failures (on rhel4.8 at least, have
yet to test rhel5).

thanks,
-serge

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Update the ltp selinux testsuite README

2009-05-12 Thread Serge E. Hallyn
Quoting Stephen Smalley (s...@tycho.nsa.gov):
 On Tue, 2009-05-12 at 07:04 -0500, Serge E. Hallyn wrote:
  Quoting Subrata Modak (subr...@linux.vnet.ibm.com):
   On Mon, 2009-05-11 at 09:06 -0400, Stephen Smalley wrote: 
On Mon, 2009-05-11 at 14:47 +0530, Subrata Modak wrote:
 Thanks. With this, i think all the patches sent by you has been 
 merged.
 Please let me know if i had missed something.

Yes, looks correct.  Thanks.  A further patch is below to address a
comment from Serge.

Update the ltp selinux testsuite README to note the requirement for the
libselinux headers and static library, and provide URLs from which to
obtain the SELinux core userland and reference policy if the base
distribution does not already include them.

Signed-off-by:  Stephen Smalley s...@tycho.nsa.gov
   
   Thanks.
   
   Regards--
   Subrata
  
  Thanks, Stephen.  I intend to test on rhel4/5 in the next few days.
 
 Ok.  Just to be clear:
 RHEL4 systems use the test policy under policy/.
 RHEL5 systems use the test policy under refpolicy/redhat/5/.
 
 test_selinux.sh will select the policy/ or refpolicy/ subdirectory
 automatically, and then the top-level refpolicy Makefile will descend to
 refpolicy/redhat/5 when running on rhel5.
 
 The type bounds testcase (SELinux39) will fail on RHEL5 and RHEL4 due to
 lack of kernel support.
 
 The dyntrace/dyntrans test cases (SELinux37, SELinux38) will fail on
 RHEL4 due to lack of kernel support.

RHEL5 passes 100% as well.

thanks,
-serge

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


[LTP] [PATCH] Fix the splice02 test

2009-05-12 Thread Jiri Palecek
  Particularly:

   - TEST_ERRNO is only set when the syscall is executed using the
 TEST() macro. The tests gave bad error messages because of that.

   - The end of the test was dead code; moved the TPASS code to pass at
 the end of file.

   - The test assumes std. input is a pipe; reflect this in the runtest
 file

Regards
 Jiri Palecek

Signed-off-by: Jiri Palecek jpale...@web.de
---
  runtest/syscalls|2 +-
  testcases/kernel/syscalls/splice/splice02.c |   16 ++--
  2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/runtest/syscalls b/runtest/syscalls
index 9b7b2ca..33beff0 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -1033,7 +1033,7 @@ sockioctl01 sockioctl01
   #splice test
  splice01 splice01
-splice02 echo Test splice02()  splice02-temp; splice02 splice02-temp
+splice02 seq 1 1000 | splice02 splice02-temp
   tee01 tee01
  diff --git a/testcases/kernel/syscalls/splice/splice02.c 
b/testcases/kernel/syscalls/splice/splice02.c
index 321d002..16bff86 100644
--- a/testcases/kernel/syscalls/splice/splice02.c
+++ b/testcases/kernel/syscalls/splice/splice02.c
@@ -108,7 +108,6 @@ void setup() {
   int main(int ac, char **av) {
int fd = 0;
-   int ret = 0;

  setup();
  @@ -118,26 +117,23 @@ int main(int ac, char **av) {
}
fd=open(av[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
if(fd  0 ) {
-   tst_resm(TFAIL, %s failed - errno = %d : %s, TCID, TEST_ERRNO, 
strerror(TEST_ERRNO));
+   tst_resm(TFAIL, open(%s) failed - errno = %d : %s, av[1], 
errno, 
strerror(errno));
   cleanup();
   tst_exit();
}

  do {
-   ret = splice(STDIN_FILENO, NULL, fd, NULL, SPLICE_SIZE, 0);
-   if (ret  0) {
-   tst_resm(TFAIL, %s failed - errno = %d : %s,TCID, TEST_ERRNO, 
strerror(TEST_ERRNO));
+   TEST(splice(STDIN_FILENO, NULL, fd, 
NULL, SPLICE_SIZE, 0));
+   if (TEST_RETURN  0) {
+   tst_resm(TFAIL, splice failed - errno = %d : %s, TEST_ERRNO, 
strerror(TEST_ERRNO));
cleanup();
tst_exit();
} else
-if (ret  SPLICE_SIZE){
+if (TEST_RETURN == 0){
+   tst_resm(TPASS, 
splice() system call Passed);
cleanup();
tst_exit();
}
} while(1);
-
-   close(fd);
-tst_resm(TPASS, splice() system call Passed);
-tst_exit();
  }
  -- 1.6.2


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


[LTP] [PATCH] Add an autoconf test for presence of taskstats.freepages_count

2009-05-12 Thread Jiri Palecek
  Also, use it in getdelays.c to prevent compilation failures

Hello,

I've found that ltp didn't compile on Debian because of old kernel headers, 
which contain taskstats struct without some of the needed fields. This autoconf 
test detects it and disables the code that would otherwise break.

Regards
 Jiri Palecek

Signed-off-by: Jiri Palecek jpale...@web.de
---
  configure.ac|1 +
  include/config.h.default|2 +
  m4/ltp-taskstats.m4 |   38 +++
  testcases/kernel/controllers/cgroup/getdelays.c |   15 ++---
  4 files changed, 51 insertions(+), 5 deletions(-)
  create mode 100644 m4/ltp-taskstats.m4

diff --git a/configure.ac b/configure.ac
index c534c97..9fc1696 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,5 +20,6 @@ LTP_CHECK_SYSCALL_MODIFY_LDT
  LTP_CHECK_SYSCALL_SIGNALFD
  LTP_CHECK_SELINUX
  LTP_CHECK_CRYPTO
+LTP_CHECK_TASKSTATS
   AC_OUTPUT
diff --git a/include/config.h.default b/include/config.h.default
index 9125d85..b9a6731 100644
--- a/include/config.h.default
+++ b/include/config.h.default
@@ -14,3 +14,5 @@
   /* ifaddrs.h is in glibc-2.3+ */
  #define HAVE_IFADDRS_H 1
+
+#define HAVE_TASKSTATS_FREEPAGES_COUNT 1
diff --git a/m4/ltp-taskstats.m4 b/m4/ltp-taskstats.m4
new file mode 100644
index 000..54da783
--- /dev/null
+++ b/m4/ltp-taskstats.m4
@@ -0,0 +1,38 @@
+dnl
+dnl Copyright (c) Jiri Palecek 2009
+dnl
+dnl This program is free software;  you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+dnl the GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program;  if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl
+
+
+AC_DEFUN([LTP_CHECK_TASKSTATS],
+_LTP_CHECK_TASKSTATS_FREEPAGES
+)dnl
+
+dnl _LTP_CHECK_TASKSTATS_FREEPAGES
+dnl 
+dnl
+dnl Check for taskstat.freepages_* members, introduced to the kernel
+dnl in commit 016ae219 in July 2008
+dnl
+
+AC_DEFUN([_LTP_CHECK_TASKSTATS_FREEPAGES],
+[dnl
+AC_CHECK_MEMBERS([struct taskstats.freepages_count],[],[],[dnl
+#include linux/types.h
+#include linux/taskstats.h
+])
+]dnl
+)dnl
diff --git a/testcases/kernel/controllers/cgroup/getdelays.c 
b/testcases/kernel/controllers/cgroup/getdelays.c
index 13f7b3a..9fe2831 100644
--- a/testcases/kernel/controllers/cgroup/getdelays.c
+++ b/testcases/kernel/controllers/cgroup/getdelays.c
@@ -199,8 +199,10 @@ void print_delayacct(struct taskstats *t)
   SWAP  %15s%15s\n
 %15llu%15llu\n
   RECLAIM  %12s%15s\n
-%15llu%15llu\n,
-  count, real total, virtual total, delay total,
+#ifdef HAVE_TASKSTATS_FREEPAGES_COUNT
+%15llu%15llu\n
+#endif
+  , count, real total, virtual total, delay total,
   (unsigned long long)t-cpu_count,
   (unsigned long long)t-cpu_run_real_total,
   (unsigned long long)t-cpu_run_virtual_total,
@@ -211,9 +213,12 @@ void print_delayacct(struct taskstats *t)
   count, delay total,
   (unsigned long long)t-swapin_count,
   (unsigned long long)t-swapin_delay_total,
-  count, delay total,
-  (unsigned long long)t-freepages_count,
-  (unsigned long long)t-freepages_delay_total);
+  count, delay total
+#ifdef HAVE_TASKSTATS_FREEPAGES_COUNT
+  , (unsigned long long)t-freepages_count,
+  (unsigned long long)t-freepages_delay_total
+#endif
+  );
  }
   void task_context_switch_counts(struct taskstats *t)
-- 
1.6.2


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list