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

Compiling catalog for AIX actually executes commands when managing users with group

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: PUP 6.4.2
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 6.4.2
      Puppet Server Version: N/A
      OS Name/Version: AIX (any)

      When compiling a catalog for AIX, the user type causes the provider to actually execute commands using Puppet::Util::Execution.execute(). This is fine because they don't do anything and the catalog compiles fine anyway. However when we run tests on Windows with rspec-puppet, because it's pretending to be UNIX, the null_file is set to /dev/null https://github.com/puppetlabs/puppet/blob/3f7a06c50a8707811387dd60a6f7f26d94b606f4/lib/puppet/util/execution.rb#L191 and therefore ruby actually tries to read it, causing the catalog to fail with the following error:

      No such file or directory @ rb_sysopen - /dev/null
      

      This essentially means that it's impossible to test code destined for AIX on Windows if it includes a user resource that is managing groups (It's group management that causes this)

      This can be proven by putting a 'pry' into the above file and running any test that involves the following puppet code:
       

      user { 'foo':
        ensure => present,
        groups => ['test'],
      }
      

      You will see that it actually calls out and executes some commands, which it definitely shouldn't be doing as part of catalog compilation.

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            dylan.ratcliffe Dylan Ratcliffe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support