diff --git a/acceptance/tests/ticket_3360_allow_duplicate_csr_with_option_set.rb b/acceptance/tests/ticket_3360_allow_duplicate_csr_with_option_set.rb index 005141e0a..08638d73a 100644 --- a/acceptance/tests/ticket_3360_allow_duplicate_csr_with_option_set.rb +++ b/acceptance/tests/ticket_3360_allow_duplicate_csr_with_option_set.rb @@ -1,45 +1,58 @@ test_name "#3360: Allow duplicate CSR when allow_duplicate_certs is on" agent_hostnames = agents.map {|a| a.to_s} with_master_running_on master, "--allow_duplicate_certs --dns_alt_names=\"puppet,$(hostname -s),$(hostname -f)\" --verbose --noop" do - step "Generate a certificate request for the agent" - on agents, "puppet certificate generate `hostname -f` --ca-location remote --server #{master}" + agents.each do |agent| + if agent['platform'].include?('windows') + Log.warn("Pending: Windows does not support hostname -f") + next + end + + step "Generate a certificate request for the agent" + on agent, "puppet certificate generate `hostname -f` --ca-location remote --server #{master}" + end step "Collect the original certs" on master, puppet_cert("--sign --all") original_certs = on master, puppet_cert("--list --all") old_certs = {} original_certs.stdout.each_line do |line| if line =~ /^\+ (\S+) \((.+)\)$/ old_certs[$1] = $2 puts "old cert: #{$1} #{$2}" end end - step "Make another request with the same certname" - on agents, "puppet certificate generate `hostname -f` --ca-location remote --server #{master}" + agents.each do |agent| + if agent['platform'].include?('windows') + Log.warn("Pending: Windows does not support hostname -f") + next + end - step "Collect the new certs" + step "Make another request with the same certname" + on agent, "puppet certificate generate `hostname -f` --ca-location remote --server #{master}" + end + step "Collect the new certs" on master, puppet_cert("--sign --all") new_cert_list = on master, puppet_cert("--list --all") new_certs = {} new_cert_list.stdout.each_line do |line| if line =~ /^\+ (\S+) \((.+)\)$/ new_certs[$1] = $2 puts "new cert: #{$1} #{$2}" end end step "Verify the certs have changed" # using the agent name as the key may cause errors; # agent name from cfg file is likely to have short name # where certs might be signed with long names. old_certs.each_key { |key| next if key.include? master # skip the masters cert, only care about agents assert_not_equal(old_certs[key], new_certs[key], "Expected #{key} to have a changed key") } end diff --git a/acceptance/tests/ticket_7117_broke_env_criteria_authconf.rb b/acceptance/tests/ticket_7117_broke_env_criteria_authconf.rb index bb0b0ab8c..5bace0854 100644 --- a/acceptance/tests/ticket_7117_broke_env_criteria_authconf.rb +++ b/acceptance/tests/ticket_7117_broke_env_criteria_authconf.rb @@ -1,27 +1,32 @@ test_name "#7117 Broke the environment criteria in auth.conf" # add to auth.conf add_2_authconf = %q{ path / environment override auth any allow * } step "Create a temp auth.conf" create_remote_file master, "/tmp/auth.conf-7117", add_2_authconf on master, "chmod 644 /tmp/auth.conf-7117" with_master_running_on(master, "--dns_alt_names=\"puppet, $(hostname -s), $(hostname -f)\" --rest_authconfig /tmp/auth.conf-7117 --verbose --autosign true") do - # Run test on Agents - step "Run agent to upload facts" - on agents, puppet_agent("--test --server #{master}") + agents.each do |agent| + if agent['platform'].include?('windows') + Log.warn("Pending: Window's doesn't support hostname -f") + next + end + + # Run test on Agents + step "Run agent to upload facts" + on agent, puppet_agent("--test --server #{master}") - step "Fetch agent facts from Puppet Master" - agents.each do |host| - on(host, "curl -k -H \"Accept: yaml\" https://#{master}:8140/override/facts/\`hostname -f\`") do - assert_match(/--- !ruby\/object:Puppet::Node::Facts/, stdout, "Agent Facts not returned for #{host}") + step "Fetch agent facts from Puppet Master" + on(agent, "curl -k -H \"Accept: yaml\" https://#{master}:8140/override/facts/\`hostname -f\`") do + assert_match(/--- !ruby\/object:Puppet::Node::Facts/, stdout, "Agent Facts not returned for #{agent}") end end end