~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to .pc/CVE-2011-3872.patch/test/network/client/dipper.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env ruby
2
 
 
3
 
require File.expand_path(File.dirname(__FILE__) + '/../../lib/puppettest')
4
 
 
5
 
require 'puppettest'
6
 
require 'puppet/file_bucket/dipper'
7
 
 
8
 
class TestDipperClient < Test::Unit::TestCase
9
 
  include PuppetTest::ServerTest
10
 
 
11
 
  def setup
12
 
    super
13
 
    @dipper = Puppet::FileBucket::Dipper.new(:Path => tempfile)
14
 
  end
15
 
 
16
 
  # Make sure we can create a new file with 'restore'.
17
 
  def test_restore_to_new_file
18
 
    file = tempfile
19
 
    text = "asdf;lkajseofiqwekj"
20
 
    File.open(file, "w") { |f| f.puts text }
21
 
    md5 = nil
22
 
    assert_nothing_raised("Could not send file") do
23
 
      md5 = @dipper.backup(file)
24
 
    end
25
 
 
26
 
    newfile = tempfile
27
 
    assert_nothing_raised("could not restore to new path") do
28
 
      @dipper.restore(newfile, md5)
29
 
    end
30
 
 
31
 
    assert_equal(File.read(file), File.read(newfile), "did not restore correctly")
32
 
  end
33
 
end
34