1 require 'spec_helper_acceptance'
3 require 'beaker/i18n_helper'
5 PUPPETLABS_GPG_KEY_LONG_ID = '7F438280EF8D349F'.freeze
6 PUPPETLABS_LONG_FINGERPRINT = '123456781274D2C8A956789A456789A456789A9A'.freeze
8 id_doesnt_match_fingerprint_pp = <<-MANIFEST
9 apt_key { '#{PUPPETLABS_LONG_FINGERPRINT}':
11 content => '123456781274D2C8A956789A456789A456789A9B',
15 location_not_specified_fail_pp = <<-MANIFEST
16 apt::source { 'puppetlabs':
20 id => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
21 server => 'hkps.pool.sks-keyservers.net',
26 no_content_param = <<-MANIFEST
27 apt_key { '#{123456781274D2C8A956789A456789A456789A9A}':
32 describe 'localization', if: (fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat') && (Gem::Version.new(puppet_version) >= Gem::Version.new('4.10.5')) do
35 on(host, "sed -i \"96i FastGettext.locale='ja'\" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb")
36 change_locale_on(host, 'ja_JP.utf-8')
40 describe 'ruby translations' do
41 it 'fails with interpolated string' do
42 apply_manifest(id_doesnt_match_fingerprint_pp, expect_failures: true) do |r|
43 expect(r.stderr).to match(%r{を設定できませんでした: マニフェスト123456781274D2C8A956789A456789A456789A9Aに含まれるidと、content/sourceのフィンガープリントが一致しません。idに間違いがないか、content/sourceが正当であるかを確認してください})
46 it 'fails with simple string' do
47 apply_manifest(location_not_specified_fail_pp, expect_failures: true) do |r|
48 expect(r.stderr).to match(%r{の検証中にエラーが生じました。Evaluation Error: a Function Callの検証中にエラーが生じました。場所を指定せずにソースエントリを作成することはできません})
53 describe 'puppet translations' do
54 it 'fails with interpolated string' do
55 apply_manifest(no_content_param, expect_failures: true) do |r|
56 expect(r.stderr).to match(%r{contentパラメータを渡す必要があります})
59 it 'fails with simple string' do
60 apply_manifest(no_content_param, expect_failures: true) do |r|
61 expect(r.stderr).to match(%r{need a test})
68 on(host, 'sed -i "96d" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb')
69 change_locale_on(host, 'en_US')