From 4daf2c13ae5cdab4ee0de1fcb8ea7f0fc7b3573a Mon Sep 17 00:00:00 2001 From: luke Date: Mon, 3 Apr 2006 17:08:21 +0000 Subject: 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 --- test/types/package.rb | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'test') 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 -- cgit