summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-03 17:08:21 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-03 17:08:21 +0000
commit4daf2c13ae5cdab4ee0de1fcb8ea7f0fc7b3573a (patch)
tree2c1f1c8c18c2f589b1c771422ed705eb040cf172 /test
parentf37154e69e57049f2bf6870d2c524fa29c3c0e35 (diff)
downloadpuppet-4daf2c13ae5cdab4ee0de1fcb8ea7f0fc7b3573a.tar.gz
puppet-4daf2c13ae5cdab4ee0de1fcb8ea7f0fc7b3573a.tar.xz
puppet-4daf2c13ae5cdab4ee0de1fcb8ea7f0fc7b3573a.zip
Adding apple package support, but it is very limited -- packages can only be installed, not upgraded or removed.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1055 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/types/package.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/types/package.rb b/test/types/package.rb
index 2fe29aecf..224e7a5f6 100644
--- a/test/types/package.rb
+++ b/test/types/package.rb
@@ -167,6 +167,7 @@ class TestPackages < Test::Unit::TestCase
def test_latestpkg
mkpkgs { |pkg|
+ next unless pkg.respond_to? :latest
assert_nothing_raised {
assert(pkg.latest, "Package did not return value for 'latest'")
}
@@ -283,6 +284,43 @@ class TestPackages < Test::Unit::TestCase
assert(pkg.insync?, "Package is not in sync")
end
end
+
+ # Stupid darwin, not supporting package uninstallation
+ if Facter["operatingsystem"].value == "Darwin"
+ def test_darwinpkgs
+ pkg = nil
+ assert_nothing_raised {
+ pkg = Puppet::Type.type(:package).create(
+ :name => "pkgtesting",
+ :source => "/Users/luke/Documents/Puppet/pkgtesting.pkg",
+ :ensure => :present
+ )
+ }
+
+ assert_nothing_raised {
+ pkg.retrieve
+ }
+
+ if pkg.insync?
+ Puppet.notice "Test package is already installed; please remove it"
+ next
+ end
+
+ # The file installed, and the receipt
+ @@tmpfiles << "/tmp/file"
+ @@tmpfiles << "/Library/Receipts/pkgtesting.pkg"
+
+ assert_events([:package_created], pkg, "package")
+
+ assert_nothing_raised {
+ pkg.retrieve
+ }
+
+ assert(pkg.insync?, "Package is not insync")
+
+ assert(FileTest.exists?("/tmp/pkgtesting/file"), "File did not get created")
+ end
+ end
end
end
end