Many of the Puppet resource acceptance tests were RHEL/Centos
specifc.  These tests were ported under the enterptise-dist
repo; move the tests into 2.6.x for merging.

Signed-off-by: Dominic Maraglia <[email protected]>
---
 .../tests/resource/cron/should_create_cron.rb      |    6 ++--
 .../tests/resource/cron/should_match_existing.rb   |   13 +++----
 .../tests/resource/cron/should_remove_cron.rb      |   12 +++---
 .../tests/resource/cron/should_remove_matching.rb  |    8 ++--
 .../tests/resource/cron/should_update_existing.rb  |   14 +++----
 .../tests/resource/file/content_attribute.rb       |   35 ++++++++++++++------
 .../tests/resource/file/should_create_directory.rb |    4 +-
 .../tests/resource/file/should_create_empty.rb     |    6 ++--
 .../tests/resource/file/should_create_symlink.rb   |    5 ++-
 .../tests/resource/file/should_remove_dir.rb       |    2 +-
 .../tests/resource/file/should_remove_file.rb      |    2 +-
 .../tests/resource/file/source_attribtute.rb       |   30 ++++++++++-------
 acceptance/tests/resource/group/should_create.rb   |    4 +-
 .../tests/resource/group/should_modify_gid.rb      |   19 ++++++-----
 acceptance/tests/resource/host/should_create.rb    |    2 +-
 .../tests/resource/host/should_create_aliases.rb   |    2 +-
 acceptance/tests/resource/host/should_destroy.rb   |    2 +-
 .../tests/resource/host/should_modify_alias.rb     |    2 +-
 acceptance/tests/resource/host/should_modify_ip.rb |    2 +-
 .../resource/host/should_not_create_existing.rb    |    2 +-
 acceptance/tests/resource/host/should_query.rb     |    2 +-
 acceptance/tests/resource/host/should_query_all.rb |    2 +-
 .../ticket_4123_should_list_all_running_redhat.rb  |    7 ++--
 acceptance/tests/resource/user/should_create.rb    |   14 +++++---
 .../tests/resource/user/should_create_with_gid.rb  |    6 ++--
 acceptance/tests/resource/user/should_destroy.rb   |    2 +-
 .../tests/resource/user/should_modify_gid.rb       |    6 ++--
 .../resource/user/should_not_destoy_unexisting.rb  |    2 +-
 acceptance/tests/resource/user/should_query.rb     |    2 +-
 29 files changed, 119 insertions(+), 96 deletions(-)

diff --git a/acceptance/tests/resource/cron/should_create_cron.rb 
b/acceptance/tests/resource/cron/should_create_cron.rb
index e455614..5badac0 100644
--- a/acceptance/tests/resource/cron/should_create_cron.rb
+++ b/acceptance/tests/resource/cron/should_create_cron.rb
@@ -1,6 +1,6 @@
 test_name "should create cron"
 
-tmpuser = "cron-test-#{Time.new.to_i}"
+tmpuser = "pl#{rand(999999).to_i}"
 tmpfile = "/tmp/cron-test-#{Time.new.to_i}"
 
 create_user = "user { '#{tmpuser}': ensure => present, managehome => false }"
@@ -18,13 +18,13 @@ agents.each do |host|
     end
 
     step "verify that crontab -l contains what you expected"
-    on host, "crontab -l -u #{tmpuser}" do
+    run_cron_on(host, :list, tmpuser) do
         fail_test "didn't find the command as expected" unless
             stdout.include? "* * * * * /bin/true"
     end
 
     step "remove the crontab file for that user"
-    on host, "crontab -r -u #{tmpuser}"
+    run_cron_on(host, :remove, tmpuser)
 
     step "remove the user from the system"
     apply_manifest_on host, delete_user
diff --git a/acceptance/tests/resource/cron/should_match_existing.rb 
b/acceptance/tests/resource/cron/should_match_existing.rb
index b34a049..b5c5d35 100755
--- a/acceptance/tests/resource/cron/should_match_existing.rb
+++ b/acceptance/tests/resource/cron/should_match_existing.rb
@@ -1,6 +1,6 @@
+test_name "puppet should match existing job"
 
-
-tmpuser = "cron-test-#{Time.new.to_i}"
+tmpuser = "pl#{rand(999999).to_i}"
 tmpfile = "/tmp/cron-test-#{Time.new.to_i}"
 
 create_user = "user { '#{tmpuser}': ensure => present, managehome => false }"
@@ -11,14 +11,11 @@ agents.each do |host|
     apply_manifest_on host, create_user
 
     step "create the existing job by hand..."
-    on host, "echo '* * * * * /bin/true' | crontab -u #{tmpuser} -"
+    run_cron_on(host,:add,tmpuser,"* * * * * /bin/true")
 
     step "apply the resource on the host using puppet resource"
     on(host, puppet_resource("cron", "crontest", "user=#{tmpuser}",
                   "command=/bin/true", "ensure=present")) do
-        # REVISIT: This is ported from the original test, which seems to me a
-        # weak test, but I don't want to improve it now.  --daniel 2010-12-23
-        # 
         # This is a weak/fragile test.  The output has changed
         # causing this test to fail erronously.  Changed to the correct
         # output to match, but this code should be re-feactored.
@@ -27,13 +24,13 @@ agents.each do |host|
     end
 
     step "verify that crontab -l contains what you expected"
-    on host, "crontab -l -u #{tmpuser}" do
+    run_cron_on(host, :list, tmpuser) do
         fail_test "didn't find the command as expected" unless
             stdout.include? "* * * * * /bin/true"
     end
 
     step "remove the crontab file for that user"
-    on host, "crontab -r -u #{tmpuser}"
+    run_cron_on(host, :remove, tmpuser)
 
     step "remove the user from the system"
     apply_manifest_on host, delete_user
diff --git a/acceptance/tests/resource/cron/should_remove_cron.rb 
b/acceptance/tests/resource/cron/should_remove_cron.rb
index 035a0f7..9956d0d 100755
--- a/acceptance/tests/resource/cron/should_remove_cron.rb
+++ b/acceptance/tests/resource/cron/should_remove_cron.rb
@@ -1,6 +1,6 @@
 test_name "puppet should remove a crontab entry as expected"
 
-tmpuser = "cron-test-#{Time.new.to_i}"
+tmpuser = "pl#{rand(999999).to_i}"
 tmpfile = "/tmp/cron-test-#{Time.new.to_i}"
 
 create_user = "user { '#{tmpuser}': ensure => present, managehome => false }"
@@ -11,7 +11,7 @@ agents.each do |host|
     apply_manifest_on host, create_user
 
     step "create the existing job by hand..."
-    on host, "printf '# Puppet Name: crontest\n* * * * * /bin/true\n' | 
crontab -u #{tmpuser} -"
+    run_cron_on(host,:add,tmpuser,"* * * * * /bin/true")
 
     step "apply the resource on the host using puppet resource"
     on(host, puppet_resource("cron", "crontest", "user=#{tmpuser}",
@@ -23,13 +23,13 @@ agents.each do |host|
     end
 
     step "verify that crontab -l contains what you expected"
-    on host, "crontab -l -u #{tmpuser}" do
-        fail_test "didn't found the command we tried to remove" if
-            stdout.include? "/bin/true"
+    run_cron_on(host, :list, tmpuser) do
+      fail_test "didn't found the command we tried to remove" if
+        stdout.include? "/bin/true"
     end
 
     step "remove the crontab file for that user"
-    on host, "crontab -r -u #{tmpuser}"
+    run_cron_on(host, :remove, tmpuser)
 
     step "remove the user from the system"
     apply_manifest_on host, delete_user
diff --git a/acceptance/tests/resource/cron/should_remove_matching.rb 
b/acceptance/tests/resource/cron/should_remove_matching.rb
index e669f29..f4de0de 100755
--- a/acceptance/tests/resource/cron/should_remove_matching.rb
+++ b/acceptance/tests/resource/cron/should_remove_matching.rb
@@ -1,6 +1,6 @@
 test_name "puppet should remove a crontab entry based on command matching"
 
-tmpuser = "cron-test-#{Time.new.to_i}"
+tmpuser = "pl#{rand(999999).to_i}"
 tmpfile = "/tmp/cron-test-#{Time.new.to_i}"
 
 cron = '# Puppet Name: crontest\n* * * * * /bin/true\n1 1 1 1 1 /bin/true\n'
@@ -13,7 +13,7 @@ agents.each do |host|
     apply_manifest_on host, create_user
 
     step "create the existing job by hand..."
-    on host, "printf '#{cron}' | crontab -u #{tmpuser} -"
+    run_cron_on(host,:add,tmpuser,"* * * * * /bin/true")
 
     step "apply the resource change on the host"
     on(host, puppet_resource("cron", "bogus", "user=#{tmpuser}",
@@ -23,13 +23,13 @@ agents.each do |host|
     end
 
     step "verify that crontab -l contains what you expected"
-    on host, "crontab -l -u #{tmpuser}" do
+    run_cron_on(host,:list,tmpuser) do
         count = stdout.scan("/bin/true").length
         fail_test "found /bin/true the wrong number of times (#{count})" 
unless count == 1
     end
 
     step "remove the crontab file for that user"
-    on host, "crontab -r -u #{tmpuser}"
+    run_cron_on(host,:remove,tmpuser)
 
     step "remove the user from the system"
     apply_manifest_on host, delete_user
diff --git a/acceptance/tests/resource/cron/should_update_existing.rb 
b/acceptance/tests/resource/cron/should_update_existing.rb
index 3a2a537..ff17930 100755
--- a/acceptance/tests/resource/cron/should_update_existing.rb
+++ b/acceptance/tests/resource/cron/should_update_existing.rb
@@ -1,10 +1,8 @@
 test_name "puppet should update existing crontab entry"
 
-tmpuser = "cron-test-#{Time.new.to_i}"
+tmpuser = "pl#{rand(999999).to_i}"
 tmpfile = "/tmp/cron-test-#{Time.new.to_i}"
 
-cron = '# Puppet Name: crontest\n* * * * * /bin/true\n'
-
 create_user = "user { '#{tmpuser}': ensure => present, managehome => false }"
 delete_user = "user { '#{tmpuser}': ensure => absent,  managehome => false }"
 
@@ -13,10 +11,10 @@ agents.each do |host|
     apply_manifest_on host, create_user
 
     step "create the existing job by hand..."
-    on host, "printf '#{cron}' | crontab -u #{tmpuser} -"
+    run_cron_on(host,:add,tmpuser,"* * * * * /bin/true")
 
     step "verify that crontab -l contains what you expected"
-    on host, "crontab -l -u #{tmpuser}" do
+    run_cron_on(host,:list,tmpuser) do
         fail_test "didn't find the content in the crontab" unless
             stdout.include? '* * * * * /bin/true'
     end
@@ -25,17 +23,17 @@ agents.each do |host|
     on(host, puppet_resource("cron", "crontest", "user=#{tmpuser}",
                   "command=/bin/true", "ensure=present", "hour='0-6'")) do
         fail_test "didn't update the time as expected" unless
-            stdout.include? "defined 'hour' as '0-6'"
+            stdout.include? "hour => ['0-6']"
     end
 
     step "verify that crontab -l contains what you expected"
-    on host, "crontab -l -u #{tmpuser}" do
+    run_cron_on(host,:list,tmpuser) do
         fail_test "didn't find the content in the crontab" unless
             stdout.include? '* 0-6 * * * /bin/true'
     end
 
     step "remove the crontab file for that user"
-    on host, "crontab -r -u #{tmpuser}"
+    run_cron_on(host,:remove,tmpuser)
 
     step "remove the user from the system"
     apply_manifest_on host, delete_user
diff --git a/acceptance/tests/resource/file/content_attribute.rb 
b/acceptance/tests/resource/file/content_attribute.rb
index 4458e07..31dbac1 100644
--- a/acceptance/tests/resource/file/content_attribute.rb
+++ b/acceptance/tests/resource/file/content_attribute.rb
@@ -1,25 +1,33 @@
-test_name "The content attribute"
-pass_test "Pass forced pending test failure investigation"
+test_name "Content Attribute"
 
 step "Ensure the test environment is clean"
 on agents, 'rm -f /tmp/content_file_test.txt'
 
-step "When using raw content"
+step "Content Attribute: using raw content"
 
 manifest = "file { '/tmp/content_file_test.txt': content => 'This is the test 
file content', ensure => present }"
 apply_manifest_on agents, manifest
 
-on agents, 'test "$(cat /tmp/content_file_test.txt)" = "This is the test file 
content"'
+agents.each do |host|
+  on host, "cat /tmp/content_file_test.txt" do
+    assert_match(/This is the test file content/, stdout, "File content not 
matched on #{host}")
+  end
+end
 
 step "Ensure the test environment is clean"
 on agents, 'rm -f /tmp/content_file_test.txt'
 
-step "When using a filebucket checksum from filebucket"
-
+step "Content Attribute: using a checksum from filebucket"
 on agents, "echo 'This is the checksum file contents' > 
/tmp/checksum_test_file.txt"
-on agents, "puppet filebucket backup --local /tmp/checksum_test_file.txt"
+step "Backup file into the filebucket"
+on agents, puppet_filebucket("backup --local /tmp/checksum_test_file.txt")
+
+agents.each do |agent|
+  bucketdir="not set"
+  on agent, puppet_filebucket("--configprint bucketdir") do 
+    bucketdir = stdout.chomp
+  end
 
-get_remote_option(agents, 'filebucket', 'bucketdir') do |bucketdir|
   manifest = %Q|
     filebucket { 'local':
       path => '#{bucketdir}',
@@ -31,7 +39,14 @@ get_remote_option(agents, 'filebucket', 'bucketdir') do 
|bucketdir|
       backup => local,
     }
   |
-  apply_manifest_on agents, manifest
+
+  step "Applying Manifest on Agents"
+  apply_manifest_on agent, manifest
 end
 
-on agents, 'test "$(cat /tmp/content_file_test.txt)" = "This is the checksum 
file contents"'
+step "Validate filebucket checksum file contents"
+agents.each do |host|
+  on host, "cat /tmp/content_file_test.txt" do
+    assert_match(/This is the checksum file content/, stdout, "File content 
not matched on #{host}")
+  end
+end
diff --git a/acceptance/tests/resource/file/should_create_directory.rb 
b/acceptance/tests/resource/file/should_create_directory.rb
index 859ebb3..37ad9db 100755
--- a/acceptance/tests/resource/file/should_create_directory.rb
+++ b/acceptance/tests/resource/file/should_create_directory.rb
@@ -3,7 +3,7 @@ test_name "should create directory"
 target = "/tmp/test-#{Time.new.to_i}"
 
 step "clean up the system before we begin"
-on agents, "rm -vrf #{target}"
+on agents, "rm -rf #{target}"
 
 step "verify we can create a directory"
 on(agents, puppet_resource("file", target, 'ensure=directory'))
@@ -12,4 +12,4 @@ step "verify the directory was created"
 on agents, "test -d #{target}"
 
 step "clean up after the test run"
-on agents, "rm -vrf #{target}"
+on agents, "rm -rf #{target}"
diff --git a/acceptance/tests/resource/file/should_create_empty.rb 
b/acceptance/tests/resource/file/should_create_empty.rb
index a38c35c..e9d9d8e 100755
--- a/acceptance/tests/resource/file/should_create_empty.rb
+++ b/acceptance/tests/resource/file/should_create_empty.rb
@@ -3,13 +3,13 @@ test_name "should create empty file for 'present'"
 target = "/tmp/test-#{Time.new.to_i}"
 
 step "clean up the system before we begin"
-on agents, "rm -vrf #{target}"
+on agents, "rm -rf #{target}"
 
 step "verify we can create an empty file"
 on(agents, puppet_resource("file", target, 'ensure=present'))
 
 step "verify the target was created"
-on agents, "test -f #{target} && ! test -s #{target}"
+on agents, "test -f #{target} && test ! -s #{target}"
 
 step "clean up after the test run"
-on agents, "rm -vrf #{target}"
+on agents, "rm -rf #{target}"
diff --git a/acceptance/tests/resource/file/should_create_symlink.rb 
b/acceptance/tests/resource/file/should_create_symlink.rb
index 0e58d21..81fe4b4 100755
--- a/acceptance/tests/resource/file/should_create_symlink.rb
+++ b/acceptance/tests/resource/file/should_create_symlink.rb
@@ -5,7 +5,7 @@ target  = "/tmp/test-#{Time.new.to_i}"
 source  = "/tmp/test-#{Time.new.to_i}-source"
 
 step "clean up the system before we begin"
-on agents, "rm -vrf #{target}"
+on agents, "rm -rf #{target}"
 on agents, "echo '#{message}' > #{source}"
 
 step "verify we can create a symlink"
@@ -13,6 +13,7 @@ on(agents, puppet_resource("file", target, 
"ensure=#{source}"))
 
 step "verify the symlink was created"
 on agents, "test -L #{target} && test -f #{target}"
+step "verify source file"
 on agents, "test -f #{source}"
 
 step "verify the content is identical on both sides"
@@ -24,4 +25,4 @@ on(agents, "cat #{target}") do
 end
 
 step "clean up after the test run"
-on agents, "rm -vrf #{target} #{source}"
+on agents, "rm -rf #{target} #{source}"
diff --git a/acceptance/tests/resource/file/should_remove_dir.rb 
b/acceptance/tests/resource/file/should_remove_dir.rb
index 943410d..36fa1ad 100755
--- a/acceptance/tests/resource/file/should_remove_dir.rb
+++ b/acceptance/tests/resource/file/should_remove_dir.rb
@@ -3,7 +3,7 @@ test_name "should remove directory, but force required"
 target = "/tmp/test-#{Time.new.to_i}"
 
 step "clean up the system before we begin"
-on agents, "test -e #{target} && rm -vrf #{target} ; mkdir -p #{target}"
+on agents, "rm -rf #{target} ; mkdir -p #{target}"
 
 step "verify we can't remove a directory without 'force'"
 on(agents, puppet_resource("file", target, 'ensure=absent')) do
diff --git a/acceptance/tests/resource/file/should_remove_file.rb 
b/acceptance/tests/resource/file/should_remove_file.rb
index 3ad7510..aadb829 100755
--- a/acceptance/tests/resource/file/should_remove_file.rb
+++ b/acceptance/tests/resource/file/should_remove_file.rb
@@ -3,7 +3,7 @@ test_name "should remove file"
 target = "/tmp/test-#{Time.new.to_i}"
 
 step "clean up the system before we begin"
-on agents, "rm -vrf #{target} && touch #{target}"
+on agents, "rm -rf #{target} && touch #{target}"
 
 step "verify we can remove a file"
 on(agents, puppet_resource("file", target, 'ensure=absent'))
diff --git a/acceptance/tests/resource/file/source_attribtute.rb 
b/acceptance/tests/resource/file/source_attribtute.rb
index 95a7f36..3fa447a 100644
--- a/acceptance/tests/resource/file/source_attribtute.rb
+++ b/acceptance/tests/resource/file/source_attribtute.rb
@@ -4,35 +4,41 @@ step "Ensure the test environment is clean"
 on agents, 'rm -f /tmp/source_file_test.txt'
 
 # TODO: Add tests for puppet:// URIs with master/agent setups.
-step "when using a puppet:/// URI with a master/agent setup"
-step "when using a puppet://$server/ URI with a master/agent setup"
-
-step "when using a local file path"
+# step "when using a puppet:/// URI with a master/agent setup"
+# step "when using a puppet://$server/ URI with a master/agent setup"
 
+step "Using a local file path"
 on agents, "echo 'Yay, this is the local file.' > 
/tmp/local_source_file_test.txt"
-
 manifest = "file { '/tmp/source_file_test.txt': source => 
'/tmp/local_source_file_test.txt', ensure => present }"
 
 apply_manifest_on agents, manifest
-
-on agents, 'test "$(cat /tmp/source_file_test.txt)" = "Yay, this is the local 
file."'
+agents.each do |host|
+  on host, "cat /tmp/source_file_test.txt" do
+    assert_match(/Yay, this is the local file./, stdout, "FIRST: File contents 
not matched on #{host}")
+  end
+end
 
 step "Ensure the test environment is clean"
 on agents, 'rm -f /tmp/source_file_test.txt'
 
-step "when using a puppet:/// URI with puppet apply"
+step "Using a puppet:/// URI with puppet apply"
 
-on agents, 'puppet agent --configprint modulepath' do
+on agents, puppet_agent("--configprint modulepath") do
   modulepath = stdout.split(':')[0]
   modulepath = modulepath.chomp
   on agents, "mkdir -p #{modulepath}/test_module/files"
-  on agents, "echo 'Yay, this is the puppet:/// file.' > 
#{modulepath}/test_module/files/test_file.txt"
+  #on agents, "echo 'Yay, this is the puppet:/// file.' > 
#{modulepath}/test_module/files/test_file.txt"
+  on agents, "echo 'Yay, this is the puppetfile.' > 
#{modulepath}/test_module/files/test_file.txt"
 end
 
 on agents, %q{echo "file { '/tmp/source_file_test.txt': source => 
'puppet:///modules/test_module/test_file.txt', ensure => present }" > 
/tmp/source_test_manifest.pp}
-on agents, "puppet apply /tmp/source_test_manifest.pp"
+on agents, puppet_apply("/tmp/source_test_manifest.pp") 
 
-on agents, 'test "$(cat /tmp/source_file_test.txt)" = "Yay, this is the 
puppet:/// file."'
+agents.each do |host|
+  on host, "cat /tmp/source_file_test.txt" do
+    assert_match(/Yay, this is the puppetfile./, stdout, "SECOND: File 
contents not matched on #{host}")
+  end
+end
 
 # Oops. We (Jesse & Jacob) ended up writing this before realizing that you
 # can't actually specify "source => 'http://...'".  However, we're leaving it
diff --git a/acceptance/tests/resource/group/should_create.rb 
b/acceptance/tests/resource/group/should_create.rb
index 122c31a..efb80a4 100755
--- a/acceptance/tests/resource/group/should_create.rb
+++ b/acceptance/tests/resource/group/should_create.rb
@@ -1,6 +1,6 @@
 test_name "should create group"
 
-name = "test-group-#{Time.new.to_i}"
+name = "pl#{rand(999999).to_i}"
 
 def cleanup(name)
     step "remove group #{name} if it exists"
@@ -14,7 +14,7 @@ on(agents, puppet_resource('group', name, 'ensure=present'))
 
 step "verify the group #{name} was created"
 on(agents, "getent group #{name}") do
-    fail_test "group information is not sensible" unless stdout =~ 
/^#{name}:x:[0-9]+:/
+    fail_test "group information is not sensible" unless stdout =~ 
/^#{name}:.*:[0-9]+:/
 end
 
 cleanup(name)
diff --git a/acceptance/tests/resource/group/should_modify_gid.rb 
b/acceptance/tests/resource/group/should_modify_gid.rb
index 95405b2..b54d401 100755
--- a/acceptance/tests/resource/group/should_modify_gid.rb
+++ b/acceptance/tests/resource/group/should_modify_gid.rb
@@ -1,22 +1,23 @@
 test_name "should modify gid of existing group"
 
-name = "test-group-#{Time.new.to_i}"
-gid  = 12345
+name = "pl#{rand(999999).to_i}"
+gid1  = rand(999999).to_i
+gid2  = rand(999999).to_i
 
-step "ensure that the group exists with gid #{gid}"
-on(agents, puppet_resource('group', name, 'ensure=present', "gid=#{gid}")) do
-    fail_test "missing gid notice" unless stdout =~ /gid +=> +'#{gid}'/
+step "ensure that the group exists with gid #{gid1}"
+on(agents, puppet_resource('group', name, 'ensure=present', "gid=#{gid1}")) do
+    fail_test "missing gid notice" unless stdout =~ /gid +=> +'#{gid1}'/
 end
 
-step "ensure that we can modify the GID of the group to #{gid*2}"
-on(agents, puppet_resource('group', name, 'ensure=present', "gid=#{gid*2}")) do
-    fail_test "missing gid notice" unless stdout =~ /gid +=> +'#{gid*2}'/
+step "ensure that we can modify the GID of the group to #{gid2}"
+on(agents, puppet_resource('group', name, 'ensure=present', "gid=#{gid2}")) do
+    fail_test "missing gid notice" unless stdout =~ /gid +=> +'#{gid2}'/
 end
 
 step "verify that the GID changed"
 on(agents, "getent group #{name}") do
     fail_test "gid is wrong through getent output" unless
-        stdout =~ /^#{name}:x:#{gid*2}:/
+        stdout =~ /^#{name}:.*:#{gid2}:/
 end
 
 step "clean up the system after the test run"
diff --git a/acceptance/tests/resource/host/should_create.rb 
b/acceptance/tests/resource/host/should_create.rb
index d5bd9e6..f5c0a17 100755
--- a/acceptance/tests/resource/host/should_create.rb
+++ b/acceptance/tests/resource/host/should_create.rb
@@ -3,7 +3,7 @@ test_name "host should create"
 target = "/tmp/host-#{Time.new.to_i}"
 
 step "clean up for the test"
-on agents, "rm -vf #{target}"
+on agents, "rm -f #{target}"
 
 step "create the host record"
 on(agents, puppet_resource("host", "test", "ensure=present",
diff --git a/acceptance/tests/resource/host/should_create_aliases.rb 
b/acceptance/tests/resource/host/should_create_aliases.rb
index 4cc0014..71e92ae 100755
--- a/acceptance/tests/resource/host/should_create_aliases.rb
+++ b/acceptance/tests/resource/host/should_create_aliases.rb
@@ -3,7 +3,7 @@ test_name "host should create aliases"
 target  = "/tmp/host-#{Time.new.to_i}"
 
 step "clean up the system for testing"
-on agents, "rm -vf #{target}"
+on agents, "rm -f #{target}"
 
 step "create the record"
 on(agents, puppet_resource('host', 'test', "ensure=present",
diff --git a/acceptance/tests/resource/host/should_destroy.rb 
b/acceptance/tests/resource/host/should_destroy.rb
index 451b2d0..69c74b8 100755
--- a/acceptance/tests/resource/host/should_destroy.rb
+++ b/acceptance/tests/resource/host/should_destroy.rb
@@ -16,4 +16,4 @@ on(agents, "cat #{file}; rm -f #{file}") do
 end
 
 step "clean up after the test"
-on agents, "rm -vf #{file}"
+on agents, "rm -f #{file}"
diff --git a/acceptance/tests/resource/host/should_modify_alias.rb 
b/acceptance/tests/resource/host/should_modify_alias.rb
index 312078f..1ebbf33 100755
--- a/acceptance/tests/resource/host/should_modify_alias.rb
+++ b/acceptance/tests/resource/host/should_modify_alias.rb
@@ -16,4 +16,4 @@ on(agents, "cat #{file}; rm -f #{file}") do
 end
 
 step "clean up after the test"
-on agents, "rm -vf #{file}"
+on agents, "rm -f #{file}"
diff --git a/acceptance/tests/resource/host/should_modify_ip.rb 
b/acceptance/tests/resource/host/should_modify_ip.rb
index b16db59..cf3c3f1 100755
--- a/acceptance/tests/resource/host/should_modify_ip.rb
+++ b/acceptance/tests/resource/host/should_modify_ip.rb
@@ -16,4 +16,4 @@ on(agents, "cat #{file}; rm -f #{file}") do
 end
 
 step "clean up after the test"
-on agents, "rm -vf #{file}"
+on agents, "rm -f #{file}"
diff --git a/acceptance/tests/resource/host/should_not_create_existing.rb 
b/acceptance/tests/resource/host/should_not_create_existing.rb
index c8a40df..a8f9022 100755
--- a/acceptance/tests/resource/host/should_not_create_existing.rb
+++ b/acceptance/tests/resource/host/should_not_create_existing.rb
@@ -13,5 +13,5 @@ on(agents, puppet_resource('host', 'test', "target=#{file}",
 end
 
 step "clean up after we created things"
-on agents, "rm -vf #{file}"
+on agents, "rm -f #{file}"
 
diff --git a/acceptance/tests/resource/host/should_query.rb 
b/acceptance/tests/resource/host/should_query.rb
index 983812c..76f84e4 100755
--- a/acceptance/tests/resource/host/should_query.rb
+++ b/acceptance/tests/resource/host/should_query.rb
@@ -12,4 +12,4 @@ on(agents, puppet_resource('host', 'localhost', 
"target=#{file}")) do
 end
 
 step "clean up the system"
-on agents, "rm -vf #{file}"
+on agents, "rm -f #{file}"
diff --git a/acceptance/tests/resource/host/should_query_all.rb 
b/acceptance/tests/resource/host/should_query_all.rb
index 654883a..bf1f1b8 100755
--- a/acceptance/tests/resource/host/should_query_all.rb
+++ b/acceptance/tests/resource/host/should_query_all.rb
@@ -23,4 +23,4 @@ on(agents, puppet_resource('host')) do
 end
 
 step "clean up the system afterwards"
-on agents, "mv -vf #{backup} /etc/hosts"
+on agents, "mv -f #{backup} /etc/hosts"
diff --git 
a/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb
 
b/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb
index 9bedd6e..127e943 100755
--- 
a/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb
+++ 
b/acceptance/tests/resource/service/ticket_4123_should_list_all_running_redhat.rb
@@ -4,9 +4,10 @@ step "Validate services running agreement ralsh vs. OS service 
count"
 # ticket_4123_should_list_all_running_redhat.sh
 
 hosts.each do |host|
-  unless host['platform'].include? 'centos' or host['platform'].include? 
'redhat'
-    skip_test "Test not supported on this plaform" 
-  else
+  if host['platform'].include?('centos') or host['platform'].include?('redhat')
+    puts "XXX #{host['platform']}"
     
run_script_on(host,'acceptance-tests/tests/resource/service/ticket_4123_should_list_all_running_redhat.sh')
+  else
+    skip_test "Test not supported on this plaform" 
   end
 end
diff --git a/acceptance/tests/resource/user/should_create.rb 
b/acceptance/tests/resource/user/should_create.rb
index 062883d..0b2b0c6 100755
--- a/acceptance/tests/resource/user/should_create.rb
+++ b/acceptance/tests/resource/user/should_create.rb
@@ -1,9 +1,6 @@
 test_name "should create a user, and the default matching group"
-# REVISIT: This is a direct port of the original test, but it contains a
-# non-portable assumption that "user private groups" are used by default by
-# everything that we target. --daniel 2010-12-24
 
-name = "test-user-#{Time.new.to_i}"
+name = "pl#{rand(999999).to_i}"
 
 step "ensure that the user and group #{name} do not exist"
 on agents, "if getent passwd #{name}; then userdel #{name}; fi"
@@ -13,7 +10,14 @@ step "ask puppet to create the user"
 on(agents, puppet_resource('user', name, 'ensure=present'))
 
 step "verify that the user and group now exist"
-on agents, "getent passwd #{name} && getent group #{name}"
+agents.each do |agent|
+  if agent['platform'].include? 'sles' or agent['platform'].include? 'solaris' 
 # no private user groups by default
+    on agent, "getent passwd #{name}"
+  else
+    on agent, "getent passwd #{name} && getent group #{name}"
+  end
+end
+
 
 step "ensure that the user and group #{name} do not exist"
 on agents, "if getent passwd #{name}; then userdel #{name}; fi"
diff --git a/acceptance/tests/resource/user/should_create_with_gid.rb 
b/acceptance/tests/resource/user/should_create_with_gid.rb
index be36bf4..c92d5c9 100755
--- a/acceptance/tests/resource/user/should_create_with_gid.rb
+++ b/acceptance/tests/resource/user/should_create_with_gid.rb
@@ -1,14 +1,14 @@
 test_name "verifies that puppet resource creates a user and assigns the 
correct group"
 
-user  = "test-user-#{Time.new.to_i}"
-group = "test-user-#{Time.new.to_i}-group"
+user = "pl#{rand(999999).to_i}"
+group = "gp#{rand(999999).to_i}"
 
 agents.each do |host|
     step "user should not exist"
     on host, "if getent passwd #{user}; then userdel #{user}; fi"
 
     step "group should exist"
-    on host, "if ! getent group #{group}; then groupadd #{group}; fi"
+    on host, "getent group #{group} || groupadd #{group}"
 
     step "create user with group"
     on(host, puppet_resource('user', user, 'ensure=present', "gid=#{group}"))
diff --git a/acceptance/tests/resource/user/should_destroy.rb 
b/acceptance/tests/resource/user/should_destroy.rb
index 8ba7ace..6555012 100755
--- a/acceptance/tests/resource/user/should_destroy.rb
+++ b/acceptance/tests/resource/user/should_destroy.rb
@@ -1,6 +1,6 @@
 test_name "verify that puppet resource correctly destroys users"
 
-user  = "test-user-#{Time.new.to_i}"
+user = "pl#{rand(999999).to_i}"
 group = user
 
 step "ensure that the user and associated group exist"
diff --git a/acceptance/tests/resource/user/should_modify_gid.rb 
b/acceptance/tests/resource/user/should_modify_gid.rb
index 6aba4aa..d8bc60f 100755
--- a/acceptance/tests/resource/user/should_modify_gid.rb
+++ b/acceptance/tests/resource/user/should_modify_gid.rb
@@ -1,8 +1,8 @@
 test_name "verify that we can modify the gid"
 
-user   = "test-user-#{Time.new.to_i}"
-group1 = "#{user}-old"
-group2 = "#{user}-new"
+user = "pl#{rand(99999).to_i}"
+group1 = "#{user}old"
+group2 = "#{user}new"
 
 agents.each do |host|
     step "ensure that the groups both exist"
diff --git a/acceptance/tests/resource/user/should_not_destoy_unexisting.rb 
b/acceptance/tests/resource/user/should_not_destoy_unexisting.rb
index ceeea7d..133d513 100755
--- a/acceptance/tests/resource/user/should_not_destoy_unexisting.rb
+++ b/acceptance/tests/resource/user/should_not_destoy_unexisting.rb
@@ -1,6 +1,6 @@
 test_name "ensure that puppet does not report removing a user that does not 
exist"
 
-name = "test-user-#{Time.new.to_i}"
+name = "pl#{rand(999999).to_i}"
 
 step "verify that user #{name} does not exist"
 on agents, "getent passwd #{name}", :acceptable_exit_codes => [2]
diff --git a/acceptance/tests/resource/user/should_query.rb 
b/acceptance/tests/resource/user/should_query.rb
index 6e2df53..c976c87 100755
--- a/acceptance/tests/resource/user/should_query.rb
+++ b/acceptance/tests/resource/user/should_query.rb
@@ -1,6 +1,6 @@
 test_name "test that we can query and find a user that exists."
 
-name = "test-user-#{Time.new.to_i}"
+name = "pl#{rand(999999).to_i}"
 
 step "ensure that our test user exists"
 on(agents, puppet_resource('user', name, 'ensure=present'))
-- 
1.7.3.5

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to