~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to testsuite/nsswitch/getent_r.sh

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# Verify test output.  Basically we check to see if all the files generated
 
4
# in /tmp by the get{pw,gr}ent_r.c and program are identical.  If there is
 
5
# some problem with the re-entrancy of the code then the information in the
 
6
# two files will be different.  
 
7
#
 
8
 
 
9
TYPE=$1
 
10
ID=$2
 
11
FILES="/tmp/${TYPE}_r-${ID}.out-*"
 
12
 
 
13
# Sort files
 
14
 
 
15
for file in $FILES; do
 
16
    cat $file | sort > $file.sorted
 
17
done
 
18
 
 
19
# Diff files
 
20
 
 
21
SORTED="/tmp/${TYPE}_r-${ID}.out-*.sorted"
 
22
failed=0
 
23
 
 
24
for file1 in $SORTED; do
 
25
    for file2 in $SORTED; do
 
26
        if [ $file1 != $file2 ]; then
 
27
                diff $file1 $file2
 
28
        fi
 
29
    done
 
30
done
 
31
 
 
32
# Clean up
 
33
 
 
34
rm -f $SORTED
 
35