Skip to content

Commit 2c7b3db

Browse files
Merge pull request #164 from puppetlabs/SOLARCH-278
(SOLARCH-278) put pending on these tests due to function issues
2 parents b7c649e + ba54b03 commit 2c7b3db

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

spec/fixtures/plans/pe_conf.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"puppet_enterprise::profile::master::java_args": {
3+
"Xmx": "2048m",
4+
"Xms": "512m"
5+
},
6+
"puppet_enterprise::profile::console::java_args": {
7+
"Xmx": "768m",
8+
"Xms": "256m"
9+
},
10+
"puppet_enterprise::profile::orchestrator::java_args": {
11+
"Xmx": "768m",
12+
"Xms": "256m"
13+
},
14+
"puppet_enterprise::profile::puppetdb::java_args": {
15+
"Xmx": "768m",
16+
"Xms": "256m"
17+
},
18+
"console_admin_password": "puppetlabs",
19+
"puppet_enterprise::puppet_master_host": "pe-server-d8b317-0.us-west1-a.c.davidsand.internal",
20+
"puppet_enterprise::database_host": "pe-server-d8b317-0.us-west1-a.c.davidsand.internal",
21+
"pe_install::puppet_master_dnsaltnames": [
22+
"puppet",
23+
"pe-server-d8b317-0.us-west1-a.c.davidsand.internal"
24+
],
25+
"puppet_enterprise::profile::master::code_manager_auto_configure": true,
26+
"puppet_enterprise::profile::database::puppetdb_hosts": [
27+
"pe-server-d8b317-0.us-west1-a.c.davidsand.internal"
28+
]
29+
}

spec/plans/convert_spec.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# spec/spec_helper.rb
2+
3+
describe 'peadm::convert' do
4+
# Include the BoltSpec library functions
5+
include BoltSpec::Plans
6+
7+
let(:trustedjson) do
8+
JSON.parse File.read(File.expand_path(File.join(fixtures, 'plans', 'trusted_facts.json')))
9+
end
10+
11+
it 'single primary no dr valid' do
12+
expect_out_message()
13+
expect_task('peadm::trusted_facts').return_for_targets(
14+
15+
'primary' => trustedjson,
16+
)
17+
pending('a lack of support for functions requires a workaround to be written')
18+
expect_task('peadm::read_file').always_return({'content' => '2019.2.4'})
19+
expect_command('systemctl is-active puppet.service')
20+
expect_command('systemctl stop puppet.service')
21+
#expect_plan('peadm::util::add_cert_extensions')
22+
allow_apply()
23+
expect_task('peadm::cert_data')
24+
expect_task('peadm::puppet_runonce')
25+
expect(run_plan('peadm::convert', 'primary_host' => 'primary')).to be_ok
26+
end
27+
end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# spec/spec_helper.rb
2+
3+
4+
describe 'peadm::util::sanitize_pg_pe_conf ' do
5+
# Include the BoltSpec library functions
6+
include BoltSpec::Plans
7+
8+
let(:pe_conf_json) do
9+
JSON.parse File.read(File.expand_path(File.join(fixtures, 'plans', 'pe_conf.json')))
10+
end
11+
12+
it 'Runs' do
13+
# 1) peadm::util::sanitize_pg_pe_conf Runs
14+
#Failure/Error: expect(run_plan('peadm::util::sanitize_pg_pe_conf', 'targets' => 'foo,bar', 'primary_host' => 'pe-server-d8b317-0.us-west1-a.c.davidsand.internal')).to be_ok
15+
#expected `#<Bolt::PlanResult:0x00007fd37d94b8a0 @value=#<Bolt::PAL::PALError: undefined method `start_with?' for #<Hash:0x00007fd36e30b350>>, @status="failure">.ok?` to be truthy, got false
16+
pending('a lack of support for functions requires a workaround to be written')
17+
expect_task('peadm::read_file').always_return('content' => pe_conf_json)
18+
expect(run_plan('peadm::util::sanitize_pg_pe_conf', 'targets' => 'foo,bar', 'primary_host' => 'pe-server-d8b317-0.us-west1-a.c.davidsand.internal')).to be_ok
19+
end
20+
end

0 commit comments

Comments
 (0)