Hi Roger/Daan,

Sorry for coming late to the party, and my apologies in advance!

You’re right as the base value for “getVirtualDiskPath” is hardcoded in 
com.cloud.hypervisor.ovm3.resources.helpers Ovm3Configuration,java’s variable 
agentOvmRepoPath. I never thought about it as OVM3 is linux itself and I 
developed it on Mac/Linux, so my bad as I should have used File.seperator 
there. The same goes for “getAgentSecStoragePath”’s agentSecStoragePath 
variable 

The second part of the booboo is in the tests themselves actually as you’ve 
noticed, so I’ll have to place the File.seperator there too in XenTest.java.

Thanks for reaching out!

@Daan: I can fix it in the ovm3rebase branch so you can pick it out ?

Cheers,

Funs

> On 26 Mar 2015, at 21:32, Daan Hoogland <daan.hoogl...@gmail.com> wrote:
> 
> Well, these are interesting questions.
> 
> A generic solution is to split the path on both seperators in a
> generic (util) method. this would solve both a mixed and an unexpected
> case. On caveat is that for some reason a mixed case might be
> intentional though i can't see why right now.
> 
> Another tactic is to go for the root and solve it there but as this is
> a heterogeneous system, the root might be outside the java realm. Not
> that this would make solving on input inpossible but it would make it
> harder.
> 
> as a direct solution to run tests on a window based test system you
> might consider building using skipTests. that will not run unit tests
> during build.
> 
> third option is to abandon windows support which is not really an
> option but maybe a way for you to go (build in a virtualmachine).
> Hyperv is a target so you don't have to worry about my wishful
> thinking.
> 
> 
> 
> On Thu, Mar 26, 2015 at 9:02 PM, Roger Crerie <roger.cre...@hds.com> wrote:
>> Daan I looked in my GIT histories and I see the commit 
>> a4c23b170e4c94d4ed4783b19a051ad8f6c45328  (findbugs: just in case we run on 
>> windows, use save expression)  So that is where my first problem is coming 
>> from.  Using Cygwin on Windows my file separators are the '/' character BUT 
>> Java stills sees them as....
>> 2015-03-26 15:44:34 DEBUG Xen:441 - System File.separator = \
>> 2015-03-26 15:44:34 DEBUG Xen:442 - System File.separatorChar = \
>> 
>> So in this case using Cygwin on windows and running these tests the tests 
>> fail here.   Being new to cloudstack I am not sure that this merits a code 
>> fix to handle this situation.   I do know that the documentation on the wiki 
>> (https://cwiki.apache.org/confluence/display/CLOUDSTACK/Setting+up+a+CloudStack+dev+environment+on+Windows)
>>   gives you instructions on windows to download cygwin and install it on 
>> your window system.
>> 
>> The second location I found a problem is trickier. We have 2 separate issues.
>> 
>> 1.) the getVirtualDiskPath() call creates you a VDisk path which contains 
>> different path separators (due in large part to the 
>> config.getAgentOvnRepoPath() call).
>> 2.) the StoragePlugin.storagePluginCreate call returns back a FileProperties 
>> file where all the separators are "/" and not '\' as defined by 
>> File.serparator.
>> 
>> Again this is probably a Cygwin on windows issue BUT the wiki does say to 
>> use Cygwin when developing on windows.  Thoughts?
>> 
>> Roger
>> 
>> -----Original Message-----
>> From: Daan Hoogland [mailto:daan.hoogl...@gmail.com]
>> Sent: Thursday, March 26, 2015 3:23 PM
>> To: dev
>> Cc: Funs Kessen
>> Subject: Re: OVM3 test failures
>> 
>> right, so your second example means that the string has to be split 
>> according to both separators, it seems
>> 
>> On Thu, Mar 26, 2015 at 8:14 PM, Roger Crerie <roger.cre...@hds.com> wrote:
>>> So I have identified a couple of places in the code where these tests are 
>>> failing for me.  Again let me reiterate that I am building using Cygwin on 
>>> a Windows 7 system.  Up until today this has not been a problem but when I 
>>> brought in the OVM3 features I ran into FILE separator issues.....
>>> 
>>> C:\workspaces\Cloudstack\WS1\cloudstack\plugins\hypervisors\ovm3\src\m
>>> ain\java\com\cloud\hypervisor\ovm3\objects\Xen.java
>>> 
>>> Line 437: String[] st = diskPath.split(File.separatorChar == '\\' ?
>>> "\\\\" : File.separator);
>>> 
>>> On my build environment this return a String array of size 1.   The path I 
>>> getting back from the getVMDiskDetailFromMap call looks like 
>>> file:/OVS/Repositories/f12842ebf5ed3fe78da1eb0e17f5ede8/VirtualDisks/722eb520-dcf5-4113-8f45-22d67c9a2f3c.raw
>>>  and the \ character isn't present at all.  When I make the regex string to 
>>> be '/' my test now works.
>>> 
>>> C:\workspaces\Cloudstack\WS1\cloudstack\plugins\hypervisors\ovm3\src\m
>>> ain\java\com\cloud\hypervisor\ovm3\resources
>>> 
>>> Line 553: if (!fp.getName().equals(file)) {
>>> 
>>> Again this has to do with the file separator character.
>>> 
>>> /OVS/Repositories/f12842ebf5ed3fe78da1eb0e17f5ede8/VirtualDisks/15710e
>>> ca-1ea7-47f0-8bde-e6bd0066fec8.raw !=
>>> /OVS/Repositories\f12842ebf5ed3fe78da1eb0e17f5ede8\VirtualDisks\15710e
>>> ca-1ea7-47f0-8bde-e6bd0066fec8.raw
>>> 
>>>  Notice how the file separators change in the middle of the second string.
>>> 
>>> Roger
>>> 
>>> 
>>> -----Original Message-----
>>> From: Roger Crerie [mailto:roger.cre...@hds.com]
>>> Sent: Thursday, March 26, 2015 2:43 PM
>>> To: dev@cloudstack.apache.org
>>> Cc: Funs Kessen
>>> Subject: RE: OVM3 test failures
>>> 
>>> Just to clear up a few more things.  I am building in Cygwin on a windows 
>>> system.  I through in some more debugging and found that the split command 
>>> isn't doing what is expected......
>>> 
>>> 2015-03-26 14:47:12 DEBUG Ovm3HypervisorResource:208 - executeRequest
>>> called: class com.cloud.agent.api.StopCommand
>>> 2015-03-26 14:47:12 DEBUG ConnectionTest:72 - getresult call: list_vms
>>> - []
>>> 2015-03-26 14:47:12 DEBUG Xen:437 - diskPath =
>>> file:/OVS/Repositories/f12842ebf5ed3fe78da1eb0e17f5ede8/VirtualDisks/7
>>> 22eb520-dcf5-4113-8f45-22d67c9a2f3c.raw
>>> 2015-03-26 14:47:12 DEBUG Xen:439 - st Size = 1 st =
>>> [Ljava.lang.String;@2e01787
>>> 2015-03-26 14:47:12 DEBUG Ovm3HypervisorResource:559 - Stop i-2-3-VM
>>> failed
>>> java.lang.ArrayIndexOutOfBoundsException: 3
>>> 
>>> The code actually hard codes the number 3 in the code so as to return the 3 
>>> string from the split array. As you can see from my debug output the split 
>>> command isn't getting 3+ string in the array but rather just 1 (st Size = 
>>> 1).
>>> 
>>> Roger
>>> 
>>> 
>>> -----Original Message-----
>>> From: Roger Crerie [mailto:roger.cre...@hds.com]
>>> Sent: Thursday, March 26, 2015 2:33 PM
>>> To: dev@cloudstack.apache.org
>>> Cc: Funs Kessen
>>> Subject: RE: OVM3 test failures
>>> 
>>> From what I am seeing in the surefire reports though it looks like I am 
>>> running into an ArrayIndexOutOfBoundsException.
>>> 
>>> 2015-03-26 13:40:48 DEBUG Ovm3HypervisorResource:345 - configure ovm-1
>>> with params: {agentusername=oracle, public.network.device=xenbr0,
>>> xenserver.heartbeat.interval=60, private.network.device=xenbr0,
>>> agentpassword=unknown, Hypervisor.Version=4.1.3OVM,
>>> secondary.storage.vm=false, Host.OS=Oracle VM Server, ovm3pool=true,
>>> ipaddress=192.168.1.64, password=unknown, username=root,
>>> pool=a9c1219d-817d-4242-b23e-2607801c79d5, ismaster=false,
>>> storage.network.device=xenbr0, ovm3.heartbeat.timeout=120,
>>> Host.OS.Version=5.7, xenserver.nics.max=7, agentVersion=3.2.1-183,
>>> router.aggregation.command.each.timeout=3, pod=1, istest=true,
>>> max.template.iso.size=50, host=ovm-1,
>>> com.cloud.network.Networks.RouterPrivateIpStrategy=DcGlobal,
>>> agentport=8899, Host.OS.Kernel.Version=2.6.39-300.22.2.el5uek,
>>> migratewait=3600, storage.network.device1=xenbr0,
>>> ovm3.heartbeat.interval=1, ip=192.168.1.64, ovm3cluster=false,
>>> guid=19e5f1e7-22f4-3b6d-8d41-c82f89c65295, ovm3vip=192.168.1.230,
>>> hasmaster=true, cluster=1, guest.network.device=xenbr0, zone=1,
>>> xenserver.heartbeat.timeout=120}
>>> 2015-03-26 13:40:48 DEBUG ConnectionTest:67 - methodresponse call:
>>> check_dom0_ip - [192.168.1.230]
>>> 2015-03-26 13:40:48 DEBUG Ovm3HypervisorSupport:587 - ovm-1 is a
>>> master, already has vip 192.168.1.230
>>> 2015-03-26 13:40:48 DEBUG ConnectionTest:67 - methodresponse call:
>>> discover_network - []
>>> 2015-03-26 13:40:48 DEBUG Ovm3HypervisorNetwork:75 - already have
>>> control0
>>> 2015-03-26 13:40:48 DEBUG ConnectionTest:67 - methodresponse call:
>>> ovs_ip_config - [control0, static, 169.254.0.1, 255.255.0.0]
>>> 2015-03-26 13:40:48 DEBUG ConnectionTest:67 - methodresponse call:
>>> ovs_control_interface - [control0, 169.254.0.0/16]
>>> 2015-03-26 13:40:48 DEBUG ConnectionTest:67 - methodresponse call:
>>> discover_hardware - []
>>> 2015-03-26 13:40:48 DEBUG ConnectionTest:67 - methodresponse call:
>>> discover_server - []
>>> 2015-03-26 13:40:48 DEBUG ConnectionTest:67 - methodresponse call:
>>> update_server_roles - [xen,utility]
>>> 2015-03-26 13:40:48 DEBUG Ovm3StoragePool:164 - Host ovm-1 owned by us
>>> 2015-03-26 13:40:48 DEBUG Ovm3HypervisorResource:208 - executeRequest
>>> called: class com.cloud.agent.api.StopCommand
>>> 2015-03-26 13:40:48 DEBUG ConnectionTest:72 - getresult call: list_vms
>>> - []
>>> 2015-03-26 13:40:48 DEBUG Ovm3HypervisorResource:559 - Stop i-2-3-VM
>>> failed
>>> java.lang.ArrayIndexOutOfBoundsException: 3
>>>        at 
>>> com.cloud.hypervisor.ovm3.objects.Xen$Vm.getVmDiskPoolId(Xen.java:438)
>>>        at 
>>> com.cloud.hypervisor.ovm3.objects.Xen$Vm.getVmRootDiskPoolId(Xen.java:423)
>>>        at 
>>> com.cloud.hypervisor.ovm3.resources.Ovm3HypervisorResource.execute(Ovm3HypervisorResource.java:537)
>>>        at 
>>> com.cloud.hypervisor.ovm3.resources.Ovm3HypervisorResource.executeRequest(Ovm3HypervisorResource.java:285)
>>>        at 
>>> com.cloud.hypervisor.ovm3.resources.Ovm3HypervisorResourceTest.stopVmTest(Ovm3HypervisorResourceTest.java:198)
>>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>        at 
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>        at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>        at java.lang.reflect.Method.invoke(Method.java:606)
>>>        at 
>>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
>>>        at 
>>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>        at 
>>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
>>>        at 
>>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
>>>        at 
>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
>>>        at 
>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>>>        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
>>>        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
>>>        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
>>>        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
>>>        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
>>>        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>>>        at 
>>> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
>>>        at 
>>> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
>>>        at 
>>> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
>>>        at 
>>> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
>>>        at 
>>> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
>>>        at 
>>> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
>>>        at
>>> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:1
>>> 03)
>>> 
>>> 
>>> -----Original Message-----
>>> From: Daan Hoogland [mailto:daan.hoogl...@gmail.com]
>>> Sent: Thursday, March 26, 2015 2:23 PM
>>> To: dev
>>> Cc: Funs Kessen
>>> Subject: Re: OVM3 test failures
>>> 
>>> Roger, I've been browsing through your output and can't find an obvious 
>>> root cause. I am cc'ing the author of the ovm3. In the meanwhile i'll be 
>>> compiling master and run the dbdeploy target. What do you mean by 'ovm 
>>> install command'? typo?
>>> 
>>> On Thu, Mar 26, 2015 at 7:03 PM, Roger Crerie <roger.cre...@hds.com> wrote:
>>>> Thanks for the quick reply. Please find attached a text of the build
>>>> errors I am getting for OVM3
>>>> 
>>>> Roger
>>>> 
>>>> -----Original Message-----
>>>> From: Daan Hoogland [mailto:daan.hoogl...@gmail.com]
>>>> Sent: Thursday, March 26, 2015 1:28 PM
>>>> To: dev
>>>> Subject: Re: OVM3 test failures
>>>> 
>>>> H Roger,
>>>> 
>>>> I hope you are missing something but can't say for sure. The jenkins 
>>>> master build [1] seems not to have your problem. So please expand on your 
>>>> problems.
>>>> 
>>>> [1] http://jenkins.buildacloud.org/job/master-slowbuild/
>>>> 
>>>> On Thu, Mar 26, 2015 at 6:18 PM, Roger Crerie <roger.cre...@hds.com> wrote:
>>>>> I just updated my source from the master repository.  I am now seeing 
>>>>> failures with cloud-plugin-hypervisor-ovm3.  The failures are having to 
>>>>> do with the tests that OVM3 are running.  I ran the ovm install command 
>>>>> to clear the old databse ....
>>>>> mvn -P developer -pl developer -Ddeploydb
>>>>> 
>>>>> But when I go to build cloudstack now I fail with 6 separate tests in 
>>>>> OVM3.  Am I missing something?
>>>>> 
>>>>> Roger
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Daan
>>> 
>>> 
>>> 
>>> --
>>> Daan
>> 
>> 
>> 
>> --
>> Daan
> 
> 
> 
> -- 
> Daan
> 

Reply via email to