diff --git a/.fixtures.yml b/.fixtures.yml index 992c59f..4b408ff 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,19 +1,9 @@ fixtures: repositories: - 'nisclient': - repo: 'https://github.com/Ericsson/puppet-module-nisclient.git' - ref: 'v2.0.0' - 'nsswitch': - repo: 'https://github.com/ghoneycutt/puppet-module-nsswitch.git' - ref: 'v1.0.0' - 'pam': - repo: 'https://github.com/ghoneycutt/puppet-module-pam.git' - ref: 'v3.10.0' - 'rpcbind': - repo: 'https://github.com/ghoneycutt/puppet-module-rpcbind.git' - ref: 'v3.0.0' - 'stdlib': - repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git' - ref: 'v8.2.0' + 'nisclient': 'https://github.com/Ericsson/puppet-module-nisclient.git' + 'nsswitch': 'https://github.com/kodguru/puppet-nsswitch.git' + 'pam': 'https://github.com/kodguru/puppet-module-pam.git' + 'rpcbind': 'https://github.com/kodguru/puppet-module-rpcbind.git' + 'stdlib': 'https://github.com/puppetlabs/puppetlabs-stdlib.git' symlinks: vas: "#{source_dir}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 5c39551..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,92 +0,0 @@ ---- -name: CI - -on: pull_request - -concurrency: - group: ${{ github.head_ref }} - cancel-in-progress: true - -jobs: - setup_matrix: - name: Setup Test Matrix - runs-on: ubuntu-20.04 - timeout-minutes: 40 - outputs: - puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }} - github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }} - steps: - - uses: actions/checkout@v3 - - - name: Setup ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7.3' - bundler-cache: true - - - name: Run static validations - run: bundle exec rake validate lint - - - name: Run rake rubocop - run: bundle exec rake rubocop - - - name: Setup Test Matrix - id: get-outputs - run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false - - unit: - needs: setup_matrix - runs-on: ubuntu-20.04 - timeout-minutes: 40 - strategy: - fail-fast: false - matrix: - include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}} - name: Spec Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) - steps: - - uses: actions/checkout@v3 - - - name: Setup ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - - name: Run tests - run: bundle exec rake parallel_spec - -# TODO: active when acceptance tests have been added -# acceptance: -# name: Litmus Acceptance -# runs-on: ubuntu-20.04 -# env: -# BOLT_GEM: true -# CI: true -# steps: -# - uses: actions/checkout@v3 -# - name: Setup ruby -# uses: ruby/setup-ruby@v1 -# with: -# ruby-version: '2.7.3' -# bundler-cache: true -# -# - name: Provision Testing Environments -# run: | -# bundle exec rake 'litmus:provision_list[default]' -# bundle exec rake 'litmus:install_agent' -# bundle exec rake 'litmus:install_module' -# - name: Run Tests -# run: bundle exec rake 'litmus:acceptance:parallel' -# -# - name: Tear Down -# run: bundle exec rake 'litmus:tear_down' - - tests: - needs: - - unit -# TODO: active when acceptance tests have been added -# - acceptance - runs-on: ubuntu-20.04 - name: Test suite - steps: - - run: echo Test suite completed diff --git a/.github/workflows/run-pdk-tests-on-puppet-7.yml b/.github/workflows/run-pdk-tests-on-puppet-7.yml new file mode 100644 index 0000000..d48444d --- /dev/null +++ b/.github/workflows/run-pdk-tests-on-puppet-7.yml @@ -0,0 +1,18 @@ +name: Run PDK tests on Puppet 7.x + +on: + - push + - pull_request + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Run unit tests + # Modified puppets-epic-show-theatre with gcc and make installed + uses: kodguru/action-pdk-test-unit@buildtools + with: + puppet-version: "7" diff --git a/.github/workflows/run-pdk-validate.yml b/.github/workflows/run-pdk-validate.yml new file mode 100644 index 0000000..7e2d8b6 --- /dev/null +++ b/.github/workflows/run-pdk-validate.yml @@ -0,0 +1,17 @@ +--- +name: Run PDK validate + +on: + - push + - pull_request + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Run pdk validate + # Modified puppets-epic-show-theatre with gcc and make installed + uses: kodguru/action-pdk-test-unit@buildtools diff --git a/.gitignore b/.gitignore index 988dcbb..3f15512 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ /convert_report.txt diff --git a/.pdkignore b/.pdkignore index c538bea..862847a 100644 --- a/.pdkignore +++ b/.pdkignore @@ -16,7 +16,7 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ /convert_report.txt @@ -26,20 +26,17 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml -/appveyor.yml -/.editorconfig /.fixtures.yml /Gemfile /.gitattributes +/.github/ /.gitignore -/.gitlab-ci.yml /.pdkignore /.puppet-lint.rc /Rakefile /rakelib/ /.rspec -/.rubocop.yml -/.travis.yml +/..yml /.yardopts /spec/ /.vscode/ diff --git a/.rubocop.yml b/.rubocop.yml index 31e8248..5be1f9f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ require: - rubocop-rspec AllCops: DisplayCopNames: true - TargetRubyVersion: '2.5' + TargetRubyVersion: '2.6' Include: - "**/*.rb" Exclude: @@ -111,8 +111,14 @@ Style/MethodCalledOnDoEndBlock: Enabled: true Style/StringMethods: Enabled: true +Bundler/GemFilename: + Enabled: false Bundler/InsecureProtocolSource: Enabled: false +Capybara/CurrentPathExpectation: + Enabled: false +Capybara/VisibilityMatcher: + Enabled: false Gemspec/DuplicatedAssignment: Enabled: false Gemspec/OrderedDependencies: @@ -287,11 +293,9 @@ Performance/UriDefaultParser: Enabled: false RSpec/Be: Enabled: false -RSpec/Capybara/CurrentPathExpectation: - Enabled: false RSpec/Capybara/FeatureMethods: Enabled: false -RSpec/Capybara/VisibilityMatcher: +RSpec/ContainExactly: Enabled: false RSpec/ContextMethod: Enabled: false @@ -331,6 +335,8 @@ RSpec/LeakyConstantDeclaration: Enabled: false RSpec/LetBeforeExamples: Enabled: false +RSpec/MatchArray: + Enabled: false RSpec/MissingExampleGroupArgument: Enabled: false RSpec/MultipleExpectations: @@ -373,8 +379,6 @@ Style/AccessModifierDeclarations: Enabled: false Style/AccessorGrouping: Enabled: false -Style/AsciiComments: - Enabled: false Style/BisectedAttrAccessor: Enabled: false Style/CaseLikeIf: @@ -485,35 +489,235 @@ Style/TrailingMethodEndStatement: Enabled: false Style/UnpackFirst: Enabled: false +Capybara/MatchStyle: + Enabled: false +Capybara/NegationMatcher: + Enabled: false +Capybara/SpecificActions: + Enabled: false +Capybara/SpecificFinders: + Enabled: false +Capybara/SpecificMatcher: + Enabled: false +Gemspec/DeprecatedAttributeAssignment: + Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false +Gemspec/RequireMFA: + Enabled: false +Layout/LineContinuationLeadingSpace: + Enabled: false +Layout/LineContinuationSpacing: + Enabled: false +Layout/LineEndStringConcatenationIndentation: + Enabled: false +Layout/SpaceBeforeBrackets: + Enabled: false +Lint/AmbiguousAssignment: + Enabled: false +Lint/AmbiguousOperatorPrecedence: + Enabled: false +Lint/AmbiguousRange: + Enabled: false +Lint/ConstantOverwrittenInRescue: + Enabled: false +Lint/DeprecatedConstants: + Enabled: false Lint/DuplicateBranch: Enabled: false +Lint/DuplicateMagicComment: + Enabled: false Lint/DuplicateRegexpCharacterClassElement: Enabled: false Lint/EmptyBlock: Enabled: false Lint/EmptyClass: Enabled: false +Lint/EmptyInPattern: + Enabled: false +Lint/IncompatibleIoSelectWithFiberScheduler: + Enabled: false +Lint/LambdaWithoutLiteralBlock: + Enabled: false Lint/NoReturnInBeginEndBlocks: Enabled: false +Lint/NonAtomicFileOperation: + Enabled: false +Lint/NumberedParameterAssignment: + Enabled: false +Lint/OrAssignmentToConstant: + Enabled: false +Lint/RedundantDirGlobSort: + Enabled: false +Lint/RefinementImportMethods: + Enabled: false +Lint/RequireRangeParentheses: + Enabled: false +Lint/RequireRelativeSelfPath: + Enabled: false +Lint/SymbolConversion: + Enabled: false Lint/ToEnumArguments: Enabled: false +Lint/TripleQuotes: + Enabled: false Lint/UnexpectedBlockArity: Enabled: false Lint/UnmodifiedReduceAccumulator: Enabled: false +Lint/UselessRescue: + Enabled: false +Lint/UselessRuby2Keywords: + Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false +Naming/BlockForwarding: + Enabled: false Performance/CollectionLiteralInLoop: Enabled: false +Performance/ConcurrentMonotonicTime: + Enabled: false +Performance/MapCompact: + Enabled: false +Performance/RedundantEqualityComparisonBlock: + Enabled: false +Performance/RedundantSplitRegexpArgument: + Enabled: false +Performance/StringIdentifierArgument: + Enabled: false +RSpec/BeEq: + Enabled: false +RSpec/BeNil: + Enabled: false +RSpec/ChangeByZero: + Enabled: false +RSpec/ClassCheck: + Enabled: false +RSpec/DuplicatedMetadata: + Enabled: false +RSpec/ExcessiveDocstringSpacing: + Enabled: false +RSpec/FactoryBot/ConsistentParenthesesStyle: + Enabled: false +RSpec/FactoryBot/FactoryNameStyle: + Enabled: false +RSpec/FactoryBot/SyntaxMethods: + Enabled: false +RSpec/IdenticalEqualityAssertion: + Enabled: false +RSpec/NoExpectationExample: + Enabled: false +RSpec/PendingWithoutReason: + Enabled: false +RSpec/Rails/AvoidSetupHook: + Enabled: false +RSpec/Rails/HaveHttpStatus: + Enabled: false +RSpec/Rails/InferredSpecType: + Enabled: false +RSpec/Rails/MinitestAssertions: + Enabled: false +RSpec/Rails/TravelAround: + Enabled: false +RSpec/RedundantAround: + Enabled: false +RSpec/SkipBlockInsideExample: + Enabled: false +RSpec/SortMetadata: + Enabled: false +RSpec/SubjectDeclaration: + Enabled: false +RSpec/VerifiedDoubleReference: + Enabled: false +Security/CompoundHash: + Enabled: false +Security/IoMethods: + Enabled: false Style/ArgumentsForwarding: Enabled: false +Style/ArrayIntersect: + Enabled: false Style/CollectionCompact: Enabled: false +Style/ComparableClamp: + Enabled: false +Style/ConcatArrayLiterals: + Enabled: false +Style/DirEmpty: + Enabled: false Style/DocumentDynamicEvalDefinition: Enabled: false +Style/EmptyHeredoc: + Enabled: false +Style/EndlessMethod: + Enabled: false +Style/EnvHome: + Enabled: false +Style/FetchEnvVar: + Enabled: false +Style/FileEmpty: + Enabled: false +Style/FileRead: + Enabled: false +Style/FileWrite: + Enabled: false +Style/HashConversion: + Enabled: false +Style/HashExcept: + Enabled: false +Style/IfWithBooleanLiteralBranches: + Enabled: false +Style/InPatternThen: + Enabled: false +Style/MagicCommentFormat: + Enabled: false +Style/MapCompactWithConditionalBlock: + Enabled: false +Style/MapToHash: + Enabled: false +Style/MapToSet: + Enabled: false +Style/MinMaxComparison: + Enabled: false +Style/MultilineInPatternThen: + Enabled: false Style/NegatedIfElseCondition: Enabled: false +Style/NestedFileDirname: + Enabled: false Style/NilLambda: Enabled: false +Style/NumberedParameters: + Enabled: false +Style/NumberedParametersLimit: + Enabled: false +Style/ObjectThen: + Enabled: false +Style/OpenStructUse: + Enabled: false +Style/OperatorMethodCall: + Enabled: false +Style/QuotedSymbols: + Enabled: false Style/RedundantArgument: Enabled: false +Style/RedundantConstantBase: + Enabled: false +Style/RedundantDoubleSplatHashBraces: + Enabled: false +Style/RedundantEach: + Enabled: false +Style/RedundantHeredocDelimiterQuotes: + Enabled: false +Style/RedundantInitialize: + Enabled: false +Style/RedundantSelfAssignmentBranch: + Enabled: false +Style/RedundantStringEscape: + Enabled: false +Style/SelectByRegexp: + Enabled: false +Style/StringChars: + Enabled: false Style/SwapValues: Enabled: false diff --git a/.sync.yml b/.sync.yml index 59d422e..f9b1b83 100644 --- a/.sync.yml +++ b/.sync.yml @@ -17,17 +17,10 @@ Gemfile: unmanaged: false optional: ':development': - - gem: 'github_changelog_generator' - version: '~> 1.15' - condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')" - gem: 'webmock' #linter_options: # - 'no-parameter_types-check' # - 'no-legacy_facts' - ':test': - # provides metadata2gha, needed for unit tests - - gem: 'puppet_metadata' - version: '~> 1.9.0' spec/spec_helper.rb: coverage_report: true diff --git a/Gemfile b/Gemfile index 763d232..7cb5dcb 100644 --- a/Gemfile +++ b/Gemfile @@ -14,35 +14,37 @@ def location_for(place_or_version, fake_version = nil) end group :development do - gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "voxpupuli-puppet-lint-plugins", '~> 3.1', require: false - gem "facterdb", '~> 1.18', require: false - gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false - gem "puppetlabs_spec_helper", '>= 3.0.0', '< 5.0.0', require: false - gem "rspec-puppet-facts", '~> 2.0', require: false - gem "codecov", '~> 0.2', require: false - gem "dependency_checker", '~> 0.2', require: false - gem "parallel_tests", '~> 3.4', require: false - gem "pry", '~> 0.10', require: false - gem "simplecov-console", '~> 0.5', require: false - gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '= 1.6.1', require: false - gem "rubocop-performance", '= 1.9.1', require: false - gem "rubocop-rspec", '= 2.0.1', require: false - gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "github_changelog_generator", '~> 1.15', require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0') - gem "webmock", require: false + gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false + gem "facterdb", '~> 1.18', require: false + gem "metadata-json-lint", '~> 3.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false + gem "rspec-puppet-facts", '~> 2.0', require: false + gem "codecov", '~> 0.2', require: false + gem "dependency_checker", '~> 1.0.0', require: false + gem "parallel_tests", '= 3.12.1', require: false + gem "pry", '~> 0.10', require: false + gem "simplecov-console", '~> 0.5', require: false + gem "puppet-debugger", '~> 1.0', require: false + gem "rubocop", '= 1.48.1', require: false + gem "rubocop-performance", '= 1.16.0', require: false + gem "rubocop-rspec", '= 2.19.0', require: false + gem "puppet-strings", '~> 4.0', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "webmock", require: false end group :system_tests do - gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby] - gem "serverspec", '~> 2.41', require: false + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "serverspec", '~> 2.41', require: false end -group :test do - gem "puppet_metadata", '~> 1.9.0', require: false +group :release_prep do + gem "puppet-strings", '~> 4.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index 0f8754e..74415a9 100644 --- a/Rakefile +++ b/Rakefile @@ -1,12 +1,11 @@ # frozen_string_literal: true require 'bundler' -require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? +require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' -require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? -require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? -require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any? +require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator' +require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' def changelog_user return unless Rake.application.top_level_tasks.include? "changelog" @@ -44,7 +43,7 @@ end PuppetLint.configuration.send('disable_relative') -if Bundler.rubygems.find_name('github_changelog_generator').any? +if Gem.loaded_specs.key? 'github_changelog_generator' GitHubChangelogGenerator::RakeTask.new :changelog do |config| raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? config.user = "#{changelog_user}" diff --git a/metadata.json b/metadata.json index 3e8e9e5..7799485 100644 --- a/metadata.json +++ b/metadata.json @@ -12,16 +12,16 @@ "name": "ericsson/nisclient" }, { - "version_requirement": ">= 1.0.0 < 2.0.0", - "name": "ghoneycutt/nsswitch" + "version_requirement": ">= 2.0.0 < 3.0.0", + "name": "kodguru/nsswitch" }, { - "version_requirement": ">= 3.10.0 < 4.0.0", - "name": "ghoneycutt/pam" + "version_requirement": ">= 3.9.0 < 4.0.0", + "name": "kodguru/pam" }, { "version_requirement": ">= 3.0.0 < 4.0.0", - "name": "ghoneycutt/rpcbind" + "name": "kodguru/rpcbind" }, { "version_requirement": ">= 7.0.1 < 9.0.0", @@ -97,7 +97,7 @@ } ], "description": "Manage VAS - DELL Authentication Services / QAS / VAS", - "pdk-version": "2.6.1", - "template-url": "pdk-default#2.7.1", - "template-ref": "tags/2.7.1-0-g9a16c87" + "pdk-version": "3.0.1", + "template-url": "pdk-default#3.0.1", + "template-ref": "tags/3.0.1-0-gd13288a" } diff --git a/spec/classes/data_types_spec.rb b/spec/classes/data_types_spec.rb index c7a9c7c..ee4fac6 100644 --- a/spec/classes/data_types_spec.rb +++ b/spec/classes/data_types_spec.rb @@ -22,11 +22,11 @@ on_supported_os(test_on).each do |_os, os_facts| describe 'variable data type and content validations' do + let(:node) { 'data-types.example.com' } # set needed custom facts and variables let(:facts) do os_facts.merge( lsbmajdistrelease: os_facts[:os]['release']['major'], # Satisfy nisclient - fqdn: 'data-types.example.com', ) end @@ -147,7 +147,7 @@ params: { domain_change: true }, valid: ['test', 'test.ing', 't.est.ing', '10.2.4.2'], invalid: ['test ing', 'http:/test', 'https:/test.ing', ['array'], { 'ha' => 'sh' }, 3, 2.42, false], - message: 'expect.*Stdlib::Fqdn.*Stdlib::Compat::Ip_address', + message: 'expect.*Stdlib::Fqdn', }, 'Stdlib::Port (optional)' => { name: ['kdc_port', 'kpasswd_server_port'], diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index d7832ce..d6957de 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -10,6 +10,7 @@ on_supported_os.each do |os, os_facts| context "on #{os}" do + let(:node) { 'foo.example.com' } let(:facts) do os_facts.merge( lsbmajdistrelease: os_facts[:os]['release']['major'], # Satisfy nisclient diff --git a/spec/classes/parameter_spec.rb b/spec/classes/parameter_spec.rb index 5254240..f3a3970 100644 --- a/spec/classes/parameter_spec.rb +++ b/spec/classes/parameter_spec.rb @@ -22,6 +22,7 @@ on_supported_os(test_on).each do |_os, os_facts| describe 'parameter testing' do + let(:node) { 'foo.example.com' } let(:facts) do os_facts.merge( lsbmajdistrelease: os_facts[:os]['release']['major'], # Satisfy nisclient diff --git a/spec/classes/use_cases_spec.rb b/spec/classes/use_cases_spec.rb index 67f50e8..bf8dd4d 100644 --- a/spec/classes/use_cases_spec.rb +++ b/spec/classes/use_cases_spec.rb @@ -7,6 +7,7 @@ on_supported_os.each do |os, os_facts| context "on #{os} when value of vas_domain is an empty string (vasclnt package installed but not joined to an AD)" do + let(:node) { 'foo.example.com' } let(:facts) do os_facts.merge( vas_domain: '', @@ -23,6 +24,7 @@ on_supported_os.each do |os, os_facts| context "on #{os} when value of vas_domain is undef (vasclnt package installed but not joined to an AD)" do + let(:node) { 'foo.example.com' } let(:facts) do os_facts.merge( vas_domain: nil, diff --git a/spec/default_facts.yml b/spec/default_facts.yml index f777abf..3346c39 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -2,7 +2,8 @@ # # Facts specified here will override the values provided by rspec-puppet-facts. --- -ipaddress: "172.16.254.254" -ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" +networking: + ip: "172.16.254.254" + ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" + mac: "AA:AA:AA:AA:AA:AA" is_pe: false -macaddress: "AA:AA:AA:AA:AA:AA" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7f1ac39..7b55362 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,8 +25,8 @@ next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) - rescue => e + default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) + rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end end