diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-02 21:58:19 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-02 21:58:19 +0000 |
| commit | 72774bbd4ade3d249970cf049d3824c6891ac66e (patch) | |
| tree | 268ca1d35f5e8c331e201efac337893ee09bce87 /test | |
| parent | e6f9163c543c19756887b7be04e01fb51789070e (diff) | |
adding mkdir equivalent of Config#write
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1052 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/other/config.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/other/config.rb b/test/other/config.rb index 2714eab17..23c0e2725 100755 --- a/test/other/config.rb +++ b/test/other/config.rb @@ -551,6 +551,36 @@ yay = /a/path assert_equal(group.gid, File.stat(path).gid, "GIDS are not equal") end end + + def test_mkdir + path = tempfile() + mode = 0755 + + config = mkconfig + + args = { :default => path, :mode => mode } + + user = nonrootuser() + group = nonrootgroup() + + if Process.uid == 0 + args[:owner] = user.name + args[:group] = group.name + end + + config.setdefaults(:testing, :mydir => args) + + assert_nothing_raised { + config.mkdir(:mydir) + } + + assert_equal(mode, filemode(path), "Modes are not equal") + + if Process.uid == 0 + assert_equal(user.uid, File.stat(path).uid, "UIDS are not equal") + assert_equal(group.gid, File.stat(path).gid, "GIDS are not equal") + end + end end # $Id$ |
