~racb/ubuntu/saucy/puppet/dep8-hiera

« back to all changes in this revision

Viewing changes to acceptance/tests/ticket_6541_invalid_filebucket_files.rb

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-07-14 01:56:30 UTC
  • mfrom: (1.1.29) (3.1.43 sid)
  • Revision ID: package-import@ubuntu.com-20120714015630-ntj41rkvkq4zph4y
Tags: 2.7.18-1ubuntu1
* Resynchronise with Debian. (LP: #1023931) Remaining changes:
  - debian/puppetmaster-passenger.postinst: Make sure we error if puppet
    config print doesn't work
  - debian/puppetmaster-passenger.postinst: Ensure upgrades from
    <= 2.7.11-1 fixup passenger apache configuration.
* Dropped upstreamed patches:
  - debian/patches/CVE-2012-1906_CVE-2012-1986_to_CVE-2012-1989.patch
  - debian/patches/puppet-12844
  - debian/patches/2.7.17-Puppet-July-2012-CVE-fixes.patch
* Drop Build-Depends on ruby-rspec (in universe):
  - debian/control: remove ruby-rspec from Build-Depends
  - debian/patches/no-rspec.patch: make Rakefile work anyway if rspec
    isn't installed so we can use it in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
test_name "#6541: file type truncates target when filebucket cannot retrieve hash"
2
 
 
3
 
target="/tmp/6541-$$"
4
 
on agents, host_command('rm -rf #{host["puppetvardir"]}/*bucket')
5
 
 
6
 
step "write zero length file"
7
 
manifest = "file { '#{target}': content => '' }"
8
 
apply_manifest_on(agents, manifest)
9
 
 
10
 
step "overwrite file, causing zero-length file to be backed up"
11
 
manifest = "file { '#{target}': content => 'some text' }"
12
 
apply_manifest_on(agents, manifest)
13
 
 
14
 
test_name "verify invalid hashes should not change the file"
15
 
manifest = "file { '#{target}': content => '{md5}notahash' }"
16
 
agents.each do |host|
17
 
  apply_manifest_on(host, manifest) do
18
 
    assert_no_match(/content changed/, stdout, "#{host}: shouldn't have overwrote the file")
19
 
  end
20
 
end
21
 
 
22
 
test_name "verify valid but unbucketed hashes should not change the file"
23
 
manifest = "file { '#{target}': content => '{md5}13ad7345d56b566a4408ffdcd877bc78' }"
24
 
agents.each do |host|
25
 
  apply_manifest_on(host, manifest) do
26
 
    assert_no_match(/content changed/, stdout, "#{host}: shouldn't have overwrote the file")
27
 
  end
28
 
end
29
 
 
30
 
test_name "verify that an empty file can be retrieved from the filebucket"
31
 
manifest = "file { '#{target}': content => '{md5}d41d8cd98f00b204e9800998ecf8427e' }"
32
 
agents.each do |host|
33
 
  apply_manifest_on(host, manifest) do
34
 
    assert_match(/content changed '\{md5\}552e21cd4cd9918678e3c1a0df491bc3' to '\{md5\}d41d8cd98f00b204e9800998ecf8427e'/, stdout, "#{host}: shouldn't have overwrote the file")
35
 
  end
36
 
end