[Pkg-puppet-devel] Bug#730762: dep8 test for basic parameterised class use

Robie Basak robie.basak at ubuntu.com
Fri Nov 29 10:35:00 UTC 2013


Package: puppet
Version: 3.3.1-1
Severity: wishlist
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu trusty ubuntu-patch

Please add the following dep8 test, which was useful for picking up and
verifying the missing ruby-hiera dependency problem in:

http://anonscm.debian.org/gitweb/?p=pkg-puppet/puppet.git;a=commitdiff;h=11a376f8348dfa2c254b19f7b29aec13940aeb92
https://launchpad.net/bugs/1242363

This test is also a useful smoke test for puppet's standalone mode.

---8<---
diff -Nru puppet-3.2.4/debian/tests/control puppet-3.2.4/debian/tests/control
--- puppet-3.2.4/debian/tests/control   2013-09-03 20:39:18.000000000 +0000
+++ puppet-3.2.4/debian/tests/control   2013-11-29 10:14:25.000000000 +0000
@@ -5,3 +5,8 @@
 Tests: puppetmaster-passenger
 Depends: puppetmaster-passenger
 Restrictions: needs-root
+
+Tests: parameterised-class
+Depends: puppet
+Features: no-build-needed
+Restrictions: allow-stderr
diff -Nru puppet-3.2.4/debian/tests/parameterised-class puppet-3.2.4/debian/tests/parameterised-class
--- puppet-3.2.4/debian/tests/parameterised-class       1970-01-01 00:00:00.000000000 +0000
+++ puppet-3.2.4/debian/tests/parameterised-class       2013-11-29 10:07:12.000000000 +0000
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -ex
+
+# This test was written in response to: https://launchpad.net/bugs/1242363
+# Author: Robie Basak <robie.basak at ubuntu.com>
+
+cat > "$ADTTMP/test.pp" <<EOT
+class foo(\$content="abc\\n") {
+    file { '$ADTTMP/test-result': content => \$content; }
+}
+
+class {foo:}
+EOT
+
+rm -f "$ADTTMP/test-result"
+puppet apply "$ADTTMP/test.pp"
+result=`cat "$ADTTMP/test-result"`
+
+test "$result" = "abc"



More information about the Pkg-puppet-devel mailing list