summaryrefslogtreecommitdiffstats
path: root/test/executables
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-02-19 16:51:50 -0600
committerLuke Kanies <luke@madstop.com>2009-02-19 17:51:22 -0600
commitc0d5037d11643fd551fdc9f20a9e0ba196c5345a (patch)
treec206a8dcd267b61d6ed1bf17d374558126672992 /test/executables
parent262937ff6e505bbf86d15500279ff23398f9e1c8 (diff)
downloadpuppet-c0d5037d11643fd551fdc9f20a9e0ba196c5345a.tar.gz
puppet-c0d5037d11643fd551fdc9f20a9e0ba196c5345a.tar.xz
puppet-c0d5037d11643fd551fdc9f20a9e0ba196c5345a.zip
Removing or fixing old tests
Most of these were just obsolete tests that have been sitting around and broke with recent internal changes. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'test/executables')
-rwxr-xr-xtest/executables/filebucket.rb48
-rwxr-xr-xtest/executables/puppetbin.rb104
-rwxr-xr-xtest/executables/puppetd.rb55
3 files changed, 0 insertions, 207 deletions
diff --git a/test/executables/filebucket.rb b/test/executables/filebucket.rb
deleted file mode 100755
index 491630707..000000000
--- a/test/executables/filebucket.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env ruby
-
-require File.dirname(__FILE__) + '/../lib/puppettest'
-
-require 'puppet'
-require 'puppet/network/client'
-require 'puppettest'
-require 'socket'
-require 'facter'
-
-class TestFileBucketExe < Test::Unit::TestCase
- include PuppetTest::ExeTest
-
- def test_local
- bucket = tempfile
- file = tempfile
- text = "somet ext"
- md5 = Digest::MD5.hexdigest(text)
- File.open(file, "w") { |f| f.print text }
- out = %x{filebucket --bucket #{bucket} backup #{file}}
-
- outfile, outmd5 = out.chomp.split(": ")
-
- assert_equal(0, $?, "filebucket did not run successfully")
-
- assert_equal(file, outfile, "did not output correct file name")
- assert_equal(md5, outmd5, "did not output correct md5 sum")
-
- dipper = Puppet::Network::Client.dipper.new(:Path => bucket)
-
- newtext = nil
- assert_nothing_raised("Could not get file from bucket") do
- newtext = dipper.getfile(md5)
- end
-
- assert_equal(text, newtext, "did not get correct file from md5 sum")
-
- out = %x{filebucket --bucket #{bucket} get #{md5}}
- assert_equal(0, $?, "filebucket did not run successfully")
- assert_equal(text, out, "did not get correct text back from filebucket")
-
- File.open(file, "w") { |f| f.puts "some other txt" }
- out = %x{filebucket --bucket #{bucket} restore #{file} #{md5}}
- assert_equal(0, $?, "filebucket did not run successfully")
- assert_equal(text, File.read(file), "file was not restored")
- end
-end
-
diff --git a/test/executables/puppetbin.rb b/test/executables/puppetbin.rb
deleted file mode 100755
index 08329efb6..000000000
--- a/test/executables/puppetbin.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env ruby
-
-require File.dirname(__FILE__) + '/../lib/puppettest'
-
-require 'puppettest'
-
-class TestPuppetBin < Test::Unit::TestCase
- include PuppetTest::ExeTest
- def test_version
- output = nil
- assert_nothing_raised {
- output = %x{puppet --version}.chomp
- }
- assert_equal(Puppet.version, output)
- end
-
- def test_execution
- file = mktestmanifest()
-
- output = nil
- cmd = "puppet"
- if Puppet[:debug]
- cmd += " --debug"
- end
- cmd += " --confdir %s" % Puppet[:confdir]
- cmd += " --vardir %s" % Puppet[:vardir]
- unless Puppet[:debug]
- cmd += " --logdest %s" % "/dev/null"
- end
-
- assert_nothing_raised {
- output = %x{#{cmd + " " + file} 2>&1}
- }
- assert($? == 0, "Puppet exited with code %s" % $?.to_i)
-
- assert(FileTest.exists?(@createdfile), "Failed to create config'ed file")
- end
-
- def test_inlineexecution
- path = tempfile()
- code = "file { '#{path}': ensure => file }"
-
- output = nil
- cmd = "puppet"
- if Puppet[:debug]
- cmd += " --debug"
- end
- #cmd += " --fqdn %s" % fqdn
- cmd += " --confdir %s" % Puppet[:confdir]
- cmd += " --vardir %s" % Puppet[:vardir]
- unless Puppet[:debug]
- cmd += " --logdest %s" % "/dev/null"
- end
-
- cmd += " -e \"#{code}\""
-
- assert_nothing_raised {
- out = %x{#{cmd} 2>&1}
- }
- assert($? == 0, "Puppet exited with code %s" % $?.to_i)
-
- assert(FileTest.exists?(path), "Failed to create config'ed file")
- end
-
- def test_stdin_execution
- path = tempfile()
- manifest = tempfile()
- env = %x{which env}.chomp
- if env == ""
- Puppet.info "cannot find env; cannot test stdin_execution"
- return
- end
- File.open(manifest, "w") do |f|
- f.puts "#!#{env} puppet
- file { '#{path}': ensure => file }"
- end
- File.chmod(0755, manifest)
-
- assert_nothing_raised {
- out = %x{#{manifest} 2>&1}
- }
- assert($? == 0, "manifest exited with code %s" % $?.to_i)
-
- assert(FileTest.exists?(path), "Failed to create config'ed file")
- end
-
- def test_parseonly
- path = tempfile()
- manifest = tempfile()
- puppet = %x{which puppet}.chomp
- if puppet == ""
- Puppet.info "cannot find puppet; cannot test parseonly"
- return
- end
- code = 'File <<| |>>
- include nosuchclass'
-
- assert_nothing_raised {
- IO.popen("#{puppet} --parseonly", 'w') { |p| p.puts code }
- }
- assert($? == 0, "parseonly test exited with code %s" % $?.to_i)
- end
-end
-
diff --git a/test/executables/puppetd.rb b/test/executables/puppetd.rb
deleted file mode 100755
index d770ff91e..000000000
--- a/test/executables/puppetd.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env ruby
-
-require File.dirname(__FILE__) + '/../lib/puppettest'
-
-require 'puppet'
-require 'puppet/network/client'
-require 'puppettest'
-require 'socket'
-require 'facter'
-
-class TestPuppetDExe < Test::Unit::TestCase
- include PuppetTest::ExeTest
- def setup
- super
- Puppet[:certdnsnames] = "localhost"
- # start the master
- @manifest = startmasterd
-
-
- @cmd = "puppetd"
- @cmd += " --verbose"
- @cmd += " --test"
- @cmd += " --masterport %s" % @@port
- @cmd += " --confdir %s" % Puppet[:confdir]
- @cmd += " --rundir %s" % File.join(Puppet[:vardir], "run")
- @cmd += " --vardir %s" % Puppet[:vardir]
- @cmd += " --server localhost"
- end
-
- def test_normalstart
- # and verify our daemon runs
- output = nil
- assert_nothing_raised {
- output = %x{#{@cmd} 2>&1}
- }
- sleep 1
- assert($? == 0, "Puppetd exited with code %s" % $?)
-
- assert(FileTest.exists?(@createdfile), "Failed to create file %s" % @createdfile)
- end
-
- # now verify that --noop works
- def test_noop_start
- @cmd += " --noop"
- assert_nothing_raised {
- output = %x{#{@cmd}}.chomp
- }
- sleep 1
- assert($? == 0, "Puppetd exited with code %s" % $?)
-
- assert(! FileTest.exists?(@createdfile),
- "Noop created config'ed file")
- end
-end
-