summaryrefslogtreecommitdiffstats
path: root/acceptance
diff options
context:
space:
mode:
authorDominic Maraglia <dominic@puppetlabs.com>2011-05-24 16:41:38 -0700
committerDominic Maraglia <dominic@puppetlabs.com>2011-05-24 16:41:38 -0700
commit646919e5ec1fd5c3071711c091994dcdfcf8bcb5 (patch)
treee21b5a11823103c6734d26664ae09b12d3d087d4 /acceptance
parentcbc123c2641f1c51a71710ea5dac5f6114063d34 (diff)
downloadpuppet-646919e5ec1fd5c3071711c091994dcdfcf8bcb5.tar.gz
puppet-646919e5ec1fd5c3071711c091994dcdfcf8bcb5.tar.xz
puppet-646919e5ec1fd5c3071711c091994dcdfcf8bcb5.zip
(4123) Fix test for 4123/4 on old egrep in cent4
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"
Diffstat (limited to 'acceptance')
-rwxr-xr-xacceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh43
-rwxr-xr-xacceptance/tests/resource/service/ticket_4124_should_list_all_disabled.sh44
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 1d5e49524..d8576667a 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 7cc463d5e..7e884aff2 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