diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-01 03:14:09 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-01 03:14:09 +0000 |
| commit | 64382700d8bb42d281cea47078c53dce33e0c2cb (patch) | |
| tree | 207a415461127af0b6598aba807673f6ec59329f /test/ral/providers/user | |
| parent | c9de332e8ab75f234d79e2dc8a3fcd2949a1f224 (diff) | |
| download | puppet-64382700d8bb42d281cea47078c53dce33e0c2cb.tar.gz puppet-64382700d8bb42d281cea47078c53dce33e0c2cb.tar.xz puppet-64382700d8bb42d281cea47078c53dce33e0c2cb.zip | |
Adding a "supports_parameter?" method to test whether a given provider supports the features required by a given parameter. This is used during attribute instance creation, but its creation was necessicated by test code.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2444 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/ral/providers/user')
| -rwxr-xr-x | test/ral/providers/user/useradd.rb | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/test/ral/providers/user/useradd.rb b/test/ral/providers/user/useradd.rb index 97935f4a9..ca917f6c4 100755 --- a/test/ral/providers/user/useradd.rb +++ b/test/ral/providers/user/useradd.rb @@ -178,23 +178,9 @@ class UserAddProviderTest < PuppetTest::TestCase end def test_manages_password - if Facter.value(:kernel) != "Linux" - assert(! @provider.feature?(:manages_passwords), - "Defaulted to managing passwords on %s" % - Facter.value(:kernel)) - - # Now just make sure it's not allowed, and return - setup_user - assert_raise(Puppet::Error, "allowed passwd mgmt on failing host") do - @user[:password] = "yayness" - end + unless @provider.feature?(:manages_passwords) return end - - # Now, test that it works correctly. - assert(@provider.manages_passwords?, - "Defaulted to not managing passwords on %s" % - Facter.value(:kernel)) @vals[:password] = "somethingorother" setup_user @@ -244,6 +230,7 @@ end class UserRootAddProviderTest < PuppetTest::TestCase confine "useradd user provider missing" => Puppet::Type.type(:user).provider(:useradd).suitable? + confine "useradd does not manage passwords" => Puppet::Type.type(:user).provider(:useradd).manages_passwords? confine "not running as root" => (Process.uid == 0) def test_password |
