Mercurial > public > mercurial-scm > hg-stable
comparison contrib/automation/hgautomation/aws.py @ 43411:a77338d2bdab stable
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
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 17 Oct 2019 16:46:13 -0400 |
parents | c09e8ac3f61f |
children | 3d53f9cc73ab |
comparison
equal
deleted
inserted
replaced
43410:9bab6407c2c9 | 43411:a77338d2bdab |
---|---|
189 # Configure UAC to allow privilege elevation in remote shells | 189 # Configure UAC to allow privilege elevation in remote shells |
190 $Key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' | 190 $Key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' |
191 $Setting = 'LocalAccountTokenFilterPolicy' | 191 $Setting = 'LocalAccountTokenFilterPolicy' |
192 Set-ItemProperty -Path $Key -Name $Setting -Value 1 -Force | 192 Set-ItemProperty -Path $Key -Name $Setting -Value 1 -Force |
193 | 193 |
194 # Avoid long usernames in the temp directory path because the '~' causes extra quoting in ssh output | |
195 [System.Environment]::SetEnvironmentVariable('TMP', 'C:\Temp', [System.EnvironmentVariableTarget]::User) | |
196 [System.Environment]::SetEnvironmentVariable('TEMP', 'C:\Temp', [System.EnvironmentVariableTarget]::User) | |
197 | |
194 # Configure and restart the WinRM Service; Enable the required firewall exception | 198 # Configure and restart the WinRM Service; Enable the required firewall exception |
195 Stop-Service -Name WinRM | 199 Stop-Service -Name WinRM |
196 Set-Service -Name WinRM -StartupType Automatic | 200 Set-Service -Name WinRM -StartupType Automatic |
197 netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new action=allow localip=any remoteip=any | 201 netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new action=allow localip=any remoteip=any |
198 Start-Service -Name WinRM | 202 Start-Service -Name WinRM |