Skip to content

Commit

Permalink
Removed specs for ntp.conf.erb template which is no longer being used
Browse files Browse the repository at this point in the history
  • Loading branch information
praj1001 committed Jul 4, 2023
1 parent f6e6990 commit ebb7310
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 48 deletions.
7 changes: 0 additions & 7 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,6 @@ Data type: `String`

Specifies a file mode for the ntp configuration file. Default value: '0664'.

##### <a name="-ntp--config_template"></a>`config_template`

Data type: `Optional[String]`

Specifies an absolute or relative file path to an ERB template for the config file.
Example value: 'ntp/ntp.conf.erb'. A validation error is thrown if both this **and** the `config_epp` parameter are specified.

##### <a name="-ntp--daemon_extra_opts"></a>`daemon_extra_opts`

Data type: `Optional[String]`
Expand Down
4 changes: 0 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
# @param config_file_mode
# Specifies a file mode for the ntp configuration file. Default value: '0664'.
#
# @param config_template
# Specifies an absolute or relative file path to an ERB template for the config file.
# Example value: 'ntp/ntp.conf.erb'. A validation error is thrown if both this **and** the `config_epp` parameter are specified.
#
# @param daemon_extra_opts
# Specifies any arguments to pass to ntp daemon. Default value: '-g'.
# Example value: '-g -i /var/lib/ntp' to enable jaildir options.
Expand Down
8 changes: 0 additions & 8 deletions readmes/README_ja_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,6 @@ NTP構成ファイルのディレクトリを指定します。

デフォルト値: '0664'

#### `config_template`

任意

データタイプ: 文字列

構成ファイルのERBテンプレートへの絶対パスまたは相対パスを指定します(値の例: 'ntp/ntp.conf.erb')。このパラメータと`config_epp`パラメータの**両方**を指定すると、バリデーションエラーが発生します。

#### `disable_auth`

データタイプ: 真偽値(boolean)
Expand Down
26 changes: 3 additions & 23 deletions spec/acceptance/ntp_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,6 @@
end
end

describe 'config_template' do
before :all do
run_shell("mkdir -p #{modulepath}/test/templates")
# Add spurious template logic to verify the use of the correct template rendering engine
run_shell("echo '<% [1].each do |i| %>erbserver<%= i %><%end %>' >> #{modulepath}/test/templates/ntp.conf.erb")
end

it 'sets the ntp.conf erb template location' do
pp = "class { 'ntp': config_template => 'test/ntp.conf.erb' }"
apply_manifest(pp, catch_failures: true)
expect(file(config.to_s)).to be_file
expect(file(config.to_s).content).to match 'erbserver1'
end

it 'sets the ntp.conf epp template location and the ntp.conf erb template location which should fail' do
pp = "class { 'ntp': config_template => 'test/ntp.conf.erb', config_epp => 'test/ntp.conf.epp' }"
expect(apply_manifest(pp, expect_failures: true).stderr).to match(%r{Cannot supply both config_epp and config_template}i)
end
end

describe 'config_epp' do
before :all do
run_shell("mkdir -p #{modulepath}/test/templates")
Expand All @@ -80,9 +60,9 @@
expect(file(config.to_s).content).to match 'eppserver1'
end

it 'sets the ntp.conf epp template location and the ntp.conf erb template location which should fail' do
pp = "class { 'ntp': config_template => 'test/ntp.conf.erb', config_epp => 'test/ntp.conf.epp' }"
expect(apply_manifest(pp, expect_failures: true).stderr).to match(%r{Cannot supply both config_epp and config_template}i)
it 'sets the ntp.conf epp template location which should fail' do
pp = "class { 'ntp': config_epp => 'test/ntp.conf.epp' }"
expect(apply_manifest(pp, expect_failures: true).stderr).to match(%r{Cannot supply config_epp}i)
end
end

Expand Down
6 changes: 0 additions & 6 deletions spec/classes/ntp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@

it { is_expected.to contain_file('/var/run/ntp/servers-netconfig').with_ensure_absent } if f[:os]['family'] == 'Suse' && f[:os]['release']['major'] == '12'

describe 'allows template to be overridden with erb template' do
let(:params) { { config_template: 'my_ntp/ntp.conf.erb' } }

it { is_expected.to contain_file(conf_path).with_content(%r{erbserver1}) }
end

describe 'allows template to be overridden with epp template' do
let(:params) { { config_epp: 'my_ntp/ntp.conf.epp' } }

Expand Down

0 comments on commit ebb7310

Please sign in to comment.