Permalink
Browse files

fixed test failures

  • Loading branch information...
bodepd committed Sep 8, 2010
1 parent 3be3e05 commit d428bacc4a4499ea3de35397d7ca6144da0d9310
@@ -8,10 +8,13 @@ source lib/setup.sh
#
# precondition
# - group should not exist
-GROUP=bozo$$
+GROUP=bozo
if getent group $GROUP; then
groupdel $GROUP
fi
+# verify
$BIN/puppet resource group $GROUP ensure=present gid=12768
getent group $GROUP | grep 12768
+# postcondition
+groupdel $GROUP
@@ -1,3 +1,6 @@
+#
+# sets up a local test repo used for yum tests
+#
mkdir -p /var/yum
deps_path="$( dirname $0 )/deps"
cp -Rf $deps_path/repo /var/yum/
@@ -1,9 +1,13 @@
#!/bin/bash
-
+#
+# author: Dan Bode
+#
+# tests that puppet yum provider can downgrade packages.
+#
set -e
set -u
-source spec/setup.sh
+source lib/setup.sh
if ! which rpm ; then NOT_APPLICABLE ; fi
PACKAGE='spectest'
@@ -22,4 +26,5 @@ $BIN/puppet resource package $PACKAGE ensure=$VERSION | tee $OUTFILE
grep "ensure changed '${OLD_VERSION}' to '${VERSION}'" $OUTFILE
# postcondition
+# package should have been downgraded.
[ `rpm -q $PACKAGE` == "${PACKAGE}-${VERSION}" ]
@@ -1,9 +1,12 @@
#!/bin/bash
-
+#
+# author: Dan Bode
+# ensures that purge for yum resource
+# removed depending packages. (not working yet)
set -e
set -u
-source spec/setup.sh
+source lib/setup.sh
if ! which rpm ; then NOT_APPLICABLE ; fi
@@ -1,5 +1,8 @@
#!/bin/bash
-
+#
+# author: Dan Bode
+# ensures that yum provider can uninstall a package
+#
set -e
set -u
@@ -10,6 +13,7 @@ if ! which rpm ; then NOT_APPLICABLE ; fi
PACKAGE='spectest'
# precondition
+# package should not be installed
if rpm -q $PACKAGE; then
rpm -ef $PACKAGE
fi
@@ -18,5 +22,6 @@ fi
$BIN/puppet resource package $PACKAGE ensure=installed | tee $OUTFILE
# postcondition
+# package should be installed
grep 'ensure: created' $OUTFILE
rpm -q $PACKAGE
@@ -1,15 +1,20 @@
#!/bin/bash
-
+#
+# author: Dan Bode
+#
+# ensure that yum provider can uninstall a package
+#
set -e
set -u
-source spec/setup.sh
+source lib/setup.sh
if ! which rpm ; then NOT_APPLICABLE ; fi
PACKAGE='spectest'
# precondition
+# package should be installed
if ! rpm -q $PACKAGE; then
yum -d 0 -e 0 -y install $PACKAGE
fi
@@ -19,5 +24,6 @@ $BIN/puppet resource package $PACKAGE ensure=absent | tee $OUTFILE
# postcondition
+# package should be uninstalled
grep 'ensure: removed' $OUTFILE
! rpm -q $PACKAGE
@@ -1,9 +1,12 @@
#!/bin/bash
+# Author: Dan Bode
+# ensures that a yum provider can upgrade to a specified version
+#
set -e
set -u
-source spec/setup.sh
+source lib/setup.sh
if ! which rpm ; then NOT_APPLICABLE ; fi
PACKAGE='spectest'
@@ -12,6 +15,7 @@ OLD_VERSION='1.0-1'
VERSION='1.1-1'
# precondition
+# ensure that old versipons of package is installed
if rpm -q $PACKAGE; then
rpm -ef $PACKAGE
fi
@@ -20,6 +24,7 @@ yum install -d 0 -e 0 -y $PACKAGE-$OLD_VERSION
# run ralsh
$BIN/puppet resource package $PACKAGE ensure=$VERSION | tee $OUTFILE
-grep "ensure changed '${OLD_VERSION}' to '${VERSION}'" $OUTFILE
# postcondition
+# package should have been upgraded to desired version.
+grep "ensure changed '${OLD_VERSION}' to '${VERSION}'" $OUTFILE
[ `rpm -q $PACKAGE` == "${PACKAGE}-${VERSION}" ]

0 comments on commit d428bac

Please sign in to comment.