1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
# frozen_string_literal: true
require_relative '../../../helpers/unit/provider/elasticsearch_rest_shared_examples'
describe Puppet::Type.type(:elasticsearch_license).provider(:xpack) do # rubocop:disable RSpec/MultipleMemoizedHelpers
let(:name) { 'xpack' }
let(:example1) do
{
name: 'xpack',
ensure: :present,
provider: :xpack,
content: {
'license' => {
'status' => 'active',
'uid' => 'cbff45e7-c553-41f7-ae4f-9205eabd80xx',
'type' => 'trial',
'issue_date' => '2018-02-22T23:12:05.550Z',
'issue_date_in_millis' => 1_519_341_125_550,
'expiry_date' => '2018-03-24T23:12:05.550Z',
'expiry_date_in_millis' => 1_521_933_125_550,
'max_nodes' => 1_000,
'issued_to' => 'test',
'issuer' => 'elasticsearch',
'start_date_in_millis' => 1_513_814_400_000
}
}
}
end
let(:json1) do
{
'license' => {
'status' => 'active',
'uid' => 'cbff45e7-c553-41f7-ae4f-9205eabd80xx',
'type' => 'trial',
'issue_date' => '2018-02-22T23:12:05.550Z',
'issue_date_in_millis' => '1519341125550',
'expiry_date' => '2018-03-24T23:12:05.550Z',
'expiry_date_in_millis' => '1521933125550',
'max_nodes' => '1000',
'issued_to' => 'test',
'issuer' => 'elasticsearch',
'start_date_in_millis' => '1513814400000'
}
}
end
let(:resource) { Puppet::Type::Elasticsearch_index.new props }
let(:provider) { described_class.new resource }
let(:props) do
{
name: name,
settings: {
'index' => {
'number_of_replicas' => 0
}
}
}
end
include_examples 'REST API', 'xpack/license', nil, true
end
|