summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/Makefile.am63
-rw-r--r--testsuite/Makefile.in733
-rw-r--r--testsuite/README33
-rw-r--r--testsuite/config/unix.exp244
-rw-r--r--testsuite/free.test/free.exp61
-rw-r--r--testsuite/kill.test/kill.exp65
-rw-r--r--testsuite/lib.test/fileutils.exp19
-rwxr-xr-xtestsuite/lib.test/fileutils_badfd.sh3
-rwxr-xr-xtestsuite/lib.test/fileutils_full.sh3
-rw-r--r--testsuite/lib.test/strutils.exp25
-rw-r--r--testsuite/pgrep.test/pgrep.exp131
-rw-r--r--testsuite/pkill.test/pkill.exp51
-rw-r--r--testsuite/pmap.test/pmap.exp106
-rw-r--r--testsuite/ps.test/ps_output.exp63
-rw-r--r--testsuite/ps.test/ps_personality.exp18
-rw-r--r--testsuite/ps.test/ps_sched_batch.exp11
-rw-r--r--testsuite/ps.test/test-schedbatch.c46
-rw-r--r--testsuite/pwdx.test/pwdx.exp22
-rw-r--r--testsuite/slabtop.test/slabtop.exp45
-rw-r--r--testsuite/sysctl.test/sysctl_read.exp29
-rw-r--r--testsuite/uptime.test/uptime.exp17
-rw-r--r--testsuite/vmstat.test/vmstat.exp57
-rw-r--r--testsuite/w.test/w.exp59
23 files changed, 1904 insertions, 0 deletions
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
new file mode 100644
index 0000000..ec95f5a
--- /dev/null
+++ b/testsuite/Makefile.am
@@ -0,0 +1,63 @@
+AUTOMAKE_OPTIONS = dejagnu
+export DEJAGNU
+
+# Programs that are expected across the board.
+DEJATOOL =
+
+noinst_PROGRAMS = test-schedbatch
+
+test_schedbatch_SOURCES = ps.test/test-schedbatch.c
+
+if LINUX
+# These should be in defined in 'across the board' scope, but are
+# temporarily disabled on other than linux systems, see commit
+# 3d807ae853b8b4264da156065b34f1447658a8ba
+DEJATOOL += \
+ pmap
+if !CYGWIN
+DEJATOOL += \
+ slabtop \
+ sysctl
+endif
+
+if BUILD_KILL
+DEJATOOL += kill
+endif
+
+DEJATOOL += \
+ free \
+ lib \
+ pgrep \
+ pkill \
+ ps \
+ pwdx \
+ slabtop \
+ uptime \
+ vmstat \
+ w
+endif
+
+EXTRA_DIST = \
+ config/unix.exp \
+ free.test/free.exp \
+ kill.test/kill.exp \
+ lib.test/fileutils.exp \
+ lib.test/fileutils_badfd.sh \
+ lib.test/fileutils_full.sh \
+ lib.test/strutils.exp \
+ pgrep.test/pgrep.exp \
+ pkill.test/pkill.exp \
+ pmap.test/pmap.exp \
+ ps.test/ps_output.exp \
+ ps.test/ps_personality.exp \
+ ps.test/ps_sched_batch.exp \
+ pwdx.test/pwdx.exp \
+ slabtop.test/slabtop.exp \
+ uptime.test/uptime.exp \
+ vmstat.test/vmstat.exp \
+ w.test/w.exp
+if !CYGWIN
+EXTRA_DIST += \
+ slabtop.test/slabtop.exp \
+ sysctl.test/sysctl_read.exp
+endif
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
new file mode 100644
index 0000000..62ce7dc
--- /dev/null
+++ b/testsuite/Makefile.in
@@ -0,0 +1,733 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = test-schedbatch$(EXEEXT)
+
+# These should be in defined in 'across the board' scope, but are
+# temporarily disabled on other than linux systems, see commit
+# 3d807ae853b8b4264da156065b34f1447658a8ba
+@LINUX_TRUE@am__append_1 = \
+@LINUX_TRUE@ pmap
+
+@CYGWIN_FALSE@@LINUX_TRUE@am__append_2 = \
+@CYGWIN_FALSE@@LINUX_TRUE@ slabtop \
+@CYGWIN_FALSE@@LINUX_TRUE@ sysctl
+
+@BUILD_KILL_TRUE@@LINUX_TRUE@am__append_3 = kill
+@LINUX_TRUE@am__append_4 = \
+@LINUX_TRUE@ free \
+@LINUX_TRUE@ lib \
+@LINUX_TRUE@ pgrep \
+@LINUX_TRUE@ pkill \
+@LINUX_TRUE@ ps \
+@LINUX_TRUE@ pwdx \
+@LINUX_TRUE@ slabtop \
+@LINUX_TRUE@ uptime \
+@LINUX_TRUE@ vmstat \
+@LINUX_TRUE@ w
+
+@CYGWIN_FALSE@am__append_5 = \
+@CYGWIN_FALSE@ slabtop.test/slabtop.exp \
+@CYGWIN_FALSE@ sysctl.test/sysctl_read.exp
+
+subdir = testsuite
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_test_schedbatch_OBJECTS = ps.test/test-schedbatch.$(OBJEXT)
+test_schedbatch_OBJECTS = $(am_test_schedbatch_OBJECTS)
+test_schedbatch_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ps.test/$(DEPDIR)/test-schedbatch.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(test_schedbatch_SOURCES)
+DIST_SOURCES = $(test_schedbatch_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
+EXPECT = expect
+RUNTEST = runtest
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+ $(top_srcdir)/mkinstalldirs README
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEJAGNU = @DEJAGNU@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIB = @DL_LIB@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ELOGIND_CFLAGS = @ELOGIND_CFLAGS@
+ELOGIND_LIBS = @ELOGIND_LIBS@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FILECMD = @FILECMD@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+HARDEN_CFLAGS = @HARDEN_CFLAGS@
+HARDEN_LDFLAGS = @HARDEN_LDFLAGS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PO4A = @PO4A@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+USE_NLS = @USE_NLS@
+USE_PO4A = @USE_PO4A@
+VERSION = @VERSION@
+WITH_COLORWATCH = @WITH_COLORWATCH@
+WITH_WATCH8BIT = @WITH_WATCH8BIT@
+XGETTEXT = @XGETTEXT@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+usrbin_execdir = @usrbin_execdir@
+AUTOMAKE_OPTIONS = dejagnu
+
+# Programs that are expected across the board.
+DEJATOOL = $(am__append_1) $(am__append_2) $(am__append_3) \
+ $(am__append_4)
+test_schedbatch_SOURCES = ps.test/test-schedbatch.c
+EXTRA_DIST = config/unix.exp free.test/free.exp kill.test/kill.exp \
+ lib.test/fileutils.exp lib.test/fileutils_badfd.sh \
+ lib.test/fileutils_full.sh lib.test/strutils.exp \
+ pgrep.test/pgrep.exp pkill.test/pkill.exp pmap.test/pmap.exp \
+ ps.test/ps_output.exp ps.test/ps_personality.exp \
+ ps.test/ps_sched_batch.exp pwdx.test/pwdx.exp \
+ slabtop.test/slabtop.exp uptime.test/uptime.exp \
+ vmstat.test/vmstat.exp w.test/w.exp $(am__append_5)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign testsuite/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+ps.test/$(am__dirstamp):
+ @$(MKDIR_P) ps.test
+ @: > ps.test/$(am__dirstamp)
+ps.test/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ps.test/$(DEPDIR)
+ @: > ps.test/$(DEPDIR)/$(am__dirstamp)
+ps.test/test-schedbatch.$(OBJEXT): ps.test/$(am__dirstamp) \
+ ps.test/$(DEPDIR)/$(am__dirstamp)
+
+test-schedbatch$(EXEEXT): $(test_schedbatch_OBJECTS) $(test_schedbatch_DEPENDENCIES) $(EXTRA_test_schedbatch_DEPENDENCIES)
+ @rm -f test-schedbatch$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_schedbatch_OBJECTS) $(test_schedbatch_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ps.test/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@ps.test/$(DEPDIR)/test-schedbatch.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-DEJAGNU: site.exp
+ srcdir='$(srcdir)'; export srcdir; \
+ EXPECT=$(EXPECT); export EXPECT; \
+ if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
+ exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
+ if $(RUNTEST) $(RUNTESTDEFAULTFLAGS) $(AM_RUNTESTFLAGS) $(RUNTESTFLAGS); \
+ then :; else exit_status=1; fi; \
+ done; \
+ else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
+ fi; \
+ exit $$exit_status
+site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
+ @echo 'Making a new site.exp file ...'
+ @echo '## these variables are automatically generated by make ##' >site.tmp
+ @echo '# Do not edit here. If you wish to override these values' >>site.tmp
+ @echo '# edit the last section' >>site.tmp
+ @echo 'set srcdir "$(srcdir)"' >>site.tmp
+ @echo "set objdir \"`pwd`\"" >>site.tmp
+ @echo 'set build_alias "$(build_alias)"' >>site.tmp
+ @echo 'set build_triplet $(build_triplet)' >>site.tmp
+ @echo 'set host_alias "$(host_alias)"' >>site.tmp
+ @echo 'set host_triplet $(host_triplet)' >>site.tmp
+ @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
+ echo "## Begin content included from file $$f. Do not modify. ##" \
+ && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
+ && echo "## End content included from file $$f. ##" \
+ || exit 1; \
+ done >> site.tmp
+ @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
+ @if test -f site.exp; then \
+ sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
+ fi
+ @-rm -f site.bak
+ @test ! -f site.exp || mv site.exp site.bak
+ @mv site.tmp site.exp
+
+distclean-DEJAGNU:
+ -rm -f site.exp site.bak
+ -l='$(DEJATOOL)'; for tool in $$l; do \
+ rm -f $$tool.sum $$tool.log; \
+ done
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f ps.test/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ps.test/$(am__dirstamp)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ps.test/$(DEPDIR)/test-schedbatch.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-DEJAGNU distclean-compile \
+ distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f ps.test/$(DEPDIR)/test-schedbatch.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-DEJAGNU \
+ check-am clean clean-generic clean-libtool \
+ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+ distclean-DEJAGNU distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+export DEJAGNU
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/testsuite/README b/testsuite/README
new file mode 100644
index 0000000..14d4c4c
--- /dev/null
+++ b/testsuite/README
@@ -0,0 +1,33 @@
+How to use check suite
+----------------------
+
+You need DejaGNU package. Assuming you have it all you need to do is
+
+make check
+
+
+Something failed now what
+-------------------------
+
+First determine what did not work. If only one check failed you can
+run it individually in debugging mode. For example
+
+runtest -a -de -v w.test/w.exp
+Expect binary is /usr/bin/expect
+Using /usr/share/dejagnu/runtest.exp as main test driver
+[...]
+
+Do not bother capturing screen output, it is in testrun.log which
+test suite generated.
+
+$ ls testrun.* dbg.log
+dbg.log testrun.log testrun.sum
+
+The reason why test failed should be in dbg.log. Assuming you
+figured out the reason you could write a patch fixing w.test/w.exp
+and send it to upstream.
+
+If you do not know how, or have time, to fix the issue create tar.gz
+file containing test run logs and submit it to upstream maintainers.
+Notice that in later case upstream sometimes has to ask clarifying
+questions about environment where problem occurred.
diff --git a/testsuite/config/unix.exp b/testsuite/config/unix.exp
new file mode 100644
index 0000000..d102a8b
--- /dev/null
+++ b/testsuite/config/unix.exp
@@ -0,0 +1,244 @@
+
+set env(LC_ALL) "C"
+regexp "(.*\/)testsuite" $objdir objdir topdir
+
+# These are the same as include/c.h
+set usage_help "\\s*-h, --help\\s+display this help and exit\\s+"
+set usage_version "\\s*-V, --version\\s+output version information and exit\\s+"
+set usage_man "\\s*For more details see \\S+\\."
+
+proc kill_process pid {
+ set cmdline "kill $pid"
+ if { [catch { exec /bin/sh -c $cmdline } msg]} {
+ warning "Could not kill process: $msg\n"
+ }
+}
+
+proc procps_v_version { tool } {
+ global topdir
+ set toolpath ${topdir}src/${tool}
+ set tmp [ exec $toolpath -V ]
+ regexp "from procps-ng (\[0-9.\]*)" $tmp tmp version
+ clone_output "$toolpath version $version\n"
+}
+
+proc free_version {} { procps_v_version free }
+proc kill_version {} { procps_v_version kill }
+proc pgrep_version {} { procps_v_version pgrep }
+proc pkill_version {} { procps_v_version pkill }
+proc pmap_version {} { procps_v_version pmap }
+proc pwdx_version {} { procps_v_version pwdx }
+proc sysctl_version {} { procps_v_version sysctl }
+proc uptime_version {} { procps_v_version uptime }
+proc vmstat_version {} { procps_v_version vmstat }
+proc w_version {} { procps_v_version w }
+
+#
+#
+# common utilities
+proc expect_continue { testname reg } {
+ expect {
+ -re "$reg" { }
+ eof { fail "$testname" }
+ timeout { fail "$testname" }
+ }
+}
+
+proc expect_pass { testname reg } {
+ expect {
+ -re "$reg" { pass "$testname" }
+ default { fail "$testname" }
+ timeout { fail "$testname" }
+ }
+}
+
+# Fail if we see this message, pass if we get to EOF
+proc expect_fail { testname reg } {
+ expect {
+ -re "$reg" { fail "$testname" }
+ timeout { fail "$testname" }
+ eof { pass "$testname" }
+ }
+}
+
+proc expect_pipeproc_pass { testname reg } {
+ global pipeproc_spawnid
+
+ expect {
+ -i $pipeproc_spawnid
+ -re "$reg" { pass "$testname" }
+ default { fail "$testname" }
+ timeout { fail "$testname (timeout)" }
+ }
+}
+
+proc expect_blank { testname } {
+ expect {
+ -re "\\w" { fail "$testname" }
+ eof { pass "$testname" }
+ timeout { pass "$testname" }
+ }
+}
+
+proc expect_blank_continue { testname } {
+ expect {
+ -re "\\w" { fail "$testname" }
+ eof { }
+ timeout { pass "$testname (timeout)" }
+ }
+}
+
+proc expect_table { test match_header match_items match_footer } {
+ expect {
+ -re "$match_header" {
+ expect {
+ -re "$match_items" {
+ expect {
+ -re "$match_footer" { pass "$test" }
+ default { fail "$test (footer)" }
+ }
+ }
+ default { fail "$test (items)" }
+ }
+ }
+ default { fail "$test (header)" }
+ }
+}
+
+proc expect_table_dsc { test match_header match_item } {
+ expect {
+ -re $match_header {}
+ default {
+ fail "$test (header)"
+ return
+ }
+ }
+
+ set do_loop 1
+ set last_value 99999999
+ set found_item 0
+ while { $do_loop ==1 } {
+ expect {
+ -re $match_item {
+ set current_value $expect_out(1,string)
+ if { $current_value > $last_value } {
+ fail "$test (sorting $current_value > $last_value)"
+ return
+ } else {
+ set found_item 1
+ set last_value $current_value
+ }
+ }
+ default {
+ if { $found_item == 0 } {
+ fail "$test (items)"
+ } else {
+ pass $test
+ }
+ return
+ }
+ }
+ }
+ #expect {
+ # -re $match_footer { pass $test }
+ # default { fail "$test (footer)" }
+ #}
+}
+
+proc expect_spawn_retval { test retval } {
+ foreach {pid spawnid os_error_flag value} [wait] break
+
+ if {$value == $retval} {
+ return
+ }
+ fail "$test (exit value)"
+}
+
+proc make_pipeproc { } {
+ global pipeproc_pid pipeproc_spawnid topdir
+
+ set testproc_realpath "${topdir}/src/tests/test_process"
+
+ set pipeproc_pid [ spawn $testproc_realpath ]
+ set pipeproc_spawnid $spawn_id
+
+}
+proc make_testproc { } {
+ global testproc_path testproc_comm testproc_arg_str testproc1_pid testproc2_pid topdir
+
+ set testproc_realpath "${topdir}/src/tests/test_process"
+ set testproc_comm "spcorp"
+
+ set testproc_path [ exec mktemp -u ]
+ exec ln -s $testproc_realpath $testproc_path
+
+ spawn readlink $testproc_path
+ expect {
+ -re "^$testproc_realpath\\s*$" { }
+ timeout { perror "test proc does not link to test process" }
+ eof { perror "test proc does not link to test process" }
+ }
+
+ # make a process with the argument set to a fraction of ARG_MAX length
+ # but small enough we do not run TCL out of memory for regular expressions
+ # nor do we get argument list too long (104857 was found to work on Ubuntu 18.04)
+ set max_arg_len [ expr min([ exec /usr/bin/getconf ARG_MAX ], 104857) ]
+ # ensure we have enough slack to launch the test prog and pgrep
+ set reserved_space [expr max([ string length $testproc_path ], [ string length $topdir ] + 10)]
+ set testproc_arg_str "a"
+ set i $reserved_space
+ while {$i<$max_arg_len} {
+ incr i
+ append testproc_arg_str "a"
+ }
+ set testproc1_pid [ exec $testproc_path $testproc_arg_str & ]
+ set testproc2_pid [ exec $testproc_path & ]
+}
+
+proc make_testshm_proc { } {
+ global testshmproc_pid testshm_spawnid topdir shmid
+
+ set testshm_realpath "${topdir}/src/tests/test_shm"
+
+ set testshmproc_pid [ spawn $testshm_realpath ]
+ set testshmproc_spawnid $spawn_id
+ expect {
+ -i $testshmproc_spawnid
+ -re "^SHMID: (\[0-9a-f\]+)" { set shmid $expect_out(1,string) }
+ default { set shmid "" }
+ }
+
+}
+
+proc kill_testshm_proc { } {
+ global testshmproc_pid
+
+ kill_process $testshmproc_pid
+}
+
+proc kill_testproc { } {
+ global testproc_path testproc1_pid testproc2_pid
+
+ kill_process $testproc1_pid
+ kill_process $testproc2_pid
+ file delete $testproc_path
+}
+
+proc kill_pipeproc { } {
+ global pipeproc_pid
+ kill_process $pipeproc_pid
+}
+
+proc get_tty {} {
+ if { [catch { set raw_tty [ exec tty ] } msg]} {
+ warning "No TTY found"
+ return ""
+ }
+ regexp "/dev/(.+)" $raw_tty > tty
+ if { $tty == "tty" } {
+ warning "TTY is tty"
+ return ""
+ }
+
+ return $tty
+}
diff --git a/testsuite/free.test/free.exp b/testsuite/free.test/free.exp
new file mode 100644
index 0000000..d55fa53
--- /dev/null
+++ b/testsuite/free.test/free.exp
@@ -0,0 +1,61 @@
+#
+# Testsuite for free program
+#
+
+set free "${topdir}src/free"
+set meminfo [ exec cat /proc/meminfo ]
+regexp "MemTotal:\\s+\(\\d+\)" $meminfo -> memtotal_kb
+regexp "SwapTotal:\\s+\(\\d+\)" $meminfo -> swaptotal_kb
+
+set free_header "\\s+total\\s+used\\s+free\\s+shared\\s+buff\\/cache\\s+available\\s*"
+
+set test "free with no arguments"
+spawn $free
+expect_pass "$test" "^${free_header}Mem:\\s+${memtotal_kb}\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+${swaptotal_kb}\\s+\\d+\\s+\\d+\\s*"
+
+set test "free with -b argument"
+set memtotal [ expr { $memtotal_kb * 1024 } ]
+set swaptotal [ expr { $swaptotal_kb * 1024 } ]
+spawn $free -b
+expect_pass "$test" "^${free_header}Mem:\\s+${memtotal}\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+${swaptotal}\\s+\\d+\\s+\\d+\\s*"
+
+foreach {arg divisor } {-k 1024 -m 1048576 -g 1073741824 --kilo 1000 --mega 1000000 --giga 1000000000 } {
+ set test "free with $arg argument"
+ set memtest [ expr { $memtotal / $divisor } ]
+ set swaptest [ expr { $swaptotal / $divisor } ]
+ spawn $free $arg
+ expect_pass "$test" "^${free_header}Mem:\\s+$memtest\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+${swaptest}\\s+\\d+\\s+\\d+\\s*"
+}
+
+#set test "free with human readable output"
+#spawn $free -h
+#expect_pass "$test" "${free_header}Mem:\\s+\[0-9.\]+\[BKMGT\]\\s+\[0-9.\]+\[BKMGT\]\\s+\[0-9.\]+\[BKMGT\]\\s+\[0-9.\]+\[BKMGT\]\\s+\[0-9.\]+\[BKMGT\]\\s+\[0-9.\]+\[BKMGT\]\\s*-\\/\\+ buffers\\/cache:\\s+\[0-9.\]+\[BKMGT\]\\s+\[0-9.\]+\[BKMGT\]\\s*Swap:\\s+\[0-9.\]+\[BKMGT\]\\s+\[0-9.\]+\[BKMGT\]\\s+\[0-9.\]+\[BKMGT\]\\s*"
+
+set test "free with lo and hi memory statistics"
+spawn $free -l
+expect_pass "$test" "^${free_header}Mem:\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Low:\\s+\\d+\\s+\\d+\\s+\\d+\\s*High:\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+\\d+\\s+\\d+\\s+\\d+"
+
+set test "free with total"
+spawn $free -t
+expect_pass "$test" "^${free_header}Mem:\\s+${memtotal_kb}\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+${swaptotal_kb}\\s+\\d+\\s+\\d+\\s*Total:\\s+\\d+\\s+\\d+\\s+\\d+\\s*"
+
+set test "free with commit"
+spawn $free -v
+expect_pass "$test" "^${free_header}Mem:\\s+${memtotal_kb}\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+${swaptotal_kb}\\s+\\d+\\s+\\d+\\s*Comm:\\s+\\d+\\s+\\d+\\s+-?\\d+\\s*"
+
+set test "free with negative repeat count"
+spawn $free -c -2
+expect_pass "$test" "\(lt-\)\?free: failed to parse count argument: '-2': Numerical result out of range"
+
+set test "free with zero repeat count"
+spawn $free -c 0
+expect_pass "$test" "\(lt-\)\?free: failed to parse count argument: '0': Numerical result out of range"
+
+set test "free with positive repeat count"
+spawn $free -c 2
+expect_continue "$test" "^${free_header}"
+expect_pass "$test" "${free_header}"
+
+set test "free with single line"
+spawn $free -L
+expect_pass "$test" "^SwapUse\\s+\\d+\\s+CachUse\\s+\\d+\\s+MemUse\\s+\\d+\\s+MemFree\\s+\\d+\\s*$"
diff --git a/testsuite/kill.test/kill.exp b/testsuite/kill.test/kill.exp
new file mode 100644
index 0000000..49bac96
--- /dev/null
+++ b/testsuite/kill.test/kill.exp
@@ -0,0 +1,65 @@
+#
+# Dejagnu testsuite for kill - part of procps
+#
+set kill ${topdir}src/kill
+
+if { ![ file exists $kill ] } {
+ untested { skipping (not build)}
+ return
+}
+
+set test "kill with no arguments"
+spawn $kill
+expect_pass "$test" "Usage:\\s+\(lt-\)?kill \\\[options\\\] <pid>"
+
+set test "kill list signal names"
+spawn $kill -l
+expect_pass "$test" "^\(\[A-Z12+-\]\\s*\)+$"
+
+set test "kill list signal names in table"
+spawn $kill -L
+expect_pass "$test" "^\(\\s+\\d+ \[A-Z12+-\]+\)+\\s*$"
+
+set test "kill convert signal name to number no space"
+spawn $kill -lHUP
+expect_pass "$test" "^1\\s*"
+
+set test "kill convert signal name to number with space"
+spawn $kill -l HUP
+expect_pass "$test" "^1\\s*"
+
+set test "kill convert SIG-prefixed signal name to number no space"
+spawn $kill -lSIGHUP
+expect_pass "$test" "^1\\s*$"
+
+set test "kill convert SIG-prefixed signal name to number with space"
+spawn $kill -l SIGHUP
+
+expect_pass "$test" "^1\\s*$"
+
+set test "kill convert signal number to name no space"
+spawn $kill -l1
+expect_pass "$test" "^HUP\\s*"
+
+set test "kill convert signal number to name with space"
+spawn $kill -l 1
+expect_pass "$test" "^HUP\\s*"
+
+make_pipeproc
+
+set test "kill with SIGUSR1"
+spawn $kill -USR1 $pipeproc_pid
+expect_blank_continue "$test"
+expect_pipeproc_pass "$test" "SIG SIGUSR1"
+
+set test "kill with long SIGUSR2"
+spawn $kill -s SIGUSR2 $pipeproc_pid
+expect_blank_continue "$test"
+expect_pipeproc_pass "$test" "SIG SIGUSR2"
+
+set test "kill with queued int"
+spawn $kill -USR1 -q 42 $pipeproc_pid
+expect_blank_continue "$test"
+expect_pipeproc_pass "$test" "SIG SIGUSR1 value=42"
+
+kill_pipeproc
diff --git a/testsuite/lib.test/fileutils.exp b/testsuite/lib.test/fileutils.exp
new file mode 100644
index 0000000..3eaf654
--- /dev/null
+++ b/testsuite/lib.test/fileutils.exp
@@ -0,0 +1,19 @@
+#
+# Testsuite for lib/fileutils program
+#
+
+set noarg "${topdir}src/tests/test_fileutils"
+
+set test "without argument"
+spawn $noarg
+expect_pass "$test" "Hello, World!"
+
+set badfd "${srcdir}/lib.test/fileutils_badfd.sh"
+set test "test bad file descriptor"
+spawn $badfd
+expect_pass "$test" "test_fileutils: write error: Bad file descriptor"
+
+set full "${srcdir}/lib.test/fileutils_full.sh"
+set test "test no space left on device"
+spawn $full
+expect_pass "$test" "test_fileutils: write error: No space left on device"
diff --git a/testsuite/lib.test/fileutils_badfd.sh b/testsuite/lib.test/fileutils_badfd.sh
new file mode 100755
index 0000000..12c5b83
--- /dev/null
+++ b/testsuite/lib.test/fileutils_badfd.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+${PWD}/../src/tests/test_fileutils >&-
diff --git a/testsuite/lib.test/fileutils_full.sh b/testsuite/lib.test/fileutils_full.sh
new file mode 100755
index 0000000..ea9b55a
--- /dev/null
+++ b/testsuite/lib.test/fileutils_full.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+${PWD}/../src/tests/test_fileutils > /dev/full
diff --git a/testsuite/lib.test/strutils.exp b/testsuite/lib.test/strutils.exp
new file mode 100644
index 0000000..72d1fcd
--- /dev/null
+++ b/testsuite/lib.test/strutils.exp
@@ -0,0 +1,25 @@
+#
+# Testsuite for lib/strutils program
+#
+
+set teststr "${topdir}src/tests/test_strutils"
+
+set test "without argument"
+spawn $teststr
+expect_pass "$test" "test_strutils: no arguments"
+
+set test "test long"
+spawn $teststr 1
+expect_pass "$test" "1"
+
+set test "test long fail"
+spawn $teststr fail
+expect_pass "$test" "test_strutils: strtol_or_err: \'fail\'"
+
+set test "test double"
+spawn $teststr dummy 1.1
+expect_pass "$test" "1.100000"
+
+set test "test double fail"
+spawn $teststr dummy fail
+expect_pass "$test" "test_strutils: strtod_or_err: \'fail\'"
diff --git a/testsuite/pgrep.test/pgrep.exp b/testsuite/pgrep.test/pgrep.exp
new file mode 100644
index 0000000..0c4836f
--- /dev/null
+++ b/testsuite/pgrep.test/pgrep.exp
@@ -0,0 +1,131 @@
+#
+# Dejagnu tests for pgrep - part of procps
+#
+set mypid [pid]
+set not_ppid [ expr { $mypid + 1 } ]
+set pgrep "${topdir}src/pgrep"
+set uid [ exec id -u ]
+set not_uid [ expr { $uid + 1 } ]
+set gid [ exec id -g ]
+set not_gid [ expr { $gid + 1 } ]
+set ps "${topdir}src/ps/pscommand"
+set tty [ get_tty ]
+
+set test "pgprep with no arguments"
+spawn $pgrep
+expect_pass "$test" "^\(lt-\)\?pgrep: no matching criteria specified\\s*"
+
+make_testproc
+
+set testproc_len [ string length $testproc_comm ]
+set testproc_trim [ string range $testproc_comm 0 [ expr { $testproc_len - 2 } ] ]
+set testproc1_sid [ string trim [ exec $ps --no-headers -o sid $testproc1_pid ] ]
+set not_testproc1_sid [ expr { $testproc1_sid + 1 } ]
+
+set test "pgrep find both test pids"
+spawn $pgrep $testproc_comm
+expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+
+# In Debian only
+set test "pgrep counts 2 test pids"
+spawn $pgrep -c $testproc_comm
+expect_pass "$test" "^2\\s*"
+
+set test "pgrep with : delimiter"
+spawn $pgrep -d : $testproc_comm
+expect_pass "$test" "^${testproc1_pid}:${testproc2_pid}\\s*$"
+
+set test "pgrep match against full process name"
+spawn $pgrep -f "$testproc_path\\s+$testproc_arg_str"
+expect_pass "$test" "^$testproc1_pid\\s*$"
+
+set test "pgrep with matching gid"
+spawn $pgrep -G $gid $testproc_comm
+expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+
+set test "pgrep with not matching gid"
+spawn $pgrep -G $not_gid $testproc_comm
+expect_blank $test
+
+set test "pgrep with process name"
+spawn $pgrep -l $testproc_comm
+expect_pass "$test" "^$testproc1_pid\\s+$testproc_comm\\s+$testproc2_pid\\s+$testproc_comm\\s*$"
+
+set test "pgrep with full command line"
+spawn $pgrep -af "$testproc_path$"
+expect_pass "$test" "^$testproc2_pid\\s+$testproc_path\\s*$"
+
+set test "pgrep find newest test pid"
+spawn $pgrep -n $testproc_comm
+expect_pass "$test" "^$testproc2_pid\\s*$"
+
+set test "pgrep find oldest test pid"
+spawn $pgrep -o $testproc_comm
+expect_pass "$test" "^$testproc1_pid\\s*$"
+
+set test "pgrep matches with parent pid"
+spawn $pgrep -P $mypid $testproc_comm
+expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+
+set test "pgrep doesn't match with bogus parent pid"
+spawn $pgrep -P $not_ppid $testproc_comm
+expect_blank "$test"
+
+set test "pgrep matches with its own sid"
+spawn $pgrep -s $testproc1_sid $testproc_comm
+expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+
+set test "pgrep doesn't match with bogus sid"
+spawn $pgrep -s $not_testproc1_sid $testproc_comm
+expect_blank "$test"
+
+set test1 "pgrep matches on tty"
+set test2 "pgrep doesn't match on tty and wrong runstate"
+if { $tty == "" } {
+ untested "$test1"
+ untested "$test2"
+} else {
+ spawn $pgrep -t $tty $testproc_comm
+ expect_pass "$test1" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+ spawn $pgrep -t $tty -r D $testproc_comm
+ expect_blank "$test2"
+}
+
+set test "pgrep doesn't match with bogus tty"
+spawn $pgrep -t glass $testproc_comm
+expect_blank "$test"
+
+set test "pgrep with matching euid"
+spawn $pgrep -u $uid $testproc_comm
+expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+
+set test "pgrep with not matching euid"
+spawn $pgrep -u $not_uid $testproc_comm
+expect_blank $test
+
+set test "pgrep with matching uid"
+spawn $pgrep -U $uid $testproc_comm
+expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+
+set test "pgrep with not matching uid"
+spawn $pgrep -U $not_uid $testproc_comm
+expect_blank $test
+
+set test "pgrep matches on substring"
+spawn $pgrep $testproc_trim
+expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+
+set test "pgrep matches full string with exact"
+spawn $pgrep -x $testproc_comm
+expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+
+set test "pgrep does not match substring with exact"
+spawn $pgrep -x $testproc_trim
+expect_blank $test
+
+set test "pgrep with long non-matching pattern gives warning"
+spawn $pgrep gnome-session-bi
+expect_pass "$test" "pattern that searches for process name longer than 15 characters will result in zero matches"
+
+# Cleanup
+kill_testproc
diff --git a/testsuite/pkill.test/pkill.exp b/testsuite/pkill.test/pkill.exp
new file mode 100644
index 0000000..a88d882
--- /dev/null
+++ b/testsuite/pkill.test/pkill.exp
@@ -0,0 +1,51 @@
+#
+# Dejagnu tests for pkill - part of procps
+#
+set mypid [pid]
+set not_ppid [ expr { $mypid + 1 } ]
+set pkill "${topdir}src/pkill"
+set uid [ exec id -u ]
+set not_uid [ expr { $uid + 1 } ]
+set gid [ exec id -g ]
+set not_gid [ expr { $gid + 1 } ]
+set ps "${topdir}src/ps/pscommand"
+set tty [ get_tty ]
+
+set test "pkill with no arguments"
+spawn $pkill
+expect_pass "$test" "^\(lt-\)\?pkill: no matching criteria specified\\s*"
+
+make_testproc
+set testproc_len [ string length $testproc_comm ]
+set testproc_trim [ string range $testproc_comm 0 [ expr { $testproc_len - 2 } ] ]
+
+set test "pkill find both test pids"
+spawn $pkill -0 -e $testproc_comm
+expect_pass "$test" "^$testproc_comm killed \\(pid $testproc1_pid\\)\\s+$testproc_comm killed \\(pid $testproc2_pid\\)\\s*$"
+
+set test "pkill signal option order"
+spawn $pkill -e $testproc_comm -0
+expect_pass "$test" "^$testproc_comm killed \\(pid $testproc1_pid\\)\\s+$testproc_comm killed \\(pid $testproc2_pid\\)\\s*$"
+
+set test "pkill with trailing garbage on int signal"
+spawn $pkill -0garbage $testproc_comm
+expect_pass "$test" "invalid option -- '0'"
+
+# Cleanup
+kill_testproc
+
+make_pipeproc
+
+set test "pkill with SIGUSR1"
+spawn $pkill -USR1 -e $testproc_comm
+expect_pipeproc_pass "$test" "SIG SIGUSR1"
+
+set test "pkill with SIGUSR2"
+spawn $pkill -USR2 -e $testproc_comm
+expect_pipeproc_pass "$test" "SIG SIGUSR2"
+
+set test "pkill with queued int"
+spawn $pkill -USR1 -e -q 42 $testproc_comm
+expect_pipeproc_pass "$test" "SIG SIGUSR1 value=42"
+
+kill_pipeproc
diff --git a/testsuite/pmap.test/pmap.exp b/testsuite/pmap.test/pmap.exp
new file mode 100644
index 0000000..8d9ff1a
--- /dev/null
+++ b/testsuite/pmap.test/pmap.exp
@@ -0,0 +1,106 @@
+#
+# Dejagnu tests for pgrep - part of procps
+#
+set pmap "${topdir}src/pmap"
+set mypid [pid]
+
+set pmap_procname "${mypid}:\\s+\\S+\[^\\r\]+\\s+"
+set pmap_initname "1:\\s+\\S+\[^\\r\]+\\s+"
+set pmap_std_header $pmap_procname
+set pmap_device_header "${pmap_procname}Address\\s+Kbytes\\s+Mode\\s+Offset\\s+Device\\s+Mapping\\s+"
+set pmap_ext_header "${pmap_procname}Address\\s+Kbytes\\s+RSS\\s+Dirty\\s+Mode\\s+Mapping\\s+"
+set pmap_generic_header "${pmap_procname}\\s+\(?:\[A-Z\]\[a-z\]+ +\)+"
+
+set pmap_std_items "\(\[0-9a-f\]+\\s+\\d+K \[rwx-\]{5}\\s+\\S+\[^\\r\]+\\s*\)+"
+set pmap_device_items "\(\[0-9a-f\]+\\s+\\d+ \[rwx-\]{5}\\s+\[0-9a-f\]+\\s+\[0-9a-f\]{3}:\[0-9a-f\]{5}\\s+\\S+\[^\\r\]+\\s*\)+"
+set pmap_ext_items "\(\[0-9a-f\]+\\s+\\d+\\s+\\d+\\s+\\d+ \[rwx-\]{5}\\s+\\S+\[^\\r\]+\\s*\)+"
+
+set pmap_std_footer "total\\s+\\d+K\\s*\$"
+set pmap_device_footer "mapped:\\s+\\d+K\\s+writeable\/private:\\s+\\d+K\\s+shared:\\s+\\d+K\\s*\$"
+set pmap_ext_footer "\[ -\]+\\s+total kB\\s+\\d+(\\s+\[\\d-\]+){2,3}\\s*\$"
+
+set test "pmap with no arguments"
+spawn $pmap
+#expect_pass "$test" "^\(lt-\)\?pmap: argument missing"
+expect_pass "$test" "Usage:\\s+\(lt-\)?pmap \\\[options\\\] PID \\\[PID \.\.\.\\\]"
+
+set test "pmap standard output"
+spawn $pmap $mypid
+expect_table $test $pmap_std_header $pmap_std_items $pmap_std_footer
+
+set test "pmap standard output with quiet"
+spawn $pmap -q $mypid
+expect_table $test $pmap_procname $pmap_std_items "\$"
+
+set test "pmap device output"
+spawn $pmap -d $mypid
+expect_table $test $pmap_device_header $pmap_device_items $pmap_device_footer
+
+
+set test "pmap device output quiet (dq)"
+spawn $pmap -dq $mypid
+expect_table $test $pmap_procname $pmap_device_items "\$"
+
+set test "pmap device output quiet (qd)"
+spawn $pmap -qd $mypid
+expect_table $test $pmap_procname $pmap_device_items "\$"
+
+if { [ file readable "/proc/self/smaps" ] == 0 } {
+ unsupported "Skipping test which require pmap to access /proc/<pid>/smaps, because kernel seems to be compiled without CONFIG_PROC_PAGE_MONITOR."
+} else {
+ set test "pmap extended output"
+ spawn $pmap -x $mypid
+ expect_table $test $pmap_ext_header $pmap_ext_items $pmap_ext_footer
+
+ # -X and -XX have no real format as its dependent on smaps
+ set test "pmap extra extended output"
+ spawn $pmap -X $mypid
+ expect_table $test $pmap_generic_header "\[^=\]+" "\[= \]+"
+
+ set test "pmap double extra extended output"
+ spawn $pmap -XX $mypid
+ expect_table $test $pmap_generic_header "\[^=\]+" "\[= \]+"
+
+ set test "pmap X with unreachable process"
+ spawn $pmap -X 1
+ expect_pass $test "$pmap_initname\$"
+
+ set test "pmap XX with unreachable process"
+ spawn $pmap -XX 1
+ expect_pass $test "$pmap_initname\$"
+}
+
+
+proc expect_twice_total { test } {
+ set totkb 0
+ expect {
+ -re "\r\n\\s+(\\d+)\[0-9 \]*KB" {
+ set totkb $expect_out(1,string)
+ expect {
+ -re "\r\n\\s+$totkb\[0-9 \]*KB" { pass "$test" }
+ eof { fail "$test" }
+ timeout { fail "$test" }
+ }
+ }
+ eof { fail "$test" }
+ timeout { fail "$test" }
+ }
+}
+
+set test "pmap X pid pid has same total"
+spawn $pmap -X $mypid $mypid
+expect_twice_total "$test"
+
+set test "pmap XX pid pid has same total"
+spawn $pmap -XX $mypid $mypid
+expect_twice_total "$test"
+
+set test "pmap finding shm"
+make_testshm_proc
+if { $shmid == "" } {
+ unsupported "$test - could not start test_shm"
+} else {
+ spawn $pmap $testshmproc_pid
+ expect_pass $test "\[ shmid=0x$shmid \]"
+}
+kill_testshm_proc
diff --git a/testsuite/ps.test/ps_output.exp b/testsuite/ps.test/ps_output.exp
new file mode 100644
index 0000000..ff2a233
--- /dev/null
+++ b/testsuite/ps.test/ps_output.exp
@@ -0,0 +1,63 @@
+#
+# Dejagnu tests for ps (output options) - part of procps
+#
+set ps ${topdir}src/ps/pscommand
+
+set mypid [pid]
+set not_ppid [ expr { $mypid + 1 } ]
+set uid [ exec id -u ]
+set not_uid [ expr { $uid + 1 } ]
+set gid [ exec id -g ]
+set not_gid [ expr { $gid + 1 } ]
+
+# All the fields
+# Cannot do args,cmd,comm
+set ps_digit "\\d+\\s*"
+set ps_state "\[A-Z<sl+\]\\s*"
+#set ps_pct "\\d{1,2}\\.\\d\\s*"
+set ps_pct "\\d"
+set ps_hex "\[0-9a-f\]\\s*"
+set ps_time "\\d{1,3}:\\d{2}\\s*"
+set ps_time "\(\d+-\)?\\\d{1,3}:\\d{2}\\s*"
+set ps_class "\[A-Z?-\]\\s*"
+
+set flag_match {
+ "%cpu,pcpu,%mem,pmem" "%CPU\\s+%CPU\\s+%MEM\\s+%MEM\\s+\(\(\\d+\.\\d+\\s*\){4}\)+$"
+ "blocked,sig_block,sigmask,caught,sigcatch,sig_catch" "\(BLOCKED\\s+\){3}\(CAUGHT\\s+\){2}CATCHED\\s+\(<?\[0-9a-f\]+\\s*\)+$"
+ "bsdstart,start,lstart" "\\s*START\\s+STARTED\\s+STARTED\\s+\(\\s*\(\[A-Z\]\[a-z\]{2} \\d+|\\d+:\\d{2}\)\\s+\(\[A-Z\]\[a-z\]{2} \\d+|\\d+:\\d{2}:\\d{2}\)\\s+\[A-Z\]\[a-z\]{2} \[A-Z\]\[a-z\]{2}\\s+\\d+ \\d{2}:\\d{2}:\\d{2} \\d{4}\\s*\)+$"
+ "bsdtime,cputime,etime,etimes" "\\s*TIME\\s+TIME\\s+ELAPSED\\s+ELAPSED\\s*\(\\s*\\d+:\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}\\s+\(\\d{2}:\)?\\d{2}:\\d{2}\\s+\\d+\\s*\)+$"
+ "user,ruser,group,rgroup,uid,ruid,gid,rgid" "\\s*USER\\s+RUSER\\s+GROUP\\s+RGROUP\\s+UID\\s+RUID\\s+GID\\s+RGID\\s+\(\(\\s*\[A-Za-z0-9_+-\]+\\s+\){4}\(\\d+\\s+\){4}\\s*\)+$"
+ "cputimes,times" "\\s*TIME\\s+TIME\\s+\\d+\\s+\\d+\\s*"
+}
+
+foreach { flag match } $flag_match {
+ set test "ps with output flag $flag"
+ spawn $ps -o $flag
+ expect_pass "$test" $match
+}
+
+set test "ps with correct AIX field"
+spawn $ps -o "%p"
+expect_pass "$test" "\\s*PID\\s+\(\\s*\\d+\\s+\)+$"
+
+set test "ps with improper AIX field"
+spawn $ps -o "%p %G{"
+expect_pass "$test" "error: improper AIX field descriptor"
+
+set test "ps with missing AIX field"
+spawn $ps -o "%p %%a"
+expect_pass "$test" "error: missing AIX field descriptor"
+
+set test "ps with unknown AIX field"
+spawn $ps -o "%p %Z"
+expect_pass "$test" "error: unknown AIX field descriptor"
+
+make_testproc
+set test "ps with c option"
+spawn $ps co command $testproc1_pid
+expect_pass "$test" "^COMMAND\\s+spcorp\\s*$"
+kill_testproc
+
+set test "ps with l and m options"
+spawn $ps -lm
+expect_fail "$test" "please report this bug"
diff --git a/testsuite/ps.test/ps_personality.exp b/testsuite/ps.test/ps_personality.exp
new file mode 100644
index 0000000..f873a19
--- /dev/null
+++ b/testsuite/ps.test/ps_personality.exp
@@ -0,0 +1,18 @@
+#
+# check the ps personalities
+#
+set ps ${topdir}src/ps/pscommand
+
+set pers_match {
+ bsd "\\s+PID\\s+TTY\\s+STAT\\s+TIME\\s+COMMAND\\r"
+ linux "\\s+PID\\s+TTY\\s+TIME\\s+CMD\\r"
+ old "\\s+PID\\s+TTY\\s+STAT\\s+TIME\\s+COMMAND\\r"
+ }
+
+foreach { pers match } $pers_match {
+ set test "ps with $pers personality"
+ set env(PS_PERSONALITY) $pers
+ spawn $ps
+ expect_pass "$test" $match
+}
+
diff --git a/testsuite/ps.test/ps_sched_batch.exp b/testsuite/ps.test/ps_sched_batch.exp
new file mode 100644
index 0000000..ff948db
--- /dev/null
+++ b/testsuite/ps.test/ps_sched_batch.exp
@@ -0,0 +1,11 @@
+#
+# check the ps SCHED_BATCH scheduler policy output
+#
+set ps "${topdir}src/ps/pscommand"
+set schedbatch "${topdir}testsuite/test-schedbatch"
+
+spawn $schedbatch 18
+
+set test "ps SCHED_BATCH scheduler"
+spawn $ps --no-header -o comm,cls,nice -a
+expect_pass "$test" "(?n)^test-schedbatch\\s+B\\s+18\\r?\$"
diff --git a/testsuite/ps.test/test-schedbatch.c b/testsuite/ps.test/test-schedbatch.c
new file mode 100644
index 0000000..9b4d334
--- /dev/null
+++ b/testsuite/ps.test/test-schedbatch.c
@@ -0,0 +1,46 @@
+/* test-schedbatch.c - Create a process using SCHED_BATCH scheduler
+ * policy and nice value.
+ * Compile: gcc -o test-schedbatch -Wall test-schedbatch.c
+ * Usage: ./test-schedbatch [ <NICE> ]
+ *
+ * Author: Mike Fleetwood
+ * https://bugzilla.redhat.com/show_bug.cgi?id=741090
+ */
+
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <sched.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+/* Defined in Linux headers only */
+#ifndef SCHED_BATCH
+#define SCHED_BATCH 3
+#endif
+
+int main(int argc, const char *argv[])
+{
+ int nice = 19;
+ struct sched_param sp;
+ char msg[50];
+
+ if (argc >= 2) {
+ nice = atoi(argv[1]);
+ }
+ sp.sched_priority = 0;
+#ifdef SCHED_BATCH
+ if (sched_setscheduler(0, SCHED_BATCH, &sp)) {
+ perror("sched_setscheduler(0,SCHED_BATCH,{.sched_priority=0}");
+ }
+#endif /* SCHED_BATCH */
+ if (setpriority(PRIO_PROCESS, 0, nice) || errno) {
+ (void)snprintf(msg, sizeof(msg),
+ "setpriority(PRIO_PROCESS, 0, %d)", nice);
+ perror(msg);
+ }
+ while (1) {
+ getchar();
+ }
+}
diff --git a/testsuite/pwdx.test/pwdx.exp b/testsuite/pwdx.test/pwdx.exp
new file mode 100644
index 0000000..2f71cbd
--- /dev/null
+++ b/testsuite/pwdx.test/pwdx.exp
@@ -0,0 +1,22 @@
+
+make_testproc
+
+set pwdx "${topdir}src/pwdx"
+# Run pwdx with no arguments
+set test "pwdx no args"
+spawn $pwdx
+expect_pass "$test" "^\\s*Usage:\\s+\(lt-\)\?pwdx \\\[options\\\] pid\.\.\."
+
+# Run pwdx with pid 0 which is invalid
+set test "pwdx pid 0 should be invalid"
+spawn $pwdx 0
+expect_pass "$test" "\(lt-\)\?pwdx\: invalid process id\: 0"
+
+# Run pwdx with existing pid
+set test "pwdx find test process cwd"
+set my_pwd [ pwd ]
+spawn $pwdx $testproc1_pid
+expect_pass "$test" "^$testproc1_pid: $my_pwd"
+
+# Cleanup
+kill_testproc
diff --git a/testsuite/slabtop.test/slabtop.exp b/testsuite/slabtop.test/slabtop.exp
new file mode 100644
index 0000000..2ef0336
--- /dev/null
+++ b/testsuite/slabtop.test/slabtop.exp
@@ -0,0 +1,45 @@
+#
+# Dehagnu testing for slabtop - part of procps
+#
+set slabtop ${topdir}src/slabtop
+
+set avst "Active / Total"
+set used "\\\(% used\\\)\\s+:"
+set pct "\\\(\\d+\\.\\d+%\\\)"
+
+set slabtop_header "^ $avst Objects $used \\d+ / \\d+ ${pct}\\s+$avst Slabs $used \\d+ / \\d+ ${pct}\\s+$avst Caches $used \\d+ / \\d+ ${pct}\\s+$avst Size $used \\d+\\.\\d+K / \\d+\\.\\d+K ${pct}\\s+Minimum / Average / Maximum Object : \\d+\\.\\d+K / \\d+\\.\\d+K / \\d+\\.\\d+K\\s+OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME\\s+"
+
+set test "slabtop help"
+spawn $slabtop --help
+expect_pass $test "^\\s+Usage:\\s+\(lt-\)\?slabtop \\\[options\\\]"
+
+set test "slabtop o then d options"
+spawn $slabtop -o -d 10
+expect_pass $test "Cannot combine -d and -o options"
+
+set test "slabtop d then o options"
+spawn $slabtop -d 10 -o
+expect_pass $test "Cannot combine -d and -o options"
+
+set sort_tests {
+ "a" "active objects" "^\\s*\\d+\\s+(\\d+)\\s+\\d+%\\s+\\d+\\.\\d+K\\s+\\d+\\s+\\d+\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
+ "b" "objects per slab" "^\\s*\\d+\\s+\\d+\\s+\\d+%\\s+\\d+\\.\\d+K\\s+\\d+\\s+(\\d+)\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
+ "c" "cache size" "^\\s*\\d+\\s+\\d+\\s+\\d+%\\s+\\d+\\.\\d+K\\s+\\d+\\s+\\d+\\s+(\\d+)K\\s+\\S\[^\r\]+\\s*"
+ "l" "number of slabs" "^\\s*\\d+\\s+\\d+\\s+\\d+%\\s+\\d+\\.\\d+K\\s+(\\d+)\\s+\\d+\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
+ "o" "object count" "^\\s*(\\d+)\\s+\\d+\\s+\\d+%\\s+\\d+\\.\\d+K\\s+\\d+\\s+\\d+\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
+ "s" "object size" "^\\s*\\d+\\s+\\d+\\s+\\d+%\\s+(\\d+\\.\\d+)K\\s+\\d+\\s+\\d+\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
+ "u" "utilisation" "^\\s*\\d+\\s+\\d+\\s+(\\d+)%\\s+\\d+\\.\\d+K\\s+\\d+\\s+\\d+\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
+ }
+
+# BEGIN - Tests requiring /proc/slabinfo
+if { [ file readable "/proc/slabinfo" ] == 0 } {
+ unsupported "slabtop tests disabled as /proc/slabinfo is unreadable"
+} else {
+
+foreach { flag desc match } $sort_tests {
+ set test "slabtop sorted by $desc"
+ spawn $slabtop -o -s $flag
+ expect_table_dsc $test $slabtop_header $match
+}
+}
+# END - Tests requiring /proc/slabinfo
diff --git a/testsuite/sysctl.test/sysctl_read.exp b/testsuite/sysctl.test/sysctl_read.exp
new file mode 100644
index 0000000..c55cd95
--- /dev/null
+++ b/testsuite/sysctl.test/sysctl_read.exp
@@ -0,0 +1,29 @@
+#
+# Dejagnu tests for sysctl (read only) - part of procps
+#
+set sysctl ${topdir}src/sysctl
+set hostname [ exec cat "/proc/sys/kernel/hostname" ]
+
+set test "sysctl with no arguments"
+spawn $sysctl
+expect_pass "$test" "^\\s+Usage:\\s+\(lt-\)?sysctl \\\[options\\\] \\\[variable\\\[=value\\\] \.\.\.\\\]"
+
+set test "sysctl reading a variable using slash delimiter"
+spawn $sysctl kernel/hostname
+expect_pass "$test" "kernel.hostname = ${hostname}"
+
+set test "sysctl reading a variable using dot delimiter"
+spawn $sysctl kernel.hostname
+expect_pass "$test" "kernel.hostname = ${hostname}"
+
+set test "sysctl reading a variable suppress key"
+spawn $sysctl -n kernel.hostname
+expect_pass "$test" "${hostname}"
+
+set test "sysctl reading a variable suppress value"
+spawn $sysctl -N kernel.hostname
+expect_pass "$test" "kernel.hostname"
+
+set test "sysctl reading using a path traversal"
+spawn $sysctl /../../etc/passwd
+expect_pass "$test" "sysctl: Path is not under /proc/sys/: /proc/sys//../../etc/passwd"
diff --git a/testsuite/uptime.test/uptime.exp b/testsuite/uptime.test/uptime.exp
new file mode 100644
index 0000000..4b0d28d
--- /dev/null
+++ b/testsuite/uptime.test/uptime.exp
@@ -0,0 +1,17 @@
+#
+# Dejagnu tests for uptime - part of procps
+#
+set uptime "${topdir}src/uptime"
+
+set test "uptime"
+spawn $uptime
+expect_pass "$test" "^\\s+\\d{2}:\\d{2}:\\d{2} up (\\d+ days?,)?\\s*\\d+( min|:\\d+), +\\d+ users?, +load average: \[0-9.\]+, \[0-9.\]+, \[0-9.\]+\\s*$"
+
+set test "uptime since option"
+spawn $uptime --since
+expect_pass "$test" "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\s*$"
+
+set test "uptime pretty option"
+spawn $uptime --pretty
+expect_pass "$test" "up (\\d+ decades?, )?(\\d+ years?, )?(\\d+ weeks?, )?(\\d+ days?, )?(\\d+ hours?, )?(\\d+ minutes?)\\s*$"
+
diff --git a/testsuite/vmstat.test/vmstat.exp b/testsuite/vmstat.test/vmstat.exp
new file mode 100644
index 0000000..48d0b0f
--- /dev/null
+++ b/testsuite/vmstat.test/vmstat.exp
@@ -0,0 +1,57 @@
+
+#
+# Dejagnu tests for vmstat - part of procps
+
+set vmstat "${topdir}src/vmstat"
+
+# Tests that need to see /proc/vmstat
+if { [ file readable "/proc/vmstat" ] == 0 } {
+ unsupported "vmstat with no arguments - /proc/vmstat is unreadable"
+ unsupported "vmstat with -a flag - /proc/vmstat is unreadable"
+ unsupported "vmstat fork option - /proc/vmstat is unreadable"
+} else {
+ set test "vmstat with no arguments"
+ spawn $vmstat
+ expect_pass "$test" "^procs\[ -\]+memory\[ -\]+swap\[ -\]+io\[ -\]+system\[ -\]+cpu\[ -\]+\\s*r\\s+b\\s+swpd\\s+free\\s+buff\\s+cache\\s+si\\s+so\\s+bi\\s+bo\\s+in\\s+cs us sy id wa st gu\\s*\(\\s+\\d+\){18}\\s*$"
+
+ set test "vmstat with -a flag"
+ spawn $vmstat -a
+ expect_pass "$test" "^procs\[ -\]+memory\[ -\]+swap\[ -\]+io\[ -\]+system\[ -\]+cpu\[ -\]+\\s*r\\s+b\\s+swpd\\s+free\\s+inact\\s+active\\s+si\\s+so\\s+bi\\s+bo\\s+in\\s+cs us sy id wa st gu\\s*\(\\s+\\d+\){18}\\s*$"
+
+ set test "vmstat fork option"
+ spawn $vmstat -f
+ expect_pass "$test" "^\\s+\\d+ forks\\s*$"
+}
+
+if { [ file readable "/proc/slabinfo" ] == 0 } {
+ unsupported "slabinfo (-m option) test disabled as /proc/slabinfo is unreadable"
+} else {
+set test "vmstat slabinfo (-m option)"
+spawn $vmstat -m
+expect_pass "$test" "^Cache\\s+Num\\s+Total\\s+Size\\s+Pages\\s+\(\\S+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*\){1,}"
+}
+
+set test "vmstat disk information (-d option)"
+if { [ file readable "/sys/block" ] == 0 } {
+ unsupported "$test /sys/block not readable"
+} else {
+ set fp [open /proc/diskstats ]
+ if { [ read $fp ] == "" } {
+ close $fp
+ unsupported "$test /proc/diskstats empty"
+ } else {
+ close $fp
+ spawn $vmstat -d
+ expect_pass "$test" "^disk\[ -\]+reads\[ -\]+writes\[ -\]+IO\[ -\]+\\s+total\\s+merged\\s+sectors\\s+ms\\s+total\\s+merged\\s+sectors\\s+ms\\s+cur\\s+sec\\s+"
+
+ # Need a partition
+ set diskstats [ exec cat /proc/diskstats ]
+ if [ regexp "\\s+\\d+\\s+\\d+\\s+\((?:hd|sd|vd)\[a-z\]\\d+\)\\s+\[0-9\]\[0-9\]+" $diskstats line partition == 1 ] {
+ set test "vmstat partition (using $partition)"
+ spawn $vmstat -p $partition
+ expect_pass "$test" "^${partition}\\s+reads"
+ } else {
+ unsupported "vmstat partition (cannot find partition)"
+ }
+ }
+}
diff --git a/testsuite/w.test/w.exp b/testsuite/w.test/w.exp
new file mode 100644
index 0000000..f0da803
--- /dev/null
+++ b/testsuite/w.test/w.exp
@@ -0,0 +1,59 @@
+#
+# Dejagnu tests for w - part of procps
+#
+# FIXME - the user lines only go to idle
+set w "${topdir}src/w"
+
+set w_uptime "\\s+\\d{2}:\\d{2}:\\d{2} up (\\d+ days?,)?\\s*\\d+( min|:\\d+), +\\d+ users?, +load average: \[0-9.\]+, \[0-9.\]+, \[0-9.\]+\\s+"
+set w_std_header "${w_uptime}USER\\s+TTY\\s+LOGIN@\\s+IDLE\\s+JCPU\\s+PCPU\\s+WHAT\\s+"
+set w_short_header "${w_uptime}USER\\s+TTY\\s+IDLE\\s+WHAT\\s+"
+set w_from_header "${w_uptime}USER\\s+TTY\\s+FROM\\s+LOGIN@\\s+IDLE\\s+JCPU\\s+PCPU\\s+WHAT\\s+"
+set w_fromshort_header "${w_uptime}USER\\s+TTY\\s+FROM\\s+IDLE\\s+WHAT\\s+"
+
+set w_user "\[A-Za-z0-9_-\]+"
+set w_tty "\[a-z0-9/]+"
+set w_from "\[A-Za-z0-9.:-\]*"
+set w_login "\(\\d+\[A-Z\]\[a-z\]{2}\\d+\|\[A-Z\]\[a-z\]{2}\\d+\|\\d+:\\d+\)"
+set w_idle "\(\\?xdm\\?\|\\?\|\\d+days\|\\d+:\\d+m?\|\\d+.\\d+s\)"
+set w_ival7 "\(\\?\|\\d+days\|\\d+:\\d+m?\|\\d+.\\d+s\)"
+set w_what "\[A-Za-z0-9_\/\\-\]+"
+set w_pids "\\d+/\\d+"
+set w_std_userlines "\(${w_user}\\s+${w_tty}\\s+${w_login}\\s+${w_idle}\\s+${w_ival7}\\s+${w_ival7}\\s+${w_what}\\s*\)*"
+set w_short_userlines "\(${w_user}\\s+${w_tty}\\s+${w_idle}\\s+${w_what}\\s*\)*"
+set w_from_userlines "\(${w_user}\\s+${w_tty}\\s+${w_from}\\s+${w_login}\\s+${w_idle}\\s+${w_ival7}\\s+${w_ival7}\\s+${w_what}\\s*\)*"
+set w_fromshort_userlines "\(${w_user}\\s+${w_tty}\\s+${w_from}\\s+${w_idle}\\s+${w_what}\\s*\)*"
+set w_pid_userlines "\(${w_user}\\s+${w_tty}\\s+${w_idle}\\s+%{w_pids}\s+${w_what}\\s*\)*"
+
+set test "w with no arguments"
+spawn $w
+expect_pass "$test" "^${w_std_header}${w_std_userlines}"
+
+
+set test "w with no headers"
+spawn $w -h
+expect_pass "$test" "^${w_std_userlines}"
+
+set test "w with -u flag"
+spawn $w -u
+expect_pass "$test" "^${w_std_header}${w_std_userlines}"
+
+set test "w with short output"
+spawn $w -s
+expect_pass "$test" "^${w_short_header}${w_short_userlines}"
+
+set test "w with from flag"
+spawn $w -f
+expect_pass "$test" "^${w_from_header}${w_from_userlines}"
+
+set test "w with from and short flags"
+spawn $w -fs
+expect_pass "$test" "^${w_fromshort_header}${w_fromshort_userlines}"
+
+set test "w with short and from flags"
+spawn $w -sf
+expect_pass "$test" "^${w_fromshort_header}${w_fromshort_userlines}"
+
+set test "w with pids display"
+spawn $w -p
+expect_pass "$test" "^${w_std_header}${w_pid_userlines}"
+