Older versions of egrep do not support the character class
"\s". Changed:
puppet resource service | egrep -B1 "ensure\s*=>.*'running"
to:
puppet resource service | egrep -B1 "ensure.*=>.*'running"

Signed-off-by: Dominic Maraglia <[email protected]>
---
 .../ticket_4123_should_list_all_running_redhat.sh  |   43 ++++++++-----------
 .../ticket_4124_should_list_all_disabled.sh        |   44 ++++++++------------
 2 files changed, 36 insertions(+), 51 deletions(-)

diff --git 
a/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh
 
b/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh
index 1d5e495..d857666 100755
--- 
a/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh
+++ 
b/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh
@@ -4,33 +4,26 @@
 # This will facilitate expansion of this tests to include
 # the ability to test other OSes
 
-#if [ -z $1 ] ; then
-#  echo "No platform specified"
-#  exit 1
-#fi
+RALSH_FILE=/tmp/ralsh-running-list-$$
+SERVICE_FILE=/tmp/service-running-list-$$
 
-# redhat or centos only
-#if echo $1 | grep -e centos -e redhat
-  RALSH_FILE=/tmp/ralsh-running-list-$$
-  SERVICE_FILE=/tmp/service-running-list-$$
+puppet resource service | egrep -B1 "ensure.*=>.*'running" | grep 'service {' 
| gawk -F"'" '{print $2}' | sort  > $RALSH_FILE
 
-  puppet resource service | egrep -B1 "ensure\s*=>\s*'running" | grep 'service 
{' | gawk -F"\'" '{print $2}' | sort  > $RALSH_FILE
+if [ -e $SERVICE_FILE ]; then
+  rm $SERVICE_FILE
+fi
 
-  if [ -e $SERVICE_FILE ]; then
-    rm $SERVICE_FILE
+SERVICEDIR='/etc/init.d'
+for SERVICE in $( ls $SERVICEDIR | sort | egrep -v 
"(functions|halt|killall|single|linuxconf)" ) ; do
+  if env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" 
status; then
+    echo $SERVICE >> $SERVICE_FILE
   fi
-  SERVICEDIR='/etc/init.d'
-  for SERVICE in $( ls $SERVICEDIR | sort | egrep -v 
"(functions|halt|killall|single|linuxconf)" ) ; do
-    if env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" 
"${SERVICEDIR}/${SERVICE}" status; then
-      echo $SERVICE >> $SERVICE_FILE
-    fi
-  done
+done
 
-  if diff $RALSH_FILE $SERVICE_FILE ; then
-    echo "Ralsh and system service count agree"
-    exit 0
-  else
-    echo "Ralsh and system service count NOT in agreement"
-    exit 1
-  fi
-#fi # end redhat/centos
+if diff $RALSH_FILE $SERVICE_FILE ; then
+  echo "Ralsh and system service count agree"
+  exit 0
+else
+  echo "Ralsh and system service count NOT in agreement"
+  exit 1
+fi
diff --git 
a/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.sh 
b/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.sh
index 7cc463d..7e884af 100755
--- a/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.sh
+++ b/acceptance/tests/resource/service/ticket_4124_should_list_all_disabled.sh
@@ -4,34 +4,26 @@
 # This will facilitate expansion of this tests to include
 # the ability to test other OSes
 
-#if [ -z $1 ] ; then
-#  echo "No platform specified"
-#  exit 1
-#fi
+RALSH_FILE=/tmp/ralsh-disabled-list-$$
+SERVICE_FILE=/tmp/service-disabled-list-$$
 
-# redhat or centos only
-#if echo $1 | grep -e centos -e redhat
-  RALSH_FILE=/tmp/ralsh-disabled-list-$$
-  SERVICE_FILE=/tmp/service-disabled-list-$$
+puppet resource service | egrep -B2 "enable.*=>.*'false" | grep "service {" | 
awk -F"'" '{print $2}' | sort  > $RALSH_FILE
 
-  # collect all service namevars 
-  puppet resource service | egrep -B2 "enable\s*=>\s*'false" | grep "service 
{" | awk -F"'" '{print $2}' | sort  > $RALSH_FILE
+if [ -e $SERVICE_FILE ]; then
+  rm $SERVICE_FILE
+fi
 
-  if [ -e $SERVICE_FILE ]; then
-    rm $SERVICE_FILE
+SERVICEDIR='/etc/init.d'
+for SERVICE in $( ls $SERVICEDIR | sort | egrep -v 
"(functions|halt|killall|single|linuxconf)" ) ; do
+  if ! chkconfig $SERVICE; then
+    echo $SERVICE >> $SERVICE_FILE
   fi
-  SERVICEDIR='/etc/init.d'
-  for SERVICE in $( ls $SERVICEDIR | sort | egrep -v 
"(functions|halt|killall|single|linuxconf)" ) ; do
-    if ! chkconfig $SERVICE; then
-      echo $SERVICE >> $SERVICE_FILE
-    fi
-  done
+done
 
-  if diff $RALSH_FILE $SERVICE_FILE ; then
-    echo "Ralsh and system service count agree"
-    exit 0
-  else
-    echo "Ralsh and system service count NOT in agreement"
-    exit 1
-  fi
-#fi # end redhat/centos
+if diff $RALSH_FILE $SERVICE_FILE ; then
+  echo "Ralsh and system service count agree"
+  exit 0
+else
+  echo "Ralsh and system service count NOT in agreement"
+  exit 1
+fi
-- 
1.7.3.5

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to