1 require 'spec_helper_acceptance'
2 require 'beaker/i18n_helper'
4 PUPPETLABS_GPG_KEY_LONG_ID = '7F438280EF8D349F'.freeze
5 PUPPETLABS_LONG_FINGERPRINT = '123456781274D2C8A956789A456789A456789A9A'.freeze
7 id_doesnt_match_fingerprint_pp = <<-MANIFEST
8 apt_key { '#{PUPPETLABS_LONG_FINGERPRINT}':
10 content => '123456781274D2C8A956789A456789A456789A9B',
14 location_not_specified_fail_pp = <<-MANIFEST
15 apt::source { 'puppetlabs':
19 id => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
20 server => 'hkps.pool.sks-keyservers.net',
25 no_content_param = <<-MANIFEST
31 invalid_ensure = <<-MANIFEST
32 apt_key { '#{PUPPETLABS_LONG_FINGERPRINT}':
37 describe 'localization', if: (fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat') && (Gem::Version.new(puppet_version) >= Gem::Version.new('4.10.5')) do
40 on(host, "sed -i \"96i FastGettext.locale='ja'\" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb")
41 change_locale_on(host, 'ja_JP.utf-8')
45 describe 'ruby translations' do
46 it 'fails with interpolated string' do
47 apply_manifest(id_doesnt_match_fingerprint_pp, expect_failures: true) do |r|
48 expect(r.stderr).to match(%r{を設定できませんでした: マニフェスト123456781274D2C8A956789A456789A456789A9Aに含まれるidと、content/sourceのフィンガープリントが一致しません。idに間違いがないか、content/sourceが正当であるかを確認してください})
51 it 'fails with simple string' do
52 apply_manifest(location_not_specified_fail_pp, expect_failures: true) do |r|
53 expect(r.stderr).to match(%r{の検証中にエラーが生じました。Evaluation Error: a Function Callの検証中にエラーが生じました。場所を指定せずにソースエントリを作成することはできません})
58 describe 'puppet translations' do
59 it 'fails with interpolated string' do
60 apply_manifest(invalid_ensure, expect_failures: true) do |r|
61 expect(r.stderr).to match(%r{失敗しました: 無効な値\"bourbon\" 有効な値は})
64 it 'fails with simple string' do
65 apply_manifest(no_content_param, expect_failures: true) do |r|
66 expect(r.stderr).to match(%r{この表現は無効です。タイトルなしの'apt_conf'リソースの宣言を試みましたか?})
73 on(host, 'sed -i "96d" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb')
74 change_locale_on(host, 'en_US')