summaryrefslogtreecommitdiffstats
path: root/test/util
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-12-27 12:43:52 +1100
committerJames Turnbull <james@lovedthanlost.net>2008-12-27 12:43:52 +1100
commit4c648bb1e7428806550f57160f72892709b0a30f (patch)
treefeb1108c0608a95ec088554dae7753d2c9609a14 /test/util
parent34335b7a2e6950d4bb3dcaaf2bfe88cbc684007e (diff)
parent7403330c4f63c290ba3cc5992706a3f0b1c9caa0 (diff)
downloadpuppet-4c648bb1e7428806550f57160f72892709b0a30f.tar.gz
puppet-4c648bb1e7428806550f57160f72892709b0a30f.tar.xz
puppet-4c648bb1e7428806550f57160f72892709b0a30f.zip
Merge branch '0.24.x'
Conflicts: CHANGELOG
Diffstat (limited to 'test/util')
-rwxr-xr-xtest/util/storage.rb24
-rwxr-xr-xtest/util/utiltest.rb33
2 files changed, 0 insertions, 57 deletions
diff --git a/test/util/storage.rb b/test/util/storage.rb
index 531d1e7e1..cc378c690 100755
--- a/test/util/storage.rb
+++ b/test/util/storage.rb
@@ -63,30 +63,6 @@ class TestStorage < Test::Unit::TestCase
assert_equal(state["name"], hash)
end
- # we're getting corrupt files, probably because multiple processes
- # are reading or writing the file at once
- # so we need to test that
- def test_multiwrite
- f = mkfile()
-
- value = {:a => :b}
- threads = []
- 9.times { |a|
- threads << Thread.new {
- 9.times { |b|
- assert_nothing_raised {
- Puppet::Util::Storage.load
- state = Puppet::Util::Storage.cache(f)
- value.each { |k,v| state[k] = v }
- state[:e] = rand(100)
- Puppet::Util::Storage.store
- }
- }
- }
- }
- threads.each { |th| th.join }
- end
-
def test_emptyrestore
Puppet::Util::Storage.load
Puppet::Util::Storage.store
diff --git a/test/util/utiltest.rb b/test/util/utiltest.rb
index a8dfca9c2..41c9b517a 100755
--- a/test/util/utiltest.rb
+++ b/test/util/utiltest.rb
@@ -8,39 +8,6 @@ require 'mocha'
class TestPuppetUtil < Test::Unit::TestCase
include PuppetTest
- # we're getting corrupt files, probably because multiple processes
- # are reading or writing the file at once
- # so we need to test that
- def test_multiwrite
- file = tempfile()
- File.open(file, "w") { |f| f.puts "starting" }
-
- value = {:a => :b}
- threads = []
- sync = Sync.new
- 9.times { |a|
- threads << Thread.new {
- 9.times { |b|
- assert_nothing_raised {
- sync.synchronize(Sync::SH) {
- Puppet::Util.readlock(file) { |f|
- f.read
- }
- }
- sleep 0.01
- sync.synchronize(Sync::EX) {
- Puppet::Util.writelock(file) { |f|
- f.puts "%s %s" % [a, b]
- }
- }
- }
- }
- }
- }
- threads.each { |th| th.join }
- end
-
-
def test_withumask
oldmask = File.umask