diff options
author | Luke Kanies <luke@madstop.com> | 2005-07-12 05:51:43 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-07-12 05:51:43 +0000 |
commit | 99a9f4b0c16b42ea16e1df9e38714697215fc308 (patch) | |
tree | 1c18cf5996eb0e412aba4a4752db363a0d79fabb /test | |
parent | d6e2102643ea380c5e7b63a722dae31ed499571d (diff) | |
download | puppet-99a9f4b0c16b42ea16e1df9e38714697215fc308.tar.gz puppet-99a9f4b0c16b42ea16e1df9e38714697215fc308.tar.xz puppet-99a9f4b0c16b42ea16e1df9e38714697215fc308.zip |
adding link functionality
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@376 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r-- | test/types/tc_file.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/types/tc_file.rb b/test/types/tc_file.rb index 6fd502fef..32a67cf41 100644 --- a/test/types/tc_file.rb +++ b/test/types/tc_file.rb @@ -137,6 +137,39 @@ class TestFile < Test::Unit::TestCase } end + # just test normal links + def test_normal_links + link = "/tmp/puppetlink" + assert_nothing_raised() { + @file[:link] = link + } + # assert we got a fully qualified link + assert(@file.state(:link).should =~ /^\//) + + # assert we aren't linking to ourselves + assert(File.expand_path(@file.state(:link).link) != + File.expand_path(@file[:path])) + + # assert the should value does point to us + assert_equal(File.expand_path(@file.state(:link).should), + File.expand_path(@file[:path])) + + assert_nothing_raised() { + @file.evaluate + } + assert_nothing_raised() { + @file.sync + } + assert_nothing_raised() { + @file.evaluate + } + assert(@file.insync?()) + assert_nothing_raised() { + @file.delete(:link) + } + system("rm -f %s" % link) + end + def test_checksums types = %w{md5 md5lite timestamp ctime} files = %w{/tmp/sumtest} |