[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#6979) test062 portability



Full_Name: Aaron Richton
Version: RE24
OS: irrelevant
URL: 
Submission from: (NULL) (166.217.78.192)


It looks like checking the function exit isn't portable; maybe some kind of
bash-ism. It looks like the code was on the path to communicating the retval via
$RCOUT file already? As such, here's one quick workaround, although I'd love
something a bit more elegant:

--- test062-config-delete~      2011-06-23 07:21:01.387583000 -0400
+++ test062-config-delete       2011-06-23 07:21:14.884787000 -0400
@@ -106,7 +106,7 @@
 (
   $LDAPSEARCH -D cn=config -H $URI1 -y $CONFIGPWF -bcn=config -E \!sync=rp
>/dev/null 2>&1
   RC=$?
-  touch $RCOUT
+  echo $RC > $RCOUT
   exit $RC
 ) &
 
@@ -137,7 +137,7 @@
 
 if test -f "$RCOUT" ; then
        wait $SEARCHPID
-       SEARCHRC=$?
+       SEARCHRC=`cat $RCOUT`
        echo "Checking return code of backgrounded RefreshAndPersist search
..."
        if test $SEARCHRC != 52 ; then
                echo "Error: Backgrounded ldapsearch did return the wrong error
code: $SEARCHRC"