rspec-puppet

    0熱度

    2回答

    我有以下表現sudo的用戶,加載模板文件 class sudo { if $::operatingsystemmajrelease < 7 { $variable = $::operatingsystemmajrelease ? { '6' => $::fqdn, } file { '/etc/sudoers' : ensure =

    1熱度

    1回答

    我從以下here gem install rvm gem install bundle # Demo dir # Gemfile source "https://rubygems.org" gem 'rspec-puppet', :require => false gem 'puppetlabs_spec_helper', :require => false gem 'pupp

    1熱度

    1回答

    在rspec中有一些卡住使用變量。 這裏是我的params.pp case $::osfamily{ Debian: { $ssh_daemon = "ssh" } Redhat: { $ssh_daemon = "sshd" } 在一個RSpec測試,我需要使用變量$ ssh_daemon這樣的: it { should conta

    1熱度

    1回答

    我想安裝.net框架4.5.2使用puppet模塊使用exec資源,而不是使用Package資源由於某種原因。我想編寫一個測試用例來檢查它是否安裝。我能找到的檢查它是否安裝的唯一方法是檢查註冊表項。 我想知道如果我能寫RSpec的木偶測試,以檢查註冊表中存在與否? 我試圖張貼在serverfault這個問題,但我不能對付驗證碼,它要求它無限的次數,所以我不得不在這裏發表。道歉。 由於提前

    1熱度

    2回答

    語境: 我有解決的,當它呈現的processors事實count子組件的傀儡模板。這一事實存在於我的所有客戶身上。 事實的用例是在模板行中對其執行小數運算,例如:MyConfigVar=<%= 0.9 * @processors['count'] %>在某些.erb文件中。 我想: 讓我的模板代碼部署到生產主機。 爲我的模板編寫強大的單元測試,所以我可以確定它會正確渲染,給出事實的各種合理值。 我

    2熱度

    1回答

    我在寫一個自定義的puppet模塊,其中包含一個:: apache :: vhost資源,並且想驗證我的rspec測試中的目錄參數是否包含一定的值,而不會重現在spec測試中大部分硬編碼的整個目錄配置。 class foo::apache { # prepend 'from ' to each element in array of subnets # Change this

    0熱度

    1回答

    使用木偶3 測試使用RSpec的木偶 遍歷散列的數組使用定義類型 得到一個錯誤,告訴我,我的參數(默認到$ title的值)不能以我的方式訪問,因爲它不是Array或Hash 我在puppet模塊中使用舊式迭代,創建一個定義的類型以遍歷數組的哈希。我試圖在rspec-puppet中爲這個定義編寫一個測試,試圖使用let()將散列分配給:title。然後$title應該被設置爲我的變量$daemon

    2熱度

    1回答

    可以說我有以下測試: context 'test' do let(:hiera_data) { { :number => '2' } } it { should have_module__define_resource_count(2) } end context 'test2' do let(:hiera_data) { { :number => '10'

    3熱度

    1回答

    我的模塊結構是這樣的。 install_logging ├── files │ └── install_logging.sh ├── Gemfile ├── Gemfile.lock ├── manifests │ ├── \ │ ├── empty.rb │ └── init.pp ├── Modulefile ├── Rakefile ├── README ├── sp