~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to test/other/overrides.rb

  • Committer: Bazaar Package Importer
  • Author(s): Micah Anderson
  • Date: 2008-07-26 15:43:45 UTC
  • mto: (3.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20080726154345-1fmgo76b4l72ulvc
ImportĀ upstreamĀ versionĀ 0.24.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env ruby
2
2
 
3
 
$:.unshift("../lib").unshift("../../lib") if __FILE__ =~ /\.rb$/
 
3
require File.dirname(__FILE__) + '/../lib/puppettest'
4
4
 
5
5
require 'puppet'
6
6
require 'puppettest'
27
27
        basefile = File.join(basedir, "file")
28
28
        assert_nothing_raised("Could not create base obj") {
29
29
            baseobj = Puppet.type(:file).create(
 
30
                :title => "base",
30
31
                :path => basedir,
31
32
                :recurse => true,
32
33
                :mode => "755"
38
39
        subfile = File.join(subdir, "file")
39
40
        assert_nothing_raised("Could not create sub obj") {
40
41
            subobj = Puppet.type(:file).create(
 
42
                :title => "sub",
41
43
                :path => subdir,
42
44
                :recurse => true,
43
45
                :mode => "644"
44
46
            )
45
47
        }
46
48
 
47
 
        comp = newcomp("overrides", baseobj, subobj)
48
 
        assert_nothing_raised("Could not eval component") {
49
 
            trans = comp.evaluate
50
 
            trans.evaluate
51
 
        }
 
49
        assert_apply(baseobj, subobj)
52
50
 
53
51
        assert(File.stat(basefile).mode & 007777 == 0755)
54
52
        assert(File.stat(subfile).mode & 007777 == 0644)
55
53
    end
56
54
 
57
 
    def test_zdeepoverride
 
55
    def test_deepoverride
58
56
        basedir = File.join(tmpdir(), "deepoverridetesting")
59
57
        mksubdirs(basedir, 10)
60
58
 
92
90
            }
93
91
        }
94
92
 
95
 
        comp = newcomp("overrides", baseobj)
96
 
        children.each { |child| comp.push child }
 
93
        config = mk_catalog(baseobj, *children)
97
94
 
98
95
        assert_nothing_raised("Could not eval component") {
99
 
            trans = comp.evaluate
100
 
            trans.evaluate
 
96
            config.apply
101
97
        }
102
98
 
103
99
        files.each { |path, mode|
109
105
    end
110
106
end
111
107
 
112
 
# $Id: overrides.rb 1793 2006-10-16 22:01:40Z luke $