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 <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 | 24 ++++++++++++++++++++++ 5 files changed, 33 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..93cefdb --- /dev/null +++ b/tests/tools/cgconfigparser/cgconfigparser_simple @@ -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 ------------------------------------------------------------------------------ What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel