[FACT-1442] facter/acceptance/test/facts/window.rb fails on windows 10 x86 and x64 platforms Created: 2016/06/21  Updated: 2017/04/10  Resolved: 2016/06/24

Status: Resolved
Project: Facter
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: CI Blocker Priority: Major
Reporter: Sean Griffin Assignee: Glenn Sarti
Resolution: Fixed Votes: 0
Labels: Windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relates to IMAGES-184 Windows-2008 & R2: Update VMPooler (W... Resolved
relates to IMAGES-212 Windows-10: Update VMPooler (Win, Cyg... Resolved
relates to IMAGES-6 Windows-10: Revise Cygwin version to ... Closed
relates to FACT-1446 acceptance: Improve the windows user ... Resolved
relates to IMAGES-480 Use LSA for Cygwin authentication on ... Resolved
CI Pipeline/s:
platform puppet-agent
Story Points: 2
Sprint: Windows 2016-06-29


The facter windows acceptance test: facter/acceptance/tests/facts/windows.rb has recently been enabled to run on windows 10 platforms. On Windows 10, the fact 'identity.user' returns 'NT AUTHORITY\LOCAL SERVICE', not something like 'LH51M655D7JULJ9\cyg_server' like the other windows platforms as the test expects.

This causes facter master pipeline failures on windows10ent-64 and window10ent-32 platforms:



Comment by Glenn Sarti [ 2016/06/21 ]

Potentially this is a cygwin configuration issue although it does seem that the test is perhaps too brittle i.e. It should be testing that a sensible value is returned, not that a specific username is returned.

The failing test;

Differences between Windows 10 and 2012R2 pooler images

Win 10
declare -x USER="Administrator"
declare -x USERNAME="Administrator"
declare -x USERPROFILE="C:\\Users\\Administrator"
declare -x WINDIR="C:\\Windows"
Administrator@r8hbj0mymgzngmu ~
$ uname -r
Administrator@r8hbj0mymgzngmu ~
$ uname -a
CYGWIN_NT-10.0 r8hbj0mymgzngmu 2.5.1(0.297/5/3) 2016-04-21 22:14 x86_64 Cygwin
$ cmd /c facter.exe
2016-06-21 19:06:00.968059 WARN  puppetlabs.facter - could not locate a ruby library: facts requiring Ruby will not be resolved.
dmi => {
  manufacturer => "Phoenix Technologies LTD",
  product => {
    name => "VMware Virtual Platform",
    serial_number => "VMware-42 0f 9c 5f 95 bd b1 86-bf 23 d2 3e ad 90 ba c4"
facterversion => 3.2.0
identity => {
is_virtual => true
kernel => windows
kernelmajversion => 10.0
kernelrelease => 10.0.10240
kernelversion => 10.0.10240
Win 2012
declare -x TEMP="/tmp"
declare -x TERM="xterm-256color"
declare -x TMP="/tmp"
declare -x TZ="America/Los_Angeles"
declare -x USER="Administrator"
declare -x USERNAME="Administrator"
declare -x USERPROFILE="C:\\Users\\Administrator"
declare -x WINDIR="C:\\Windows"
Administrator@hydidbjaumxw9yb ~
$ uname -a
CYGWIN_NT-6.3 hydidbjaumxw9yb 2.4.0(0.293/5/3) 2016-01-15 16:16 x86_64 Cygwin
Administrator@hydidbjaumxw9yb ~
facterversion => 3.2.0
identity => {
  user => "HYDIDBJAUMXW9YB\cyg_server"
is_virtual => true
kernel => windows
kernelmajversion => 6.3
kernelrelease => 6.3.9600

Comment by Glenn Sarti [ 2016/06/21 ]

Perhaps the regex should be looking for;

<alpha numerics and spaces>\<alpha numerics and spaces>

Comment by Sean Griffin [ 2016/06/23 ]

This is now failing on windows2008r2-64a.https://jenkins.puppetlabs.com/job/platform_puppet-agent_intn-van-sys_suite-daily-facter-master/SLAVE_LABEL=beaker,TEST_TARGET=windows2008r2-64a/127/console

18:25:27 Failed Tests Cases:
18:25:27   Test Case tests/facts/windows.rb reported: #<Minitest::Assertion: Expected /.*\\cyg_server/ to match "".>

facter identity.user returns and empty string.

Administrator@kxz6gga5h5kibir ~
$ cmd.exe /c facter indentity.user
Administrator@kxz6gga5h5kibir ~

Comment by Glenn Sarti [ 2016/06/23 ]

Bringing into the 29 June Sprint as three platforms are now affected.

Comment by Josh Cooper [ 2016/06/23 ]

I wonder if the sshd servers are configured the same across different templates as that is what decides what user account beaker over ssh commands run as.

Comment by Glenn Sarti [ 2016/06/23 ]

John OConner has reverted the updated 2008R2 and 2008 templates. Still need to update the regex

Comment by Glenn Sarti [ 2016/06/23 ]

Raised PR for the regex change;

Comment by Glenn Sarti [ 2016/06/23 ]

Regex change has been merged. Waiting for the overnight jobs to run

Comment by Glenn Sarti [ 2016/06/24 ]

Pipeline has gone green. Closing this ticket

Generated at Sat May 25 17:57:14 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.