Projet

Général

Profil

Révision d8752442

IDd87524428f15fa69f92418f4a112610b560b3b2f
Parent 3fe51d68
Enfant cfcafde5

Ajouté par Steve Traylen il y a plus de 4 ans

test that bad configuration leaves service running

Voir les différences:

spec/acceptance/default_spec.rb
52 52
      it { is_expected.to be_directory }
53 53
    end
54 54
  end
55
  context 'with bad invalid nft rules' do
56
    it 'puppet fails but should leave nft service running' do
57
      pp = <<-EOS
58
      class{'nftables':
59
        firewalld_enable => false,
60
      }
61
      nftables::rule{'default_out-junk':
62
        content => 'A load of junk',
63
      }
64
      # nftables cannot be started in docker so replace service with a validation only.
65
      systemd::dropin_file{"zzz_docker_nft.conf":
66
        ensure  => present,
67
        unit    => "nftables.service",
68
        content => [
69
          "[Service]",
70
          "ExecStart=",
71
          "ExecStart=/sbin/nft -c -I /etc/nftables/puppet -f /etc/sysconfig/nftables.conf",
72
          "ExecReload=",
73
          "ExecReload=/sbin/nft -c -I /etc/nftables/puppet -f /etc/sysconfig/nftables.conf",
74
          "",
75
          ].join("\n"),
76
        notify  => Service["nftables"],
77
      }
78
      EOS
79
      apply_manifest(pp, expect_failures: true)
80
    end
81
    describe service('nftables') do
82
      it { is_expected.to be_running }
83
      it { is_expected.to be_enabled }
84
    end
85
  end
55 86
end

Formats disponibles : Unified diff