403Webshell
Server IP : 66.29.132.122  /  Your IP : 3.141.198.108
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/destroy_spec.rb
require 'spec_helper_acceptance'

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

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

      it 'deletes a host record' do
        line = '127.0.0.7 test1'

        on agent, "printf '#{line}\n' > #{target}"
        on(agent, puppet_resource('host', 'test1', "target=#{target}",
                                  'ensure=absent', 'ip=127.0.0.7'))
        on(agent, "cat #{target}") do |result|
          fail_test 'the content was still present' if result.stdout.include? line
        end
      end

      it 'does not purge valid host records if file contains malformed content' do
        on(agent, "printf '127.0.0.2 existing alias\n' > #{target}")
        on(agent, "printf '==\n' >> #{target}")

        on(agent, puppet_resource('host', 'test', "target=#{target}",
                                  'ensure=present', 'ip=127.0.0.3', 'host_aliases=foo'))

        on(agent, "cat #{target}") do |result|
          fail_test 'existing host data was deleted' unless result.stdout.include? 'existing'
        end
      end
    end
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit