Imported Upstream version 1.4.5
This commit is contained in:
parent
62d1e7d5fe
commit
6a280f6f24
412 changed files with 168642 additions and 0 deletions
28
lib/tests/Makefile.am
Normal file
28
lib/tests/Makefile.am
Normal file
|
@ -0,0 +1,28 @@
|
|||
|
||||
noinst_PROGRAMS = @EXTRA_TEST@
|
||||
|
||||
# These two lines support "make check", but we use "make test"
|
||||
TESTS = @EXTRA_TEST@
|
||||
check_PROGRAMS = @EXTRA_TEST@
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
|
||||
|
||||
EXTRA_PROGRAMS = test_utils test_disk
|
||||
|
||||
EXTRA_DIST = test_utils.t test_disk.t
|
||||
|
||||
LIBS = @LIBINTL@
|
||||
|
||||
test_utils_SOURCES = test_utils.c
|
||||
test_utils_CFLAGS = -g -I..
|
||||
test_utils_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_utils_LDADD = ../utils_base.o
|
||||
|
||||
test_disk_SOURCES = test_disk.c
|
||||
test_disk_CFLAGS = -g -I..
|
||||
test_disk_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_disk_LDADD = ../utils_disk.o
|
||||
|
||||
test: ${noinst_PROGRAMS}
|
||||
perl -MTest::Harness -e '$$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)
|
||||
|
651
lib/tests/Makefile.in
Normal file
651
lib/tests/Makefile.in
Normal file
|
@ -0,0 +1,651 @@
|
|||
# Makefile.in generated by automake 1.9.4 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004 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@
|
||||
|
||||
SOURCES = $(test_disk_SOURCES) $(test_utils_SOURCES)
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ../..
|
||||
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 = @EXTRA_TEST@
|
||||
check_PROGRAMS = @EXTRA_TEST@
|
||||
EXTRA_PROGRAMS = test_utils$(EXEEXT) test_disk$(EXEEXT)
|
||||
subdir = lib/tests
|
||||
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/afs.m4 \
|
||||
$(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/basename.m4 \
|
||||
$(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/codeset.m4 \
|
||||
$(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/exitfail.m4 \
|
||||
$(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fcntl-safer.m4 \
|
||||
$(top_srcdir)/m4/fstypename.m4 $(top_srcdir)/m4/fsusage.m4 \
|
||||
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/inttypes_h.m4 \
|
||||
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
|
||||
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/ls-mntd-fs.m4 \
|
||||
$(top_srcdir)/m4/mountlist.m4 $(top_srcdir)/m4/nls.m4 \
|
||||
$(top_srcdir)/m4/np_coreutils.m4 $(top_srcdir)/m4/np_curl.m4 \
|
||||
$(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/regex.m4 \
|
||||
$(top_srcdir)/m4/restrict.m4 $(top_srcdir)/m4/stdbool.m4 \
|
||||
$(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/uintmax_t.m4 \
|
||||
$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/unistd-safer.m4 \
|
||||
$(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/xalloc.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_test_disk_OBJECTS = test_disk-test_disk.$(OBJEXT)
|
||||
test_disk_OBJECTS = $(am_test_disk_OBJECTS)
|
||||
test_disk_DEPENDENCIES = ../utils_disk.o
|
||||
am_test_utils_OBJECTS = test_utils-test_utils.$(OBJEXT)
|
||||
test_utils_OBJECTS = $(am_test_utils_OBJECTS)
|
||||
test_utils_DEPENDENCIES = ../utils_base.o
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(test_disk_SOURCES) $(test_utils_SOURCES)
|
||||
DIST_SOURCES = $(test_disk_SOURCES) $(test_utils_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
INSTALL = @INSTALL@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_H = @ALLOCA_H@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BASENAME = @BASENAME@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DEPLIBS = @DEPLIBS@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTRAS = @EXTRAS@
|
||||
EXTRAS_ROOT = @EXTRAS_ROOT@
|
||||
EXTRA_NETOBJS = @EXTRA_NETOBJS@
|
||||
EXTRA_TEST = @EXTRA_TEST@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
|
||||
GETOPT_H = @GETOPT_H@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
HAVE__BOOL = @HAVE__BOOL@
|
||||
HOSTNAME = @HOSTNAME@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
|
||||
KMEM_GROUP = @KMEM_GROUP@
|
||||
KRBINCLUDE = @KRBINCLUDE@
|
||||
LDAPINCLUDE = @LDAPINCLUDE@
|
||||
LDAPLIBS = @LDAPLIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBINTL@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MATHLIBS = @MATHLIBS@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
MYSQLCFLAGS = @MYSQLCFLAGS@
|
||||
MYSQLCONFIG = @MYSQLCONFIG@
|
||||
MYSQLINCLUDE = @MYSQLINCLUDE@
|
||||
MYSQLLIBS = @MYSQLLIBS@
|
||||
NEED_SETGID = @NEED_SETGID@
|
||||
NEED_VA_LIST = @NEED_VA_LIST@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PATH_TO_APTGET = @PATH_TO_APTGET@
|
||||
PATH_TO_DIG = @PATH_TO_DIG@
|
||||
PATH_TO_FPING = @PATH_TO_FPING@
|
||||
PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
|
||||
PATH_TO_LSPS = @PATH_TO_LSPS@
|
||||
PATH_TO_MAILQ = @PATH_TO_MAILQ@
|
||||
PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
|
||||
PATH_TO_PING = @PATH_TO_PING@
|
||||
PATH_TO_PING6 = @PATH_TO_PING6@
|
||||
PATH_TO_PS = @PATH_TO_PS@
|
||||
PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
|
||||
PATH_TO_QSTAT = @PATH_TO_QSTAT@
|
||||
PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
|
||||
PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
|
||||
PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
|
||||
PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
|
||||
PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
|
||||
PATH_TO_SSH = @PATH_TO_SSH@
|
||||
PATH_TO_SWAP = @PATH_TO_SWAP@
|
||||
PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
|
||||
PATH_TO_UPTIME = @PATH_TO_UPTIME@
|
||||
PATH_TO_WHO = @PATH_TO_WHO@
|
||||
PERL = @PERL@
|
||||
PGINCLUDE = @PGINCLUDE@
|
||||
PGLIBS = @PGLIBS@
|
||||
PKG_ARCH = @PKG_ARCH@
|
||||
PLUGIN_TEST = @PLUGIN_TEST@
|
||||
POSUB = @POSUB@
|
||||
POW_LIB = @POW_LIB@
|
||||
PYTHON = @PYTHON@
|
||||
RADIUSLIBS = @RADIUSLIBS@
|
||||
RANLIB = @RANLIB@
|
||||
RELEASE = @RELEASE@
|
||||
REV_DATESTAMP = @REV_DATESTAMP@
|
||||
REV_TIMESTAMP = @REV_TIMESTAMP@
|
||||
SCRIPT_TEST = @SCRIPT_TEST@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SH = @SH@
|
||||
SHELL = @SHELL@
|
||||
SOCKETLIBS = @SOCKETLIBS@
|
||||
SSLINCLUDE = @SSLINCLUDE@
|
||||
SSLLIBS = @SSLLIBS@
|
||||
STDBOOL_H = @STDBOOL_H@
|
||||
STRIP = @STRIP@
|
||||
SUPPORT = @SUPPORT@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WARRANTY = @WARRANTY@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
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@
|
||||
check_tcp_ssl = @check_tcp_ssl@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
with_trusted_path = @with_trusted_path@
|
||||
|
||||
# These two lines support "make check", but we use "make test"
|
||||
TESTS = @EXTRA_TEST@
|
||||
INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
|
||||
EXTRA_DIST = test_utils.t test_disk.t
|
||||
test_utils_SOURCES = test_utils.c
|
||||
test_utils_CFLAGS = -g -I..
|
||||
test_utils_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_utils_LDADD = ../utils_base.o
|
||||
test_disk_SOURCES = test_disk.c
|
||||
test_disk_CFLAGS = -g -I..
|
||||
test_disk_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_disk_LDADD = ../utils_disk.o
|
||||
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 \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/tests/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu lib/tests/Makefile
|
||||
.PRECIOUS: 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__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
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
|
||||
|
||||
clean-checkPROGRAMS:
|
||||
@list='$(check_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
test_disk$(EXEEXT): $(test_disk_OBJECTS) $(test_disk_DEPENDENCIES)
|
||||
@rm -f test_disk$(EXEEXT)
|
||||
$(LINK) $(test_disk_LDFLAGS) $(test_disk_OBJECTS) $(test_disk_LDADD) $(LIBS)
|
||||
test_utils$(EXEEXT): $(test_utils_OBJECTS) $(test_utils_DEPENDENCIES)
|
||||
@rm -f test_utils$(EXEEXT)
|
||||
$(LINK) $(test_utils_LDFLAGS) $(test_utils_OBJECTS) $(test_utils_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_disk-test_disk.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utils-test_utils.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
test_disk-test_disk.o: test_disk.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_disk_CFLAGS) $(CFLAGS) -MT test_disk-test_disk.o -MD -MP -MF "$(DEPDIR)/test_disk-test_disk.Tpo" -c -o test_disk-test_disk.o `test -f 'test_disk.c' || echo '$(srcdir)/'`test_disk.c; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_disk-test_disk.Tpo" "$(DEPDIR)/test_disk-test_disk.Po"; else rm -f "$(DEPDIR)/test_disk-test_disk.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_disk.c' object='test_disk-test_disk.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_disk_CFLAGS) $(CFLAGS) -c -o test_disk-test_disk.o `test -f 'test_disk.c' || echo '$(srcdir)/'`test_disk.c
|
||||
|
||||
test_disk-test_disk.obj: test_disk.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_disk_CFLAGS) $(CFLAGS) -MT test_disk-test_disk.obj -MD -MP -MF "$(DEPDIR)/test_disk-test_disk.Tpo" -c -o test_disk-test_disk.obj `if test -f 'test_disk.c'; then $(CYGPATH_W) 'test_disk.c'; else $(CYGPATH_W) '$(srcdir)/test_disk.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_disk-test_disk.Tpo" "$(DEPDIR)/test_disk-test_disk.Po"; else rm -f "$(DEPDIR)/test_disk-test_disk.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_disk.c' object='test_disk-test_disk.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_disk_CFLAGS) $(CFLAGS) -c -o test_disk-test_disk.obj `if test -f 'test_disk.c'; then $(CYGPATH_W) 'test_disk.c'; else $(CYGPATH_W) '$(srcdir)/test_disk.c'; fi`
|
||||
|
||||
test_utils-test_utils.o: test_utils.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utils_CFLAGS) $(CFLAGS) -MT test_utils-test_utils.o -MD -MP -MF "$(DEPDIR)/test_utils-test_utils.Tpo" -c -o test_utils-test_utils.o `test -f 'test_utils.c' || echo '$(srcdir)/'`test_utils.c; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_utils-test_utils.Tpo" "$(DEPDIR)/test_utils-test_utils.Po"; else rm -f "$(DEPDIR)/test_utils-test_utils.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_utils.c' object='test_utils-test_utils.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utils_CFLAGS) $(CFLAGS) -c -o test_utils-test_utils.o `test -f 'test_utils.c' || echo '$(srcdir)/'`test_utils.c
|
||||
|
||||
test_utils-test_utils.obj: test_utils.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utils_CFLAGS) $(CFLAGS) -MT test_utils-test_utils.obj -MD -MP -MF "$(DEPDIR)/test_utils-test_utils.Tpo" -c -o test_utils-test_utils.obj `if test -f 'test_utils.c'; then $(CYGPATH_W) 'test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_utils-test_utils.Tpo" "$(DEPDIR)/test_utils-test_utils.Po"; else rm -f "$(DEPDIR)/test_utils-test_utils.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_utils.c' object='test_utils-test_utils.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utils_CFLAGS) $(CFLAGS) -c -o test_utils-test_utils.obj `if test -f 'test_utils.c'; then $(CYGPATH_W) 'test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils.c'; fi`
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
check-TESTS: $(TESTS)
|
||||
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
list='$(TESTS)'; \
|
||||
if test -n "$$list"; then \
|
||||
for tst in $$list; do \
|
||||
if test -f ./$$tst; then dir=./; \
|
||||
elif test -f $$tst; then dir=; \
|
||||
else dir="$(srcdir)/"; fi; \
|
||||
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
|
||||
all=`expr $$all + 1`; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*" $$tst "*) \
|
||||
xpass=`expr $$xpass + 1`; \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "XPASS: $$tst"; \
|
||||
;; \
|
||||
*) \
|
||||
echo "PASS: $$tst"; \
|
||||
;; \
|
||||
esac; \
|
||||
elif test $$? -ne 77; then \
|
||||
all=`expr $$all + 1`; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*" $$tst "*) \
|
||||
xfail=`expr $$xfail + 1`; \
|
||||
echo "XFAIL: $$tst"; \
|
||||
;; \
|
||||
*) \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "FAIL: $$tst"; \
|
||||
;; \
|
||||
esac; \
|
||||
else \
|
||||
skip=`expr $$skip + 1`; \
|
||||
echo "SKIP: $$tst"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test "$$failed" -eq 0; then \
|
||||
if test "$$xfail" -eq 0; then \
|
||||
banner="All $$all tests passed"; \
|
||||
else \
|
||||
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
|
||||
fi; \
|
||||
else \
|
||||
if test "$$xpass" -eq 0; then \
|
||||
banner="$$failed of $$all tests failed"; \
|
||||
else \
|
||||
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dashes="$$banner"; \
|
||||
skipped=""; \
|
||||
if test "$$skip" -ne 0; then \
|
||||
skipped="($$skip tests were not run)"; \
|
||||
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
|
||||
dashes="$$skipped"; \
|
||||
fi; \
|
||||
report=""; \
|
||||
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
|
||||
report="Please report to $(PACKAGE_BUGREPORT)"; \
|
||||
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
|
||||
dashes="$$report"; \
|
||||
fi; \
|
||||
dashes=`echo "$$dashes" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
test -z "$$skipped" || echo "$$skipped"; \
|
||||
test -z "$$report" || echo "$$report"; \
|
||||
echo "$$dashes"; \
|
||||
test "$$failed" -eq 0; \
|
||||
else :; fi
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$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_PROGRAMS)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
|
||||
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:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
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-checkPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-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: uninstall-info-am
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
|
||||
clean-checkPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstPROGRAMS ctags distclean 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-exec install-exec-am \
|
||||
install-info install-info-am install-man 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 uninstall uninstall-am uninstall-info-am
|
||||
|
||||
|
||||
test: ${noinst_PROGRAMS}
|
||||
perl -MTest::Harness -e '$$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)
|
||||
# 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:
|
5
lib/tests/README
Normal file
5
lib/tests/README
Normal file
|
@ -0,0 +1,5 @@
|
|||
The tests in here use the libtap library functions
|
||||
(http://jc.ngo.org.uk/trac-bin/trac.cgi/wiki/LibTap), so are
|
||||
more for unit testing the utils.c library functions.
|
||||
|
||||
However, it probably should be merged into the plugins/t subdirectory.
|
127
lib/tests/test_disk.c
Normal file
127
lib/tests/test_disk.c
Normal file
|
@ -0,0 +1,127 @@
|
|||
/******************************************************************************
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id: test_disk.c,v 1.2 2006/10/18 12:05:10 tonvoon Exp $
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#include "common.h"
|
||||
#include "utils_disk.h"
|
||||
#include "tap.h"
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
struct name_list *exclude_filesystem=NULL;
|
||||
struct name_list *exclude_fstype=NULL;
|
||||
struct name_list *dummy_mountlist = NULL;
|
||||
struct name_list *temp_name;
|
||||
struct parameter_list *paths = NULL;
|
||||
struct parameter_list *p;
|
||||
|
||||
struct mount_entry *dummy_mount_list;
|
||||
struct mount_entry *me;
|
||||
struct mount_entry **mtail = &dummy_mount_list;
|
||||
|
||||
plan_tests(18);
|
||||
|
||||
ok( np_find_name(exclude_filesystem, "/var/log") == FALSE, "/var/log not in list");
|
||||
np_add_name(&exclude_filesystem, "/var/log");
|
||||
ok( np_find_name(exclude_filesystem, "/var/log") == TRUE, "is in list now");
|
||||
ok( np_find_name(exclude_filesystem, "/home") == FALSE, "/home not in list");
|
||||
np_add_name(&exclude_filesystem, "/home");
|
||||
ok( np_find_name(exclude_filesystem, "/home") == TRUE, "is in list now");
|
||||
ok( np_find_name(exclude_filesystem, "/var/log") == TRUE, "/var/log still in list");
|
||||
|
||||
ok( np_find_name(exclude_fstype, "iso9660") == FALSE, "iso9660 not in list");
|
||||
np_add_name(&exclude_fstype, "iso9660");
|
||||
ok( np_find_name(exclude_fstype, "iso9660") == TRUE, "is in list now");
|
||||
|
||||
ok( np_find_name(exclude_filesystem, "iso9660") == FALSE, "Make sure no clashing in variables");
|
||||
|
||||
/*
|
||||
for (temp_name = exclude_filesystem; temp_name; temp_name = temp_name->next) {
|
||||
printf("Name: %s\n", temp_name->name);
|
||||
}
|
||||
*/
|
||||
|
||||
me = (struct mount_entry *) malloc(sizeof *me);
|
||||
me->me_devname = strdup("/dev/c0t0d0s0");
|
||||
me->me_mountdir = strdup("/");
|
||||
*mtail = me;
|
||||
mtail = &me->me_next;
|
||||
|
||||
me = (struct mount_entry *) malloc(sizeof *me);
|
||||
me->me_devname = strdup("/dev/c1t0d1s0");
|
||||
me->me_mountdir = strdup("/var");
|
||||
*mtail = me;
|
||||
mtail = &me->me_next;
|
||||
|
||||
me = (struct mount_entry *) malloc(sizeof *me);
|
||||
me->me_devname = strdup("/dev/c2t0d0s0");
|
||||
me->me_mountdir = strdup("/home");
|
||||
*mtail = me;
|
||||
mtail = &me->me_next;
|
||||
|
||||
|
||||
np_add_parameter(&paths, "/home/groups");
|
||||
np_add_parameter(&paths, "/var");
|
||||
np_add_parameter(&paths, "/tmp");
|
||||
np_add_parameter(&paths, "/home/tonvoon");
|
||||
np_add_parameter(&paths, "/dev/c2t0d0s0");
|
||||
|
||||
np_set_best_match(paths, dummy_mount_list, FALSE);
|
||||
for (p = paths; p; p = p->name_next) {
|
||||
struct mount_entry *temp_me;
|
||||
temp_me = p->best_match;
|
||||
if (! strcmp(p->name, "/home/groups")) {
|
||||
ok( temp_me && !strcmp(temp_me->me_mountdir, "/home"), "/home/groups got right best match: /home");
|
||||
} else if (! strcmp(p->name, "/var")) {
|
||||
ok( temp_me && !strcmp(temp_me->me_mountdir, "/var"), "/var got right best match: /var");
|
||||
} else if (! strcmp(p->name, "/tmp")) {
|
||||
ok( temp_me && !strcmp(temp_me->me_mountdir, "/"), "/tmp got right best match: /");
|
||||
} else if (! strcmp(p->name, "/home/tonvoon")) {
|
||||
ok( temp_me && !strcmp(temp_me->me_mountdir, "/home"), "/home/tonvoon got right best match: /home");
|
||||
} else if (! strcmp(p->name, "/dev/c2t0d0s0")) {
|
||||
ok( temp_me && !strcmp(temp_me->me_devname, "/dev/c2t0d0s0"), "/dev/c2t0d0s0 got right best match: /dev/c2t0d0s0");
|
||||
}
|
||||
}
|
||||
|
||||
paths = NULL; /* Bad boy - should free, but this is a test suite */
|
||||
np_add_parameter(&paths, "/home/groups");
|
||||
np_add_parameter(&paths, "/var");
|
||||
np_add_parameter(&paths, "/tmp");
|
||||
np_add_parameter(&paths, "/home/tonvoon");
|
||||
np_add_parameter(&paths, "/home");
|
||||
|
||||
np_set_best_match(paths, dummy_mount_list, TRUE);
|
||||
for (p = paths; p; p = p->name_next) {
|
||||
if (! strcmp(p->name, "/home/groups")) {
|
||||
ok( ! p->best_match , "/home/groups correctly not found");
|
||||
} else if (! strcmp(p->name, "/var")) {
|
||||
ok( p->best_match, "/var found");
|
||||
} else if (! strcmp(p->name, "/tmp")) {
|
||||
ok(! p->best_match, "/tmp correctly not found");
|
||||
} else if (! strcmp(p->name, "/home/tonvoon")) {
|
||||
ok(! p->best_match, "/home/tonvoon not found");
|
||||
} else if (! strcmp(p->name, "/home")) {
|
||||
ok( p->best_match, "/home found");
|
||||
}
|
||||
}
|
||||
|
||||
return exit_status();
|
||||
}
|
||||
|
6
lib/tests/test_disk.t
Executable file
6
lib/tests/test_disk.t
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/perl
|
||||
use Test::More;
|
||||
if (! -e "./test_disk") {
|
||||
plan skip_all => "./test_disk not compiled - please install tap library to test";
|
||||
}
|
||||
exec "./test_disk";
|
182
lib/tests/test_utils.c
Normal file
182
lib/tests/test_utils.c
Normal file
|
@ -0,0 +1,182 @@
|
|||
/******************************************************************************
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id: test_utils.c,v 1.2 2006/07/13 23:58:00 tonvoon Exp $
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#include "common.h"
|
||||
#include "utils_base.h"
|
||||
|
||||
#include "tap.h"
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
range *range;
|
||||
double temp;
|
||||
thresholds *thresholds = NULL;
|
||||
int rc;
|
||||
|
||||
plan_tests(82);
|
||||
|
||||
range = parse_range_string("6");
|
||||
ok( range != NULL, "'6' is valid range");
|
||||
ok( range->start == 0, "Start correct");
|
||||
ok( range->start_infinity == FALSE, "Not using negative infinity");
|
||||
ok( range->end == 6, "End correct");
|
||||
ok( range->end_infinity == FALSE, "Not using infinity");
|
||||
free(range);
|
||||
|
||||
range = parse_range_string("1:12%%");
|
||||
ok( range != NULL, "'1:12%%' is valid - percentages are ignored");
|
||||
ok( range->start == 1, "Start correct");
|
||||
ok( range->start_infinity == FALSE, "Not using negative infinity");
|
||||
ok( range->end == 12, "End correct");
|
||||
ok( range->end_infinity == FALSE, "Not using infinity");
|
||||
free(range);
|
||||
|
||||
range = parse_range_string("-7:23");
|
||||
ok( range != NULL, "'-7:23' is valid range");
|
||||
ok( range->start == -7, "Start correct");
|
||||
ok( range->start_infinity == FALSE, "Not using negative infinity");
|
||||
ok( range->end == 23, "End correct");
|
||||
ok( range->end_infinity == FALSE, "Not using infinity");
|
||||
free(range);
|
||||
|
||||
range = parse_range_string(":5.75");
|
||||
ok( range != NULL, "':5.75' is valid range");
|
||||
ok( range->start == 0, "Start correct");
|
||||
ok( range->start_infinity == FALSE, "Not using negative infinity");
|
||||
ok( range->end == 5.75, "End correct");
|
||||
ok( range->end_infinity == FALSE, "Not using infinity");
|
||||
free(range);
|
||||
|
||||
range = parse_range_string("~:-95.99");
|
||||
ok( range != NULL, "~:-95.99' is valid range");
|
||||
ok( range->start_infinity == TRUE, "Using negative infinity");
|
||||
ok( range->end == -95.99, "End correct (with rounding errors)");
|
||||
ok( range->end_infinity == FALSE, "Not using infinity");
|
||||
free(range);
|
||||
|
||||
range = parse_range_string("12345678901234567890:");
|
||||
temp = atof("12345678901234567890"); /* Can't just use this because number too large */
|
||||
ok( range != NULL, "'12345678901234567890:' is valid range");
|
||||
ok( range->start == temp, "Start correct");
|
||||
ok( range->start_infinity == FALSE, "Not using negative infinity");
|
||||
ok( range->end_infinity == TRUE, "Using infinity");
|
||||
/* Cannot do a "-1" on temp, as it appears to be same value */
|
||||
ok( check_range(temp/1.1, range) == TRUE, "12345678901234567890/1.1 - alert");
|
||||
ok( check_range(temp, range) == FALSE, "12345678901234567890 - no alert");
|
||||
ok( check_range(temp*2, range) == FALSE, "12345678901234567890*2 - no alert");
|
||||
free(range);
|
||||
|
||||
range = parse_range_string("~:0");
|
||||
ok( range != NULL, "'~:0' is valid range");
|
||||
ok( range->start_infinity == TRUE, "Using negative infinity");
|
||||
ok( range->end == 0, "End correct");
|
||||
ok( range->end_infinity == FALSE, "Not using infinity");
|
||||
ok( range->alert_on == OUTSIDE, "Will alert on outside of this range");
|
||||
ok( check_range(0.5, range) == TRUE, "0.5 - alert");
|
||||
ok( check_range(-10, range) == FALSE, "-10 - no alert");
|
||||
ok( check_range(0, range) == FALSE, "0 - no alert");
|
||||
free(range);
|
||||
|
||||
range = parse_range_string("@0:657.8210567");
|
||||
ok( range != 0, "@0:657.8210567' is a valid range");
|
||||
ok( range->start == 0, "Start correct");
|
||||
ok( range->start_infinity == FALSE, "Not using negative infinity");
|
||||
ok( range->end == 657.8210567, "End correct");
|
||||
ok( range->end_infinity == FALSE, "Not using infinity");
|
||||
ok( range->alert_on == INSIDE, "Will alert on inside of this range" );
|
||||
ok( check_range(32.88, range) == TRUE, "32.88 - alert");
|
||||
ok( check_range(-2, range) == FALSE, "-2 - no alert");
|
||||
ok( check_range(657.8210567, range) == TRUE, "657.8210567 - alert");
|
||||
ok( check_range(0, range) == TRUE, "0 - alert");
|
||||
free(range);
|
||||
|
||||
range = parse_range_string("1:1");
|
||||
ok( range != NULL, "'1:1' is a valid range");
|
||||
ok( range->start == 1, "Start correct");
|
||||
ok( range->start_infinity == FALSE, "Not using negative infinity");
|
||||
ok( range->end == 1, "End correct");
|
||||
ok( range->end_infinity == FALSE, "Not using infinity");
|
||||
ok( check_range(0.5, range) == TRUE, "0.5 - alert");
|
||||
ok( check_range(1, range) == FALSE, "1 - no alert");
|
||||
ok( check_range(5.2, range) == TRUE, "5.2 - alert");
|
||||
free(range);
|
||||
|
||||
range = parse_range_string("2:1");
|
||||
ok( range == NULL, "'2:1' rejected");
|
||||
|
||||
rc = _set_thresholds(&thresholds, NULL, NULL);
|
||||
ok( rc == 0, "Thresholds (NULL, NULL) set");
|
||||
ok( thresholds->warning == NULL, "Warning not set");
|
||||
ok( thresholds->critical == NULL, "Critical not set");
|
||||
|
||||
rc = _set_thresholds(&thresholds, NULL, "80");
|
||||
ok( rc == 0, "Thresholds (NULL, '80') set");
|
||||
ok( thresholds->warning == NULL, "Warning not set");
|
||||
ok( thresholds->critical->end == 80, "Critical set correctly");
|
||||
|
||||
rc = _set_thresholds(&thresholds, "5:33", NULL);
|
||||
ok( rc == 0, "Thresholds ('5:33', NULL) set");
|
||||
ok( thresholds->warning->start == 5, "Warning start set");
|
||||
ok( thresholds->warning->end == 33, "Warning end set");
|
||||
ok( thresholds->critical == NULL, "Critical not set");
|
||||
|
||||
rc = _set_thresholds(&thresholds, "30", "60");
|
||||
ok( rc == 0, "Thresholds ('30', '60') set");
|
||||
ok( thresholds->warning->end == 30, "Warning set correctly");
|
||||
ok( thresholds->critical->end == 60, "Critical set correctly");
|
||||
ok( get_status(15.3, thresholds) == STATE_OK, "15.3 - ok");
|
||||
ok( get_status(30.0001, thresholds) == STATE_WARNING, "30.0001 - warning");
|
||||
ok( get_status(69, thresholds) == STATE_CRITICAL, "69 - critical");
|
||||
|
||||
char *test;
|
||||
test = np_escaped_string("bob\\n");
|
||||
ok( strcmp(test, "bob\n") == 0, "bob\\n ok");
|
||||
free(test);
|
||||
|
||||
test = np_escaped_string("rhuba\\rb");
|
||||
ok( strcmp(test, "rhuba\rb") == 0, "rhuba\\rb okay");
|
||||
free(test);
|
||||
|
||||
test = np_escaped_string("ba\\nge\\r");
|
||||
ok( strcmp(test, "ba\nge\r") == 0, "ba\\nge\\r okay");
|
||||
free(test);
|
||||
|
||||
test = np_escaped_string("\\rabbi\\t");
|
||||
ok( strcmp(test, "\rabbi\t") == 0, "\\rabbi\\t okay");
|
||||
free(test);
|
||||
|
||||
test = np_escaped_string("and\\\\or");
|
||||
ok( strcmp(test, "and\\or") == 0, "and\\\\or okay");
|
||||
free(test);
|
||||
|
||||
test = np_escaped_string("bo\\gus");
|
||||
ok( strcmp(test, "bogus") == 0, "bo\\gus okay");
|
||||
free(test);
|
||||
|
||||
test = np_escaped_string("everything");
|
||||
ok( strcmp(test, "everything") == 0, "everything okay");
|
||||
free(test);
|
||||
|
||||
test = basename("/here/is/a/path");
|
||||
ok( strcmp(test, "path") == 0, "basename okay");
|
||||
|
||||
return exit_status();
|
||||
}
|
6
lib/tests/test_utils.t
Executable file
6
lib/tests/test_utils.t
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/perl
|
||||
use Test::More;
|
||||
if (! -e "./test_utils") {
|
||||
plan skip_all => "./test_utils not compiled - please install tap library to test";
|
||||
}
|
||||
exec "./test_utils";
|
Loading…
Add table
Add a link
Reference in a new issue