]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
testsuite: cgconfigparser simple sanity test
authorIvana Hutarova Varekova <varekova@redhat.com>
Mon, 7 Mar 2011 09:48:25 +0000 (10:48 +0100)
committerJan Safranek <jsafrane@redhat.com>
Mon, 7 Mar 2011 09:48:30 +0000 (10:48 +0100)
simple sanity test for cgconfigparser, cgsnapshot and cgclear tool

changelog:
 * test moved to separate subdirectory tools
changelog v2:
 * add hardcoded blacklist
changelog v3:
 * use $TMP instead of tmp

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
configure.in
tests/Makefile.am
tests/tools/Makefile.am [new file with mode: 0644]
tests/tools/cgconfigparser/Makefile.am [new file with mode: 0644]
tests/tools/cgconfigparser/cgconfigparser_simple [new file with mode: 0755]

index d7ad70e73a0b0de5ad282ff79ac90c3681a3e941..226f1bba9ec72b68e59d905e7911e6705339311e 100644 (file)
@@ -190,6 +190,8 @@ fi
 AC_CONFIG_FILES([Makefile
        tests/Makefile
        tests/tools/testenv.sh
+       tests/tools/Makefile
+       tests/tools/cgconfigparser/Makefile
        src/Makefile
        src/daemon/Makefile
        src/tools/Makefile
index 5d273424bdc64dc4b89e80468610e0736f2bedd7..06826c8c9fc2f7e1d65884c7a426aa02461179cf 100644 (file)
@@ -1,3 +1,5 @@
+SUBDIR = tools
+
 INCLUDES = -I$(top_srcdir)/include
 LDADD = $(top_builddir)/src/.libs/libcgroup.la
 
diff --git a/tests/tools/Makefile.am b/tests/tools/Makefile.am
new file mode 100644 (file)
index 0000000..5c08525
--- /dev/null
@@ -0,0 +1,2 @@
+SUBDIRS = cgconfigparser
+
diff --git a/tests/tools/cgconfigparser/Makefile.am b/tests/tools/cgconfigparser/Makefile.am
new file mode 100644 (file)
index 0000000..cbb4112
--- /dev/null
@@ -0,0 +1,3 @@
+EXTRA_DIST = cgconfigparser_simple
+
+TESTS = cgconfigparser_simple
diff --git a/tests/tools/cgconfigparser/cgconfigparser_simple b/tests/tools/cgconfigparser/cgconfigparser_simple
new file mode 100755 (executable)
index 0000000..93cefdb
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+# simple sanity test for cgconfigparser, cgsnapshot and cgclear tool
+
+. `dirname $0`/../testenv.sh
+
+
+mkdir -p /$TMP/cgroups/cpu 2>/dev/null
+mount -t cgroup -o cpu,cpuacct cpu /$TMP/cgroups/cpu || die "Mount failed"
+
+$TOOLSDIR/cgsnapshot -b $CONFIGDIR/cgsnapshot_blacklist.conf >/$TMP/temp.conf || die "cgsnapshot failed"
+lss_o1=`lssubsys -m`
+$TOOLSDIR/cgclear || die "1st cgclear failed"
+
+$TOOLSDIR/cgconfigparser -l /$TMP/temp.conf || die "cgconfigparser failed"
+lss_o2=`lssubsys -m`
+$TOOLSDIR/cgclear || die "2nd cgclear failed"
+
+if [ "$lss_o1" != "$lss_o2" ]; then
+     echo "ERROR: first lss ouptput:'$lss_o1', second lss output:'$lss_o2'"
+fi
+
+echo "PASS: cgconfigparser_simple"
+cleanup
+exit 0