Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-8459

ENC acceptance tests didn't catch regression

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 5.3.6, PUP 5.5.0
    • None
    • None
    • Platform Core
    • Platform Core KANBAN
    • Inspection
    • Not Needed
    • No Action

    Description

      Puppet Version: 5.3.x
      Puppet Server Version: 5.1.x

      We have various beaker acceptance tests to ensure agent and server-specified environments work as expected. Unfortunately they did not catch the regression introduced by PUP-8225 and fixed in PUP-8419. The reason is because the tests only verify that the agent eventually converges on the right environment, but doesn't test that the agent's initial node request succeeds and starts the agent off in the correct environment.

      For example, the following test only verifies that the notify resource emits the correct environment, but the agent's not request should not have failed, and it shouldn't have had to switch environments based on the catalog's environment:

      17:23:17 Begin ruby/puppet/acceptance/tests/environment/use_enc_environment.rb
      ...
      17:23:44 u0nh9955a5qfx91.delivery.puppetlabs.net (redhat6-64-2) 01:23:44$ puppet agent --no-daemonize --onetime --server cuzrxlwd8pszvvb.delivery.puppetlabs.net --verbose
      17:23:44   Warning: Unable to fetch my node definition, but the agent run will continue:
      17:23:46   Warning: Could not intern from application/json: Could not find a directory environment named 'special' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?
      17:23:46   Info: Retrieving pluginfacts
      17:23:46   Info: Retrieving plugin
      17:23:46   Info: Retrieving locales
      17:23:46   Info: Caching catalog for u0nh9955a5qfx91.delivery.puppetlabs.net
      17:23:46   Notice: Local environment: 'production' doesn't match server specified environment 'special', restarting agent run with environment 'special'
      17:23:46   Info: Retrieving pluginfacts
      17:23:46   Info: Retrieving plugin
      17:23:46   Info: Retrieving locales
      17:23:46   Info: Caching catalog for u0nh9955a5qfx91.delivery.puppetlabs.net
      17:23:47   Info: Applying configuration version '1517448226'
      17:23:47   Notice: expected_string
      17:23:47   Notice: /Stage[main]/Main/Notify[expected_string]/message: defined 'message' as 'expected_string'
      17:23:47   Notice: Applied catalog in 0.02 seconds
      

      We also need to test that setting server_list also works (since we make a node request to see if the server is available).

      Attachments

        Issue Links

          Activity

            People

              eric.delaney Eric Delaney
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support