]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: cleanup islocal test
authorKarel Zak <kzak@redhat.com>
Tue, 4 Oct 2011 21:45:45 +0000 (23:45 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 26 Oct 2011 21:17:17 +0000 (23:17 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/.gitignore
login-utils/Makefile.am
login-utils/islocal.c
tests/commands.sh.in
tests/ts/login/islocal

index 31af9d49cbc7631d0ddb0478e905d6343985b4b7..17b6f09b9f1443feb286b9288df3d5c9fa848954 100644 (file)
@@ -1,4 +1,4 @@
-islocal_test
+test_islocal
 chfn
 chsh
 login
index a07279e1af83d0d4086e7b08e3fae5ab2f9e75d7..a5909a6f5b1e659c658c1993633c2e3332d8d626 100644 (file)
@@ -65,7 +65,6 @@ install-exec-hook::
 
 endif
 
-noinst_PROGRAMS = islocal_test
-islocal_test_SOURCES = islocal.c
-islocal_test_CPPFLAGS = -DMAIN_TEST_ISLOCAL $(AM_CPPFLAGS)
-
+noinst_PROGRAMS = test_islocal
+test_islocal_SOURCES = islocal.c
+test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
index 39a74c6a8dc27eb628718e46659a5990e738a90e..e0a3d76945d67dc7685cb11db331ca6b0dde96c4 100644 (file)
@@ -92,12 +92,12 @@ is_local(const char *user)
        }
 }
 
-#if MAIN_TEST_ISLOCAL
+#ifdef TEST_PROGRAM
 int
 main (int argc, char *argv[])
 {
-       if (argc < 2) {
-               fprintf(stderr, "No test passwd file was specified.\n");
+       if (argc <= 2) {
+               fprintf(stderr, "usage: %s <passwdfile> <username> [...]\n", argv[0]);
                return 1;
        } else {
                int i;
index 462a4f56be3f5852a6642b376a4f59c7372fb4f4..63c146fc6d4d2582282b0e7bf59cea28172a7af1 100644 (file)
@@ -24,6 +24,8 @@ TS_HELPER_LIBMOUNT_UPDATE="$top_builddir/libmount/src/test_tab_update"
 TS_HELPER_LIBMOUNT_CONTEXT="$top_builddir/libmount/src/test_context"
 TS_HELPER_LIBMOUNT_TABDIFF="$top_builddir/libmount/src/test_tab_diff"
 
+TS_HELPER_ISLOCAL="$top_builddir/login-utils/test_islocal"
+
 # TODO: use partx
 TS_HELPER_PARTITIONS="$top_builddir/libblkid/samples/partitions"
 
@@ -55,7 +57,6 @@ TS_CMD_LOOK=${TS_CMD_LOOK-"$top_builddir/misc-utils/look"}
 TS_CMD_CAL=${TS_CMD_CAL-"$top_builddir/misc-utils/cal"}
 TS_CMD_SCRIPT=${TS_CMD_SCRIPT-"$top_builddir/term-utils/script"}
 
-TS_CMD_ISLOCAL=${TS_CMD_ISLOCAL-"$top_builddir/login-utils/islocal_test"}
 
 TS_CMD_HWCLOCK=${TS_CMD_HWCLOCK-"$top_builddir/hwclock/hwclock"}
 TS_CMD_LSCPU=${TS_CMD_LSCPU-"$top_builddir/sys-utils/lscpu"}
index ba23857343976c162129b7d14c3082f3a62abe62..c25da6a0788654c6bbde2af2db5c706c67883cc1 100755 (executable)
@@ -21,7 +21,7 @@ TS_DESC="islocal"
 . $TS_TOPDIR/functions.sh
 ts_init "$*"
 
-$TS_CMD_ISLOCAL "$TS_SELF/islocal.data" root nobody "" youngman youngman2 \
+$TS_HELPER_ISLOCAL "$TS_SELF/islocal.data" root nobody "" youngman youngman2 \
     abcdefghx nobo long rot al malformed \
     nonl znobody >> $TS_OUTPUT
 ts_finalize