mariusvam / omaha

Automatically exported from code.google.com/p/omaha
Apache License 2.0
1 stars 0 forks source link

install_self_unittest_no_xml_parser unit tests fail on Windows 7 as non-admin #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Build as non-admin on Windows 7

What is the expected output? What do you see instead?
Expect build to succeed, but the install_self_unittest_no_xml_parser unit tests 
fail (these run automatically as part of the build).

What version of the product are you using? On what operating system?
r109 on Windows 7.

Please provide any additional information below.
I believe that this failure is spurious.

The tests check that HasXmlParser() fails when the registry is redirected with 
RegOverridePredefKey(), because the MSXML library needs to read registry keys 
that no longer exist when the registry is redirected.

However, when running as non-admin on Windows 7, the registry is not fully 
redirected. Crucially, the accesses that would have caused MSXML to fail are 
not redirected, and so HasXmlParser() does not fail.

I've created a minimal reproduction and attached it to this issue, along with 
the logs produced by procmon when running as admin and non-admin.

I've also created a patch which simply ignores the tests if the user is not an 
admin.

Original issue reported on code.google.com by ben.chal...@red-gate.com on 10 Jan 2012 at 12:25

Attachments:

GoogleCodeExporter commented 8 years ago
I believe this user had the same issue: 
http://groups.google.com/group/omaha-discuss/browse_thread/thread/9823c152cec8e7
8d .

Original comment by ben.chal...@red-gate.com on 10 Jan 2012 at 12:27

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
A large number of the unit tests explicitly require that they be run as an 
admin (i.e. from an elevated command prompt).  At the moment, too many of them 
depend on the ability to temporarily redirect registry hives.

We've got a work item to consider refactoring unit tests at some point in the 
future to not use registry redirection, but for now, sticking to running them 
as admin (or patching all such tests to not run when non-admin) is suggested.  
Thank you for the report, though!

Original comment by ryanmyers@google.com on 16 Mar 2012 at 7:48