This repository was archived by the owner on Oct 7, 2021. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 115115for  SERVICE  in  ${SERVICES} ;  do 
116116  HOST=$( printf " %s\n" " $SERVICE " |  cut -d :  -f 1) 
117117  PORT=$( printf " %s\n" " $SERVICE " |  cut -d :  -f 2) 
118-   SUCCESS=1 
118+   FAILURE=0 
119119
120120  if  [ " $HOST " =  " " ||  [ " $PORT " =  " " ;  then 
121121    echoerr " Error: you need to provide a host and port to test." 
@@ -124,14 +124,14 @@ for SERVICE in ${SERVICES}; do
124124
125125  wait_for
126126  if  [ $?  -eq  1 ];  then 
127-     SUCCESS=0 
127+     FAILURE=1 
128128  fi 
129129done 
130130
131- if  [ $SUCCESS   -eq  1 ];  then 
131+ if  [ $FAILURE    -eq  0 ]  ||  [  $LOOSE  -eq  1 ];  then 
132132  if  [ $#  -gt  0 ];  then 
133133    exec  " $@ " 
134134  fi 
135- else 
136-   exit  1
137135fi 
136+ 
137+ exit  $FAILURE 
Original file line number Diff line number Diff line change 33@test " google should be immediately found, no output other than our own" 
44  run ./wait-for -q google.com:80 -- echo  ' success' 
55
6+   [ " $status " -eq  0 ]
67  [ " $output " =  " success" 
78}
89
1415}
1516
1617@test " google and bing should be immediately found" 
17-   run ./wait-for google.com:80 bing.com:80 -- echo  ' success' 
18+   run ./wait-for -q  google.com:80 bing.com:80 -- echo  ' success' 
1819
19-    [ " $output " =  " success" 
20+   [ " $status " -eq  0 ]
21+   [ " $output " =  " success" 
2022}
2123
2224@test " nonexistent server should start command if loose option is specified" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments