diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-24 21:16:20 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-24 21:16:20 +0000 |
| commit | 52df47e489d390be9b466da3ef16c2379b9dddba (patch) | |
| tree | d5006c428e3fae2646a6f60b5e7333dc2da31e87 /test/network/client | |
| parent | def15e3de0a488f2f9d75eeb43d04381742609f6 (diff) | |
Finalizing the filebucket client, with test code.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2348 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/network/client')
| -rwxr-xr-x | test/network/client/dipper.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/network/client/dipper.rb b/test/network/client/dipper.rb new file mode 100755 index 000000000..e91dea2a7 --- /dev/null +++ b/test/network/client/dipper.rb @@ -0,0 +1,35 @@ +#!/usr/bin/env ruby + +$:.unshift("../../lib") if __FILE__ =~ /\.rb$/ + +require 'puppettest' +require 'puppet/network/client/resource' + +class TestDipperClient < Test::Unit::TestCase + include PuppetTest::ServerTest + + def setup + super + @dipper = Puppet::Network::Client.dipper.new(:Path => tempfile) + end + + # Make sure we can create a new file with 'restore'. + def test_restore_to_new_file + file = tempfile + text = "asdf;lkajseofiqwekj" + File.open(file, "w") { |f| f.puts text } + md5 = nil + assert_nothing_raised("Could not send file") do + md5 = @dipper.backup(file) + end + + newfile = tempfile + assert_nothing_raised("could not restore to new path") do + @dipper.restore(newfile, md5) + end + + assert_equal(File.read(file), File.read(newfile), "did not restore correctly") + end +end + +# $Id$ |
