Skip to content

Commit c14de49

Browse files
committed
(PUP-9648) Update beaker tests
Fix serveral tests that hardcoded pson and hadn't been updated to use json. Delete the test for verifying preferred_serialization_format. I manually verified that if the pson feature is disabled on the puppetserver host, then puppetserver responds with HTTP 406 as expected.
1 parent 0c4fa8e commit c14de49

File tree

5 files changed

+9
-45
lines changed

5 files changed

+9
-45
lines changed

acceptance/lib/puppet/acceptance/module_utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def get_default_modulepath_for_host(host)
4444
# @param host [String] hostname
4545
# @return [Array] paths for found modules
4646
def get_installed_modules_for_host(host)
47-
on host, puppet("module list --render-as pson")
47+
on host, puppet("module list --render-as json")
4848
str = stdout.lines.to_a.last
4949
pat = /\(([^()]+)\)/
5050
mods = str.scan(pat).flatten

acceptance/tests/language/exported_resources.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
step 'stop puppet server' do
1818
on(master, "service #{master['puppetservice']} stop")
1919
end
20-
step 'remove cached agent pson catalogs from the master' do
20+
step 'remove cached agent json catalogs from the master' do
2121
on(master, "rm -f #{File.join(master.puppet['yamldir'],'catalog','*')}",
2222
:accept_all_exit_codes => true)
2323
end
@@ -33,10 +33,10 @@
3333
end
3434
end
3535

36-
storeconfigs_backend_name = 'pson_storeconfigs'
36+
storeconfigs_backend_name = 'json_storeconfigs'
3737
step 'create a yaml storeconfigs terminus in the modulepath' do
3838
moduledir = File.join(environmentpath,tmp_environment,'modules')
39-
terminus_class_name = 'PsonStoreconfigs'
39+
terminus_class_name = 'JsonStoreconfigs'
4040
manifest = <<MANIFEST
4141
File {
4242
ensure => directory,
@@ -64,8 +64,8 @@ def save(request)
6464
# This is quite likely a bad idea, since we are not managing ownership or modes.
6565
Dir.mkdir(basedir) unless Puppet::FileSystem.exist?(basedir)
6666
begin
67-
# We cannot dump anonymous modules in yaml, so dump to json/pson
68-
File.open(file, "w") { |f| f.write request.instance.to_pson }
67+
# We cannot dump anonymous modules in yaml, so dump to json
68+
File.open(file, "w") { |f| f.write request.instance.to_json }
6969
rescue TypeError => detail
7070
Puppet.err "Could not save \#{self.name} \#{request.key}: \#{detail}"
7171
end
@@ -108,7 +108,7 @@ class Puppet::Resource::#{terminus_class_name} < Puppet::Indirector::Yaml
108108
def search(request)
109109
catalog_dir = File.join(Puppet.run_mode.server? ? Puppet[:yamldir] : Puppet[:clientyamldir], "catalog", "*")
110110
results = Dir.glob(catalog_dir).collect { |file|
111-
catalog = Puppet::Resource::Catalog.convert_from(:pson, File.read(file))
111+
catalog = Puppet::Resource::Catalog.convert_from(:json, File.read(file))
112112
if catalog.name == request.options[:host]
113113
next
114114
end

acceptance/tests/security/cve-2013-1652_improper_query_params.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
cert_path = on(agent, puppet('agent', "--configprint hostcert")).stdout.chomp
2828
key_path = on(agent, puppet('agent', "--configprint hostprivkey")).stdout.chomp
29-
curl_base = "curl --tlsv1 -g --cert \"#{cert_path}\" --key \"#{key_path}\" -k -H 'Accept: pson'"
29+
curl_base = "curl --tlsv1 -g --cert \"#{cert_path}\" --key \"#{key_path}\" -k -H 'Accept: application/json'"
3030

3131
curl_call = "#{curl_base} '#{payload}'"
3232

acceptance/tests/security/cve-2013-1652_poison_other_node_cache.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
master, puppet('agent', "--configprint hostprivkey")).stdout.chomp
2222

2323
curl_base = "curl --tlsv1 -g --cert \"#{cert_path}\" " +
24-
"--key \"#{key_path}\" -k -H 'Accept: pson'"
24+
"--key \"#{key_path}\" -k -H 'Accept: application/json'"
2525

2626
step "Attempt to poison the master's node cache" do
2727
yamldir = puppet_config(master, 'yamldir', section: 'master')

acceptance/tests/server_returns_pson_when_preferred_serialization_set.rb

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)