# HG changeset patch # User Matt Harbison # Date 1571345173 14400 # Node ID a77338d2bdabb7aa81bb275b3794de7707843545 # Parent 9bab6407c2c9d8b4793e58e7f20c3771c61ec66c automation: avoid '~' in the temp directory on Windows If a long-ish username is used, the environment variable ends up with a '~' to be 8.3 path compatible. That in turn causes a handful of tests (mostly ssh related) to add quotes around $TESTMP. I have no AWS experience, so I have no idea if this is the proper way to do it. But I've hit this problem locally, and redirecting the directory is a workaround. I don't recall if the directory is created on demand by the test harness, but presumably if this is configured before the machine boots, Windows will do it for us. Differential Revision: https://phab.mercurial-scm.org/D7130 diff -r 9bab6407c2c9 -r a77338d2bdab contrib/automation/hgautomation/aws.py --- a/contrib/automation/hgautomation/aws.py Mon Nov 04 20:33:38 2019 -0800 +++ b/contrib/automation/hgautomation/aws.py Thu Oct 17 16:46:13 2019 -0400 @@ -191,6 +191,10 @@ $Setting = 'LocalAccountTokenFilterPolicy' Set-ItemProperty -Path $Key -Name $Setting -Value 1 -Force +# Avoid long usernames in the temp directory path because the '~' causes extra quoting in ssh output +[System.Environment]::SetEnvironmentVariable('TMP', 'C:\Temp', [System.EnvironmentVariableTarget]::User) +[System.Environment]::SetEnvironmentVariable('TEMP', 'C:\Temp', [System.EnvironmentVariableTarget]::User) + # Configure and restart the WinRM Service; Enable the required firewall exception Stop-Service -Name WinRM Set-Service -Name WinRM -StartupType Automatic