diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-08-30 01:33:36 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-08-30 01:33:36 +0000 |
| commit | cff3a5b6cf3867287e1d1d76100f5f7744faa383 (patch) | |
| tree | 6d7db4e78b14077cd464c0e5f3ee0d23f9426db0 /test | |
| parent | 998b4155dfc7a783b6dba5beafa272b579e98381 (diff) | |
| download | puppet-cff3a5b6cf3867287e1d1d76100f5f7744faa383.tar.gz puppet-cff3a5b6cf3867287e1d1d76100f5f7744faa383.tar.xz puppet-cff3a5b6cf3867287e1d1d76100f5f7744faa383.zip | |
fileserver config file now reloads when it is more than 60 seconds out of date
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@610 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/server/tc_fileserver.rb | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/test/server/tc_fileserver.rb b/test/server/tc_fileserver.rb index 29895a38e..7c0ad9570 100755 --- a/test/server/tc_fileserver.rb +++ b/test/server/tc_fileserver.rb @@ -531,6 +531,70 @@ class TestFileServer < TestPuppet } end + + def test_filereread + server = nil + testdir = "/tmp/filerereadtesting" + + @@tmpfiles << testdir + + #Dir.mkdir(testdir) + files = mktestfiles(testdir) + + conffile = "/tmp/fileservertestingfile" + @@tmpfiles << conffile + + File.open(conffile, "w") { |f| + f.print "# a test config file + +[thing] + path #{testdir} + allow test1.domain.com +" + } + + + assert_nothing_raised { + server = Puppet::Server::FileServer.new( + :Local => true, + :ConfigTimeout => 0.5, + :Config => conffile + ) + } + + list = nil + assert_nothing_raised { + list = server.list("/thing/", false, "test1.domain.com", "127.0.0.1") + } + assert(list != "", "List returned nothing in rereard test") + + assert_raise(Puppet::Server::AuthorizationError, "List allowed invalid host") { + list = server.list("/thing/", false, "test2.domain.com", "127.0.0.1") + } + + sleep 1 + File.open(conffile, "w") { |f| + f.print "# a test config file + +[thing] + path #{testdir} + allow test2.domain.com +" + } + + assert_raise(Puppet::Server::AuthorizationError, "List allowed invalid host") { + list = server.list("/thing/", false, "test1.domain.com", "127.0.0.1") + } + + assert_nothing_raised { + list = server.list("/thing/", false, "test2.domain.com", "127.0.0.1") + } + + assert(list != "", "List returned nothing in rereard test") + + list = nil + end + end # $Id$ |
