Permalink
Browse files

added more tests.

  • Loading branch information...
Dan Bode
Dan Bode committed Jul 7, 2010
1 parent ea39aad commit 0e1d4d32accc22864cc7d56fe8ace6355515e85a
@@ -4,14 +4,16 @@ set -e
set -u
. local_setup.sh
+#
+# precondition - entry exists with namevar
+#
if ! grep test1 /etc/hosts; then
- echo "127.0.0.2 test1" > /etc/hosts
+ echo "127.0.0.2 test1" >> /etc/hosts
fi
if [ -f /tmp/hosts-$$ ]; then
rm /tmp/hosts-$$
fi
-echo 'yoyo'
-$BIN/puppet resource host test1 ensure=present target="/tmp/host-$$" host_aliases=alias1
-#| grep 'ip is a required attribute for hosts'
+# post-condition - ip address not specified, create should fail with message.
+$BIN/puppet resource host test1 ensure=present target="/tmp/host-$$" host_aliases=alias1 | grep 'ip is a required attribute for hosts'
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -e
+set -u
+
+source local_setup.sh
+
+PACKAGE='yum-cron'
+
+# precondition
+if rpm -q $PACKAGE; then
+ rpm -ef $PACKAGE
+fi
+
+# run ralsh
+$BIN/puppet resource package yum-cron ensure=installed | grep 'ensure: created'
+
+# postcondition
+rpm -q $PACKAGE

0 comments on commit 0e1d4d3

Please sign in to comment.