summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-10 00:43:02 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-10 00:43:02 +0000
commitd3b76d6e0d8891c8109d559f61363cd11c246529 (patch)
tree8c48bd24b1d447e8b4bacf92658d2b31d90b08ab /test
parentcdd1e6e19e7b8fc340ebcf543a30564c76e71eb9 (diff)
Removing the symlink type finally.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1900 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/types/symlink.rb117
1 files changed, 0 insertions, 117 deletions
diff --git a/test/types/symlink.rb b/test/types/symlink.rb
deleted file mode 100755
index 4c6f3550f..000000000
--- a/test/types/symlink.rb
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift("../lib").unshift("../../lib") if __FILE__ =~ /\.rb$/
-
-require 'puppet'
-require 'puppettest'
-
-# $Id$
-
-class TestSymlink < Test::Unit::TestCase
- include PuppetTest::FileTesting
- def mktmpfile
- # because luke's home directory is on nfs, it can't be used for testing
- # as root
- tmpfile = tempfile()
- File.open(tmpfile, "w") { |f| f.puts rand(100) }
- @@tmpfiles.push tmpfile
- return tmpfile
- end
-
- def mktmpdir
- dir = File.join(tmpdir(), "puppetlinkdir")
- unless FileTest.exists?(dir)
- Dir.mkdir(dir)
- end
- @@tmpfiles.push dir
- return dir
- end
-
- def tmplink
- link = File.join(tmpdir(), "puppetlinktest")
- @@tmpfiles.push link
- return link
- end
-
- def newlink(hash = {})
- hash[:name] = tmplink()
- unless hash.include?(:ensure)
- hash[:ensure] = mktmpfile()
- end
-
- link = Puppet.type(:symlink).create(hash)
- return link
- end
-
- def test_target
- link = nil
- file = mktmpfile()
- assert_nothing_raised() {
- link = newlink()
- }
- assert_nothing_raised() {
- link.retrieve
- }
- # we might already be in sync
- assert(!link.insync?())
- assert_apply(link)
- assert_nothing_raised() {
- link.retrieve
- }
- assert(link.insync?())
- end
-
- def test_recursion
- source = mktmpdir()
- FileUtils.cd(source) {
- mkranddirsandfiles()
- }
-
- link = nil
- assert_nothing_raised {
- link = newlink(:ensure => source, :recurse => true)
- }
- comp = newcomp(link)
- cycle(comp)
-
- path = link.name
- assert(FileTest.directory?(path), "Did not make %s" % path)
- list = file_list(path)
- FileUtils.cd(path) {
- list.each { |file|
- unless FileTest.directory?(file)
- assert(FileTest.symlink?(file), "file %s is not a symlink" %
- file)
- target = File.readlink(file)
- assert_equal(target,File.join(source,file.sub(/^\.\//,'')))
- end
- }
- }
- end
-
- def disabled_test_createdrecursion
- source = tempfile()
- file = File.join(source, "file")
- dest = tempfile()
- link = File.join(dest, "file")
-
- objects = []
- objects << Puppet.type(:file).create(
- :path => source,
- :ensure => "directory"
- )
- objects << Puppet.type(:file).create(
- :path => file,
- :ensure => "file"
- )
- objects << Puppet.type(:symlink).create(
- :path => dest,
- :ensure => source,
- :recurse => true
- )
-
- assert_apply(*objects)
-
- assert(FileTest.symlink?(link), "Link was not created")
- end
-end