LDADD = $(top_builddir)/src/.libs/libcgroup.la
# compile the tests, but do not install them
-noinst_PROGRAMS = libcgrouptest01 libcg_ba setuid pathtest walk_test read_stats walk_task get_controller get_mount_point proctest get_all_controller get_variable_names test_named_hierarchy get_procs
+noinst_PROGRAMS = libcgrouptest01 libcg_ba setuid walk_test read_stats walk_task get_controller get_mount_point proctest get_all_controller get_variable_names test_named_hierarchy get_procs
libcgrouptest01_SOURCES=libcgrouptest01.c test_functions.c libcgrouptest.h
libcg_ba_SOURCES=libcg_ba.cpp
setuid_SOURCES=setuid.c
-pathtest_SOURCES=pathtest.c
walk_test_SOURCES=walk_test.c
read_stats_SOURCES=read_stats.c
walk_task_SOURCES=walk_task.c
test_named_hierarchy_SOURCES=test_named_hierarchy.c
get_procs_SOURCES=get_procs.c
-EXTRA_DIST = pathtest.sh runlibcgrouptest.sh
+EXTRA_DIST = runlibcgrouptest.sh
TESTS = runlibcgrouptest.sh
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <libcgroup.h>
-
-int main(int argc, char *argv[])
-{
- char *path;
- char *expected_path, *controller;
- int ret;
-
- if (argc < 2) {
- fprintf(stderr, "Usage %s: <controller name> <path>\n",
- argv[0]);
- exit(EXIT_FAILURE);
- }
-
- controller = argv[1];
- expected_path = argv[2];
-
- cgroup_init();
-
- ret = cgroup_get_current_controller_path(getpid(), controller, &path);
- if (ret)
- printf("Test FAIL, get path failed for controller %s\n",
- controller);
- else {
- if (strcmp(path, expected_path))
- printf("Test FAIL, expected_path %s, got path %s\n",
- expected_path, path);
- else
- printf("Test PASS, controller %s path %s\n",
- controller, path);
- free(path);
- }
-
- return EXIT_SUCCESS;
-}
+++ /dev/null
-#!/bin/bash
-
-while read name extra
-do
- echo $name | grep -q '^#'
- if [ $? -eq 0 ]
- then
- continue
- fi
- path=`cat /proc/$$/cgroup | cut -d ':' -f 3`
- ./pathtest $name $path
-done < /proc/cgroups