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

Spec tests fail when run on a windows host whose name exceeds 15 characters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.7.1, PUP 4.8.1
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Quality Engineering
    • Story Points:
      1
    • Sprint:
      QE 2016-11-16
    • Release Notes:
      Not Needed

      Description

      Our windows jenkins agents in CI.Next have hostnames (not fqdn) longer than 15 characters. As a result Socket.gethostname and Win32 GetComputerName return different results (the former is a truncated version of the latter), e.g. jenkins-slave-w vs jenkins-slave-win2012r2-...

      Two tests in spec/integration/util/windows/principal_spec.rb fail because they are using Socket.gethostname when they instead need to use GetComputerName in subsequent calls to LookupAccountNameW.

      07:11:29   1) Puppet::Util::Windows::SID::Principal.lookup_account_name should create an instance from a local account prefixed with hostname
      07:11:29      Failure/Error: Puppet::Util::Windows::SID.sid_to_name(computer_sid.sid + '-500').split('\\').last :
      07:11:29      NoMethodError:
      07:11:29        undefined method `sid' for nil:NilClass
      07:11:29      # ./spec/integration/util/windows/principal_spec.rb:58:in `block (3 levels) in <top (required)>'
      07:11:29 
      07:11:29   2) Puppet::Util::Windows::SID::Principal.lookup_account_sid should create an instance from a user SID
      07:11:29      Failure/Error: bytes = (computer_sid.sid_bytes + [245, 1, 0, 0])
      07:11:29      NoMethodError:
      07:11:29        undefined method `sid_bytes' for nil:NilClass
      07:11:29      # ./spec/integration/util/windows/principal_spec.rb:125:in `block (3 levels) in <top (required)>'
      07:11:32 
      07:11:32 Finished in 22 minutes 37 seconds
      07:11:32 21740 examples, 2 failures, 67 pending
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            josh Josh Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support