summaryrefslogtreecommitdiff
path: root/testsuite/nsswitch/getent_r.sh
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2000-05-12 06:55:09 +0000
committerTim Potter <tpot@samba.org>2000-05-12 06:55:09 +0000
commit75ebfc6f7a7692d772b729b2d83038a9054b4f90 (patch)
tree031b445348b62fdf40489fb2526c46506ee2c3ba /testsuite/nsswitch/getent_r.sh
parent053322d0ca6b68be638c2d5f4caa9909a19c1646 (diff)
downloadsamba-75ebfc6f7a7692d772b729b2d83038a9054b4f90.tar.gz
samba-75ebfc6f7a7692d772b729b2d83038a9054b4f90.tar.bz2
samba-75ebfc6f7a7692d772b729b2d83038a9054b4f90.zip
Merge from TNG.
(This used to be commit af5ded9f17addb4bc89ecb762b9b99d2f99463ab)
Diffstat (limited to 'testsuite/nsswitch/getent_r.sh')
-rwxr-xr-xtestsuite/nsswitch/getent_r.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/nsswitch/getent_r.sh b/testsuite/nsswitch/getent_r.sh
new file mode 100755
index 0000000000..75dc603f82
--- /dev/null
+++ b/testsuite/nsswitch/getent_r.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Verify test output. Basically we check to see if all the files generated
+# in /tmp by the get{pw,gr}ent_r.c and program are identical. If there is
+# some problem with the re-entrancy of the code then the information in the
+# two files will be different.
+#
+
+TYPE=$1
+ID=$2
+FILES="/tmp/${TYPE}_r-${ID}.out-*"
+
+# Sort files
+
+for file in $FILES; do
+ cat $file | sort > $file.sorted
+done
+
+# Diff files
+
+SORTED="/tmp/${TYPE}_r-${ID}.out-*.sorted"
+failed=0
+
+for file1 in $SORTED; do
+ for file2 in $SORTED; do
+ if [ $file1 != $file2 ]; then
+ diff $file1 $file2
+ fi
+ done
+done
+
+# Clean up
+
+rm -f $SORTED
+