On Mon, 2008-09-22 at 13:03 +0900, Masatake YAMATO wrote:
> The attached patch moves getgid02.c to getegid02.c.
> 
> Signed-off-by: Masatake YAMATO <[EMAIL PROTECTED]>
Thanks for this. I have applied.

Regards--
Subrata
> 
> --- ltp-git-tmp/runtest/syscalls      2008-09-22 12:43:00.000000000 +0900
> +++ ltp-git/runtest/syscalls  2008-09-22 12:32:33.000000000 +0900
> @@ -265,12 +265,17 @@
> 
>  getegid01 getegid01
>  getegid01_16 getegid01_16
> +getegid02 getegid02
> +getegid02_16 getegid02_16
> 
>  geteuid01 geteuid01
> 
>  getgid01 getgid01
> -getgid02 getgid02
> +getgid01_16 getgid01_16
> +# getgid02 is moved to getegid.
> +# getgid02 getgid02
>  getgid03 getgid03
> +getgid03_16 getgid03_16
> 
>  getgroups01 getgroups01
>  getgroups02 getgroups02
> --- ltp-git-tmp/testcases/kernel/syscalls/getegid/Makefile    2008-09-22 
> 12:43:00.000000000 +0900
> +++ ltp-git/testcases/kernel/syscalls/getegid/Makefile        2008-09-22 
> 12:47:08.000000000 +0900
> @@ -16,7 +16,7 @@
>  #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>  #
> 
> -CFLAGS += -I../../../../include -Wall
> +CFLAGS += -I../../../../include -I../utils -Wall
>  LDLIBS += -L../../../../lib -lltp
> 
>  include ../utils/compat_16.mk
> --- ltp-git-tmp/testcases/kernel/syscalls/getegid/compat_16.h 1970-01-01 
> 09:00:00.000000000 +0900
> +++ ltp-git/testcases/kernel/syscalls/getegid/compat_16.h     2008-09-22 
> 12:29:53.000000000 +0900
> @@ -0,0 +1,48 @@
> +/*
> + *
> + *   Copyright (c) Red Hat Inc., 2008
> + *
> + *   This program is free software;  you can redistribute it and/or modify
> + *   it under the terms of the GNU General Public License as published by
> + *   the Free Software Foundation; either version 2 of the License, or
> + *   (at your option) any later version.
> + *
> + *   This program is distributed in the hope that it will be useful,
> + *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
> + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
> + *   the GNU General Public License for more details.
> + *
> + *   You should have received a copy of the GNU General Public License
> + *   along with this program;  if not, write to the Free Software
> + *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> + */
> +
> +/* Author: Masatake YAMATO <[EMAIL PROTECTED]> */
> +
> +#ifndef __GETEGID_COMPAT_16_H__
> +#define __GETEGID_COMPAT_16_H__
> +
> +
> +#include "linux_syscall_numbers.h"
> +#include "compat_gid.h"
> +
> +
> +#ifdef TST_USE_COMPAT16_SYSCALL
> +
> +GID_T
> +GETEGID(void)
> +{
> +     return syscall(__NR_getegid);
> +}
> +
> +#else
> +
> +GID_T
> +GETEGID(void)
> +{
> +     return getegid();
> +}
> +
> +#endif
> +
> +#endif /* __GETEGID_COMPAT_16_H__ */
> --- ltp-git-tmp/testcases/kernel/syscalls/getegid/getegid01.c 2008-09-22 
> 12:43:00.000000000 +0900
> +++ ltp-git/testcases/kernel/syscalls/getegid/getegid01.c     2008-09-22 
> 12:50:32.000000000 +0900
> @@ -116,10 +116,11 @@
>  #include "test.h"
>  #include "usctest.h"
> 
> -void setup();
> -void cleanup();
> +#include "compat_16.h"
> 
> 
> +void setup();
> +void cleanup();
> 
>  TCID_DEFINE(getegid01);              /* Test program identifier.    */
>  int TST_TOTAL=1;             /* Total number of test cases. */
> @@ -127,27 +128,6 @@
> 
>  int exp_enos[]={0};          /* must be a 0 terminated list */
> 
> -
> -#ifdef TST_USE_COMPAT16_SYSCALL
> -/* __kernel_old_gid_t */
> -#include <asm/posix_types.h>
> -
> -/* __NR_getegid */
> -#include "linux_syscall_numbers.h"
> -
> -__kernel_old_gid_t
> -GETEGID(void)
> -{
> -  return syscall(__NR_getegid);
> -}
> -#else
> -gid_t
> -GETEGID(void)
> -{
> -  return getegid();
> -}
> -#endif  /* TST_USE_COMPAT16_SYSCALL */
> -
>  int
>  main(int ac, char **av)
>  {
> --- ltp-git-tmp/testcases/kernel/syscalls/getegid/getegid02.c 1970-01-01 
> 09:00:00.000000000 +0900
> +++ ltp-git/testcases/kernel/syscalls/getegid/getegid02.c     2008-09-22 
> 12:45:31.000000000 +0900
> @@ -0,0 +1,166 @@
> +/*
> + *
> + *   Copyright (c) International Business Machines  Corp., 2001
> + *
> + *   This program is free software;  you can redistribute it and/or modify
> + *   it under the terms of the GNU General Public License as published by
> + *   the Free Software Foundation; either version 2 of the License, or
> + *   (at your option) any later version.
> + *
> + *   This program is distributed in the hope that it will be useful,
> + *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
> + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
> + *   the GNU General Public License for more details.
> + *
> + *   You should have received a copy of the GNU General Public License
> + *   along with this program;  if not, write to the Free Software
> + *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> + */
> +
> +/*
> + * NAME
> + *   getegid02.c
> + *
> + * DESCRIPTION
> + *   Testcase to check the basic functionality of getegid().
> + *
> + * ALGORITHM
> + *   call setup
> + *   loop if that option was specified
> + *   Execute getegid() call using TEST macro
> + *   if not expected value
> + *      break remaining tests and cleanup
> + *   if STD_FUNCTIONAL_TEST
> + *      Execute geteuid() call
> + *      Execute getpwduid() call
> + *      if the passwd entry is NULL
> + *         break the remaining tests and cleanup
> + *      else if pwent->pw_gid != TEST_RETURN
> + *         print failure message
> + *      else
> + *         print pass message
> + *   else
> + *      print pass message
> + *      call cleanup
> + *
> + * USAGE:  <for command-line>
> + *  getegid02 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
> + *     where,  -c n : Run n copies concurrently.
> + *             -f   : Turn off functionality Testing.
> + *             -i n : Execute test n times.
> + *             -I x : Execute test for x seconds.
> + *             -P x : Pause for x seconds between iterations.
> + *             -t   : Turn on syscall timing.
> + *
> + * HISTORY
> + *   07/2001 Ported by Wayne Boyer
> + *
> + * RESTRICTIONS
> + *   none
> + */
> +
> +#include <pwd.h>
> +#include <errno.h>
> +
> +#include "test.h"
> +#include "usctest.h"
> +
> +#include "compat_16.h"
> +
> +void cleanup(void);
> +void setup(void);
> +
> +TCID_DEFINE(getegid02);
> +int TST_TOTAL = 1;
> +extern int Tst_count;
> +
> +int main(int ac, char **av)
> +{
> +     int lc;                         /* loop counter */
> +     char *msg;                      /* message returned from parse_opts */
> +     int euid;
> +     struct passwd *pwent;
> +
> +     /* parse standard options */
> +     if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
> +             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
> +             /*NOTREACHED*/
> +     }
> +
> +     setup();                        /* global setup */
> +
> +     /* The following loop checks looping state if -i option given */
> +     for (lc = 0; TEST_LOOPING(lc); lc++) {
> +
> +             /* reset Tst_count in case we are looping */
> +             Tst_count = 0;
> +
> +             TEST(GETEGID());
> +
> +             if (TEST_RETURN < 0) {
> +                     tst_brkm(TBROK, cleanup, "This should never happen");
> +             }
> +
> +             if (STD_FUNCTIONAL_TEST) {
> +                     euid = geteuid();
> +
> +                     pwent = getpwuid(euid);
> +
> +                     if (pwent == NULL) {
> +                             tst_brkm(TBROK, cleanup, "geteuid() returned "
> +                                      "unexpected value %d", euid);
> +                     } else if (!GID_SIZE_CHECK(pwent->pw_gid)) {
> +                             tst_brkm(TBROK, 
> +                                      cleanup, 
> +                                      "gid for euid %d is too large for 
> testing getegid16",
> +                                      euid);
> +                     } else {
> +                             if (pwent->pw_gid != TEST_RETURN) {
> +                                     tst_resm(TFAIL, "getegid() return value"
> +                                             " %d unexpected - expected %d",
> +                                             TEST_RETURN, pwent->pw_gid);
> +                             } else {
> +                                     tst_resm(TPASS, "effective group id %d "
> +                                              "is correct", TEST_RETURN);
> +                             }
> +                     }
> +             } else {
> +                     tst_resm(TPASS, "call succeeded");
> +             }
> +     }
> +     cleanup();
> +
> +     /*NOTREACHED*/
> +     return(0);
> +}
> +
> +
> +/*
> + * setup() - performs all ONE TIME setup for this test
> + */
> +void
> +setup()
> +{
> +     /* capture signals */
> +     tst_sig(NOFORK, DEF_HANDLER, cleanup);
> +
> +     /* Pause if that option was specified */
> +     TEST_PAUSE;
> +}
> +
> +/*
> + * cleanup() - performs all the ONE TIME cleanup for this test at completion
> + *          or premature exit.
> + */
> +void
> +cleanup()
> +{
> +     /*
> +      * print timing status if that option was specified.
> +      * print errno log if that option was specified
> +      */
> +     TEST_CLEANUP;
> +
> +     /* exit with return code appropriate for results */
> +     tst_exit();
> +}
> --- ltp-git-tmp/testcases/kernel/syscalls/getgid/getgid02.c   2008-09-22 
> 12:43:00.000000000 +0900
> +++ ltp-git/testcases/kernel/syscalls/getgid/getgid02.c       1970-01-01 
> 09:00:00.000000000 +0900
> @@ -1,166 +0,0 @@
> -/*
> - *
> - *   Copyright (c) International Business Machines  Corp., 2001
> - *
> - *   This program is free software;  you can redistribute it and/or modify
> - *   it under the terms of the GNU General Public License as published by
> - *   the Free Software Foundation; either version 2 of the License, or
> - *   (at your option) any later version.
> - *
> - *   This program is distributed in the hope that it will be useful,
> - *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
> - *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
> - *   the GNU General Public License for more details.
> - *
> - *   You should have received a copy of the GNU General Public License
> - *   along with this program;  if not, write to the Free Software
> - *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> - */
> -
> -/*
> - * NAME
> - *   getgid02.c
> - *
> - * DESCRIPTION
> - *   Testcase to check the basic functionality of getegid().
> - *
> - * ALGORITHM
> - *   call setup
> - *   loop if that option was specified
> - *   Execute getegid() call using TEST macro
> - *   if not expected value
> - *      break remaining tests and cleanup
> - *   if STD_FUNCTIONAL_TEST
> - *      Execute geteuid() call
> - *      Execute getpwduid() call
> - *      if the passwd entry is NULL
> - *         break the remaining tests and cleanup
> - *      else if pwent->pw_gid != TEST_RETURN
> - *         print failure message
> - *      else
> - *         print pass message
> - *   else
> - *      print pass message
> - *      call cleanup
> - *
> - * USAGE:  <for command-line>
> - *  getgid02 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
> - *     where,  -c n : Run n copies concurrently.
> - *             -f   : Turn off functionality Testing.
> - *             -i n : Execute test n times.
> - *             -I x : Execute test for x seconds.
> - *             -P x : Pause for x seconds between iterations.
> - *             -t   : Turn on syscall timing.
> - *
> - * HISTORY
> - *   07/2001 Ported by Wayne Boyer
> - *
> - * RESTRICTIONS
> - *   none
> - */
> -
> -#include <pwd.h>
> -#include <errno.h>
> -
> -#include "test.h"
> -#include "usctest.h"
> -
> -#include "compat_16.h"
> -
> -void cleanup(void);
> -void setup(void);
> -
> -TCID_DEFINE(getgid02);
> -int TST_TOTAL = 1;
> -extern int Tst_count;
> -
> -int main(int ac, char **av)
> -{
> -     int lc;                         /* loop counter */
> -     char *msg;                      /* message returned from parse_opts */
> -     int euid;
> -     struct passwd *pwent;
> -
> -     /* parse standard options */
> -     if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
> -             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
> -             /*NOTREACHED*/
> -     }
> -
> -     setup();                        /* global setup */
> -
> -     /* The following loop checks looping state if -i option given */
> -     for (lc = 0; TEST_LOOPING(lc); lc++) {
> -
> -             /* reset Tst_count in case we are looping */
> -             Tst_count = 0;
> -
> -             TEST(GETEGID());
> -
> -             if (TEST_RETURN < 0) {
> -                     tst_brkm(TBROK, cleanup, "This should never happen");
> -             }
> -
> -             if (STD_FUNCTIONAL_TEST) {
> -                     euid = geteuid();
> -
> -                     pwent = getpwuid(euid);
> -
> -                     if (pwent == NULL) {
> -                             tst_brkm(TBROK, cleanup, "geteuid() returned "
> -                                      "unexpected value %d", euid);
> -                     } else if (!GID_SIZE_CHECK(pwent->pw_gid)) {
> -                             tst_brkm(TBROK, 
> -                                      cleanup, 
> -                                      "gid for euid %d is too large for 
> testing getegid16",
> -                                      euid);
> -                     } else {
> -                             if (pwent->pw_gid != TEST_RETURN) {
> -                                     tst_resm(TFAIL, "getegid() return value"
> -                                             " %d unexpected - expected %d",
> -                                             TEST_RETURN, pwent->pw_gid);
> -                             } else {
> -                                     tst_resm(TPASS, "effective group id %d "
> -                                              "is correct", TEST_RETURN);
> -                             }
> -                     }
> -             } else {
> -                     tst_resm(TPASS, "call succeeded");
> -             }
> -     }
> -     cleanup();
> -
> -     /*NOTREACHED*/
> -     return(0);
> -}
> -
> -
> -/*
> - * setup() - performs all ONE TIME setup for this test
> - */
> -void
> -setup()
> -{
> -     /* capture signals */
> -     tst_sig(NOFORK, DEF_HANDLER, cleanup);
> -
> -     /* Pause if that option was specified */
> -     TEST_PAUSE;
> -}
> -
> -/*
> - * cleanup() - performs all the ONE TIME cleanup for this test at completion
> - *          or premature exit.
> - */
> -void
> -cleanup()
> -{
> -     /*
> -      * print timing status if that option was specified.
> -      * print errno log if that option was specified
> -      */
> -     TEST_CLEANUP;
> -
> -     /* exit with return code appropriate for results */
> -     tst_exit();
> -}
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Ltp-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ltp-list


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to