On Tue, Mar 9, 2010 at 8:23 AM, Rishi kesh K Rajak
<[email protected]> wrote:
> The branch, master, has been updated
>       via  c962f51674b971496e14ac4be0cc75da98b75fca (commit)
>       via  17905ceabf2dc20e978dfa4ea3682197ad01bf9a (commit)
>       via  bdfe0b2a9dd720c3013225cc4aa1628e77888b24 (commit)
>       via  716d29883b11107c32313b1836bea447fecbaf1e (commit)
>       via  58854395050b8a3bb2fa4e5e4401546925f6aad8 (commit)
>       via  886918830ae73a7f4b5cc2d9bf8554ee9f393ed8 (commit)
>       via  039e4bbd522168a5145d236faa4e13f402037390 (commit)
>      from  63f0a8f554d28b28b207f41e42182e1b789333b6 (commit)
>
>
> - Log -----------------------------------------------------------------
> commit c962f51674b971496e14ac4be0cc75da98b75fca
> Author: Rishikesh K Rajak <[email protected]>
> Date:   Tue Mar 9 21:53:25 2010 +0530
>
>    Testing for post-receive-email
>
>    Signed-off-by: Rishikesh K Rajak <[email protected]>
>
> commit 17905ceabf2dc20e978dfa4ea3682197ad01bf9a
> Author: Rishikesh K Rajak <[email protected]>
> Date:   Tue Mar 9 14:11:41 2010 +0530
>
>    Merge branches 'next' and 'master'
>
> -----------------------------------------------------------------------
>
> Summary of changes:
>  TODO                                               |    2 +-
>  testcases/kernel/containers/Makefile               |    2 +
>  .../check_netns_enabled.c => check_for_unshare.c}  |   60 
> +++++++++++---------
>  .../kernel/controllers/freezer/run_freezer.sh      |    3 +-
>  testcases/kernel/syscalls/libevent/Makefile.in     |    3 +-
>  5 files changed, 40 insertions(+), 30 deletions(-)
>  copy testcases/kernel/containers/{netns/check_netns_enabled.c => 
> check_for_unshare.c} (52%)
>
> diff --git a/TODO b/TODO
> index 9eec828..1756168 100644
> --- a/TODO
> +++ b/TODO
> @@ -1,4 +1,4 @@
> -The following things need to be rewritten // fixed:
> +The following things need to be rewritten // fixed
>
>  get_mempolicy01 // mbind01: They're using numa v1 calls which means that all
>  versions of Linux / numa as of a few years ago aren't compatible with the API
> diff --git a/testcases/kernel/containers/Makefile 
> b/testcases/kernel/containers/Makefile
> index 6a7810e..26f1856 100644
> --- a/testcases/kernel/containers/Makefile
> +++ b/testcases/kernel/containers/Makefile
> @@ -26,6 +26,8 @@ FILTER_OUT_DIRS               := $(LIBDIR)
>
>  LIB                    := $(LIBDIR)/libclone.a
>
> +LIB                    := -ld
> +

Wrong. Should be: LDLIBS += -ldl

>  INSTALL_TARGETS                := *.sh
>
>  $(LIBDIR):
> diff --git a/testcases/kernel/containers/netns/check_netns_enabled.c 
> b/testcases/kernel/containers/check_for_unshare.c
> similarity index 52%
> copy from testcases/kernel/containers/netns/check_netns_enabled.c
> copy to testcases/kernel/containers/check_for_unshare.c
> index f6add06..06bdfd7 100644
> --- a/testcases/kernel/containers/netns/check_netns_enabled.c
> +++ b/testcases/kernel/containers/check_for_unshare.c
> @@ -13,37 +13,43 @@
>  * along with this program; if not, write to the Free Software
>  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
>  *
> -* Author: Veerendra C <[email protected]>
> +**************************************************************************/
> +/*
> +* Description:
> +* This program verifies the kernel version to be no later than 2.6.16
> +* And checks if the unshare() system call is defined using dlsym(),
> +* in the Dynamically Linked Libraries.
>  *
> -* Net namespaces were introduced around 2.6.25.  Kernels before that,
> -* assume they are not enabled.  Kernels after that, check for -EINVAL
> -* when trying to use CLONE_NEWNET and CLONE_NEWNS.
> -***************************************************************************/
> -#include <stdio.h>
> -#include <sched.h>
> -#include "config.h"
> -#include "libclone.h"
> -#include "linux_syscall_numbers.h"
> -#include "test.h"
> +* Date : 26-11-2008
> +* Author : Veerendra C <[email protected]>
> +*/
>
> -char *TCID = "check_netns_enabled";
> -int TST_COUNT = 1;
> -int TST_TOTAL = 1;
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <dlfcn.h>
> +#include <linux/version.h>
>
> -#ifndef CLONE_NEWNET
> -#define CLONE_NEWNET -1
> -#endif
> +int main(int argc, char **argv)
> +{
> +       void *handle;
> +       void *ret;
> +       char *error;
> +       if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16))
> +       return 1;
>
> -#ifndef CLONE_NEWNS
> -#define CLONE_NEWNS -1
> -#endif
> +       handle = dlopen(NULL, RTLD_LAZY);
> +       if (!handle) {
> +               fprintf(stderr, "%s\n", dlerror());
> +               exit(1);
> +       }
>
> -int
> -main()
> -{
> -       /* Checking if the kernel supports unshare with netns capabilities. */
> -        if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
> -               tst_resm (TFAIL | TERRNO, "unshare syscall smoke test 
> failed");
> +       dlerror();    /* Clear any existing error */
> +       ret = dlsym(handle, "unshare");
> +       if ((error = dlerror()) != NULL)  {
> +               fprintf(stderr, "Error: %s\n", error);
> +               exit(1);
>        }
> -       tst_exit();
> +
> +       dlclose(handle);
> +       return 0;
>  }

-Garrett

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to