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

Remove Solaris 10 conditional logic from beaker tests

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Duplicate
    • None
    • None
    • None
    • Night's Watch

    Description

      Tests tests/config/apply_file_metadata_specified_in_config.rb, tests/resource/file/symbolic_modes.rb, and acceptance/tests/ticket_9862_puppet_runs_without_service_user_or_group_present.rb are disabled on Solaris 10 in PR https://github.com/puppetlabs/puppet/pull/4219.

      The simplest approach to fixing them is to install stat on the Solaris 10 test VMs.

      Alternatively, we could change the stat helper to

            def stat(host, path)
              owner, group, mode =
                if host['platform'] =~ /solaris-10/
                  stats = on(host, "ls -ld #{path}").stdout.split
                  mode = (0..8).inject(0) do |m, i|
                    if stats[0][i+1] =~ /[rwxst]/
                      m + 2**(8-i)
                    else
                      m
                    end
                  end
                  if stats[0][3] == 's'
                    mode += 04000
                  end
                  if stats[0][6] =~ /[lsS]/
                    mode += 02000
                  end
                  if stats[0] =~ /[tT]/
                    mode += 01000
                  end
                  [stats[2], stats[3], mode.to_s(8)]
                else
                  stat_command = case host['platform']
                                 when /osx/
                                   "stat -f '%Su:%Sg:%p'"
                                 else
                                   "stat --format '%U:%G:%a'"
                                 end
       
                  permissions = on(host, "#{stat_command} #{path}").stdout.chomp
                  permissions.split(':')
                end
       
              puts owner, group, mode
              [owner, group, mode.to_i(8) & 07777]
            end
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              michael.smith Michael Smith
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support