simple sanity test for cgconfigparser, cgsnapshot and cgclear tool

changelog:
 * test moved to separate subdirectory tools
changelog v2:
 * add hardcoded blacklist

Signed-off-by: Ivana Hutarova Varekova <varek...@redhat.com>
---

 configure.in                                     |    2 ++
 tests/Makefile.am                                |    2 ++
 tests/tools/Makefile.am                          |    2 ++
 tests/tools/cgconfigparser/Makefile.am           |    3 +++
 tests/tools/cgconfigparser/cgconfigparser_simple |   25 ++++++++++++++++++++++
 5 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 tests/tools/Makefile.am
 create mode 100644 tests/tools/cgconfigparser/Makefile.am
 create mode 100755 tests/tools/cgconfigparser/cgconfigparser_simple

diff --git a/configure.in b/configure.in
index 46e2701..bcf4f1a 100644
--- a/configure.in
+++ b/configure.in
@@ -178,6 +178,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
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5d27342..06826c8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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
index 0000000..5c08525
--- /dev/null
+++ b/tests/tools/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = cgconfigparser
+
diff --git a/tests/tools/cgconfigparser/Makefile.am 
b/tests/tools/cgconfigparser/Makefile.am
new file mode 100644
index 0000000..cbb4112
--- /dev/null
+++ b/tests/tools/cgconfigparser/Makefile.am
@@ -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
index 0000000..e1e8dd1
--- /dev/null
+++ b/tests/tools/cgconfigparser/cgconfigparser_simple
@@ -0,0 +1,25 @@
+#!/bin/bash
+# simple sanity test for cgconfigparser, cgsnapshot and cgclear tool
+#. /home/varekova/bg/libcgroup/tests/git/new/libcg/tests/tools/testenv.sh
+
+. `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


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to