Merge lp:~racb/ubuntu/saucy/puppet/dep8-hiera into lp:ubuntu/saucy/puppet

Proposed by Robie Basak
Status: Work in progress
Proposed branch: lp:~racb/ubuntu/saucy/puppet/dep8-hiera
Merge into: lp:ubuntu/saucy/puppet
Diff against target: 106 lines (+78/-0) (has conflicts)
3 files modified
debian/changelog (+9/-0)
debian/tests/control (+4/-0)
debian/tests/hiera (+65/-0)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~racb/ubuntu/saucy/puppet/dep8-hiera
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+173220@code.launchpad.net

Commit message

d/tests/hiera: add dep8 test for hiera functionality

Description of the change

d/tests/hiera: add dep8 test for hiera functionality

To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote :

I'm concerned about uploading this now, because of https://lists.ubuntu.com/archives/ubuntu-quality/2013-July/004018.html

71. By Robie Basak

Make hiera test "set -x" and mark test "allow-stderr"

72. By Robie Basak

Enable puppet agent, as it is now disabled by default.

Unmerged revisions

72. By Robie Basak

Enable puppet agent, as it is now disabled by default.

71. By Robie Basak

Make hiera test "set -x" and mark test "allow-stderr"

70. By Robie Basak

d/tests/hiera: add dep8 test for hiera functionality.

69. By Stig Sandbeck Mathisen

* New upstream version (Closes: #712745, CVE-2013-3567)
  - use packaged ruby-safe-yaml instead of the vendored gem
* Support apache 2.4 (Closes: #675409)
* Remove dependency on rails (Closes: #709636)
* Remove build dependency on ruby-rspec
* add dep8 tests
* puppetmaster-passenger.postinst: check if puppet.conf can be parsed on
  install.
  Thanks to Ubuntu

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-09-03 16:39:37 +0000
3+++ debian/changelog 2014-01-22 14:00:20 +0000
4@@ -1,3 +1,4 @@
5+<<<<<<< TREE
6 puppet (3.2.4-2ubuntu2) saucy; urgency=low
7
8 * debian/tests/control: invert order of tests, or else puppet-agent runs
9@@ -43,6 +44,14 @@
10
11 -- Stig Sandbeck Mathisen <ssm@debian.org> Fri, 02 Aug 2013 23:07:48 +0200
12
13+=======
14+puppet (3.2.2-1ubuntu1) UNRELEASED; urgency=low
15+
16+ * d/tests/hiera: add dep8 test for hiera functionality.
17+
18+ -- Robie Basak <robie.basak@ubuntu.com> Tue, 02 Jul 2013 14:44:41 +0000
19+
20+>>>>>>> MERGE-SOURCE
21 puppet (3.2.2-1) unstable; urgency=high
22
23 * New upstream version (Closes: #712745, CVE-2013-3567)
24
25=== modified file 'debian/control'
26=== modified file 'debian/tests/control'
27--- debian/tests/control 2013-09-03 16:39:37 +0000
28+++ debian/tests/control 2014-01-22 14:00:20 +0000
29@@ -5,3 +5,7 @@
30 Tests: puppetmaster-passenger
31 Depends: puppetmaster-passenger
32 Restrictions: needs-root
33+
34+Tests: hiera
35+Depends: puppet, puppetmaster
36+Restrictions: needs-root allow-stderr
37
38=== added file 'debian/tests/hiera'
39--- debian/tests/hiera 1970-01-01 00:00:00 +0000
40+++ debian/tests/hiera 2014-01-22 14:00:20 +0000
41@@ -0,0 +1,65 @@
42+#!/bin/sh
43+set -ex
44+
45+# Author: Robie Basak <robie.basak@ubuntu.com>
46+
47+# For now, since we use the same machine for the agent and the master, both of
48+# these are this machine itself. This test is written so that we can split
49+# the test into separate agent and master parts in the future.
50+
51+# "facter fqdn" writes some warnings to stderr if "hostname -f" fails, and this
52+# causes the test to fail. So ignore those. This isn't great for debugging, but
53+# that's why I think dep8 should consider stderr writes to be failures.
54+
55+master_name=`facter fqdn 2>/dev/null`
56+agent_name=$master_name
57+
58+prepare_agent() {
59+ cat >> /etc/puppet/puppet.conf <<EOT
60+[agent]
61+server=$master_name
62+EOT
63+}
64+
65+prepare_master() {
66+ cat > /etc/puppet/hiera.yaml <<EOT
67+---
68+:backends:
69+ - yaml
70+:yaml:
71+ :datadir: /etc/puppet/hiera
72+:hierarchy:
73+ - '%{::fqdn}'
74+ - common
75+EOT
76+
77+ mkdir /etc/puppet/hiera
78+ cat > /etc/puppet/hiera/${agent_name}.yaml <<EOT
79+---
80+dep8::content: "success\n"
81+EOT
82+
83+ cat > /etc/puppet/manifests/site.pp <<EOT
84+class dep8(\$content) { file { '/tmp/dep8-result': content => \$content } }
85+node '$agent_name' {
86+ include dep8
87+}
88+EOT
89+}
90+
91+prepare_master
92+prepare_agent
93+
94+puppet agent --enable
95+
96+# The next command tends to return non-zero on success, so ignore it and just
97+# check that it did what it was supposed to later.
98+puppet agent --test || true # run on the agent
99+
100+# XXX the following aren't needed when running the agent and the master on the
101+# same system.
102+# puppet cert sign $agent_name # run on the master
103+# puppet agent --test # run on the agent
104+
105+# Now /tmp/dep8-result should be "success\n" on the agent.
106+echo success|cmp - /tmp/dep8-result

Subscribers

People subscribed via source and target branches

to all changes: