Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335864 - ResourceAttributeTest fails on Windows 7 due to running "ln"
Summary: ResourceAttributeTest fails on Windows 7 due to running "ln"
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Szymon Brandys CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 328889
Blocks: 331716
  Show dependency tree
 
Reported: 2011-01-31 11:16 EST by Martin Oberhuber CLA
Modified: 2011-03-21 09:41 EDT (History)
2 users (show)

See Also:


Attachments
Patch fixing the issue (2.19 KB, patch)
2011-01-31 11:17 EST, Martin Oberhuber CLA
no flags Details | Diff
Additional patch to CoreTest harness for Win7 64bit (3.75 KB, patch)
2011-01-31 13:11 EST, Martin Oberhuber CLA
no flags Details | Diff
Improved patch to CoreTest harness for Win7 64bit, prints failure cause (4.32 KB, patch)
2011-01-31 13:25 EST, Martin Oberhuber CLA
no flags Details | Diff
patch v3 to CoreTest harness for Win7, makes version check protected (4.32 KB, patch)
2011-01-31 14:01 EST, Martin Oberhuber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2011-01-31 11:16:36 EST
+++ This bug was initially created as a clone of Bug #328889 +++

Similar to bug 328889, ResourceAttributeTest also tries to run "ln" on
Windows 7. I assume that this had not been detected before because the
ResourceAttributeTest isn't part of the AutomatedTests suite.
Comment 1 Martin Oberhuber CLA 2011-01-31 11:17:57 EST
Created attachment 187978 [details]
Patch fixing the issue
Comment 2 Martin Oberhuber CLA 2011-01-31 13:11:12 EST
Created attachment 187987 [details]
Additional patch to CoreTest harness for Win7 64bit

Attached additional patch is needed to run on Win7 64bit, because "mklink" is not an exe but a cmd builtin. I also improved the check whether running on vista or higher, such that we won't have to edit the code again when the next version of Windows comes out.
Comment 3 Martin Oberhuber CLA 2011-01-31 13:16:42 EST
I committed the 1st patch, but apparently I don't have commit rights on 

   o.e.core.tests.harness

Szymon could you commit the 2nd patch please?

I tested this on my Win7 64-bit system. Note that in order for "mklink" to succeed, I had to run my Eclipse host with elevated privileges. To do so, 

  1. create a Windows Shortcut pointing to your eclipse.exe
  2. Right-click > Properties on the Shortcut
  3. Click the "Advanced" button
  4. Enable the "Run as Administrator" checkbox

Interestingly, just being logged in as an Administrator was not sufficient. I had to explicitly run Eclipse as an administrator (ie with elevated privileges) too. This seems to be a known and desired behavior by Microsoft. In order to run "mklink" on commandline, the cmd.exe also has to run with elevated privileges.

I did not test this on Vista, nor on Wind7-32bit but looking at the code I do expect this to still work.
Comment 4 Martin Oberhuber CLA 2011-01-31 13:25:48 EST
Created attachment 187988 [details]
Improved patch to CoreTest harness for Win7 64bit, prints failure cause
Comment 5 John Arthorne CLA 2011-01-31 13:35:58 EST
This failure also mentioned in bug 331716, but feel free to release this one separately.
Comment 6 Martin Oberhuber CLA 2011-01-31 14:01:56 EST
Created attachment 187993 [details]
patch v3 to CoreTest harness for Win7, makes version check protected

Attached patch v3 enables checking the windows version (needed for fixing 
bug 331716)
Comment 7 Szymon Brandys CLA 2011-03-21 08:26:28 EDT
*** Bug 336659 has been marked as a duplicate of this bug. ***
Comment 8 Szymon Brandys CLA 2011-03-21 09:41:07 EDT
"patch v3..." committed.