From issues-return-89510-archive-asf-public=cust-asf.ponee.io@cloudstack.apache.org Tue Jan 30 16:19:04 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id D931D18061A for ; Tue, 30 Jan 2018 16:19:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C8E97160C53; Tue, 30 Jan 2018 15:19:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E8F75160C42 for ; Tue, 30 Jan 2018 16:19:03 +0100 (CET) Received: (qmail 9744 invoked by uid 500); 30 Jan 2018 15:19:03 -0000 Mailing-List: contact issues-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list issues@cloudstack.apache.org Received: (qmail 9735 invoked by uid 500); 30 Jan 2018 15:19:03 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 9729 invoked by uid 99); 30 Jan 2018 15:19:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jan 2018 15:19:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 981001A4239 for ; Tue, 30 Jan 2018 15:19:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 578mponMYHHz for ; Tue, 30 Jan 2018 15:19:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 047E15F2F0 for ; Tue, 30 Jan 2018 15:19:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7CB15E01AA for ; Tue, 30 Jan 2018 15:19:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 376E121300 for ; Tue, 30 Jan 2018 15:19:00 +0000 (UTC) Date: Tue, 30 Jan 2018 15:19:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-10241) Duplicated file SRs being created in XenServer pools MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CLOUDSTACK-10241?page=3Dcom.atl= assian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D16345205#comment-16345205 ]=20 ASF GitHub Bot commented on CLOUDSTACK-10241: --------------------------------------------- DaanHoogland commented on a change in pull request #2414: [CLOUDSTACK-10241= ] Duplicated file SRs being created in XenServer pools URL: https://github.com/apache/cloudstack/pull/2414#discussion_r164773896 =20 =20 ########## File path: plugins/hypervisors/xenserver/src/test/java/com/cloud/hyperviso= r/xenserver/resource/Xenserver625StorageProcessorTest.java ########## @@ -0,0 +1,459 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.cloud.hypervisor.xenserver.resource; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.times; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + +import org.apache.commons.lang.StringUtils; +import org.apache.xmlrpc.XmlRpcException; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InOrder; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import com.cloud.utils.exception.CloudRuntimeException; +import com.xensource.xenapi.Connection; +import com.xensource.xenapi.Host; +import com.xensource.xenapi.PBD; +import com.xensource.xenapi.PBD.Record; +import com.xensource.xenapi.SR; +import com.xensource.xenapi.Types.InternalError; +import com.xensource.xenapi.Types.XenAPIException; + +@RunWith(PowerMockRunner.class) +public class Xenserver625StorageProcessorTest { + + @InjectMocks + private Xenserver625StorageProcessor xenserver625StorageProcessor; + + @Mock + private CitrixResourceBase citrixResourceBase; + + @Mock + private Connection connectionMock; + + private String pathMock =3D "pathMock"; + + @Before + public void before() { + xenserver625StorageProcessor =3D Mockito.spy(new Xenserver625Stora= geProcessor(citrixResourceBase)); + citrixResourceBase._host =3D Mockito.mock(XsHost.class); + Mockito.when(citrixResourceBase.getHost()).thenReturn(citrixResour= ceBase._host); + } + + @Test + public void makeDirectoryTestCallHostPlugingReturningEmpty() { + boolean makeDirectoryReturn =3D configureAndExecuteMakeDirectoryMe= thodForTest(pathMock, StringUtils.EMPTY); + + assertFalse(makeDirectoryReturn); + } + + @Test + public void makeDirectoryTestCallHostPlugingReturningNull() { + boolean makeDirectoryReturn =3D configureAndExecuteMakeDirectoryMe= thodForTest(pathMock, null); + + assertFalse(makeDirectoryReturn); + } + + @Test + public void makeDirectoryTestCallHostPlugingReturningSomething() { + boolean makeDirectoryReturn =3D configureAndExecuteMakeDirectoryMe= thodForTest(pathMock, "Soemthing"); =20 Review comment: Soemthing on purpose or Something intended? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org > Duplicated file SRs being created in XenServer pools > ---------------------------------------------------- > > Key: CLOUDSTACK-10241 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-102= 41 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the defa= ult.)=20 > Reporter: Rafael Weing=C3=A4rtner > Assignee: Rafael Weing=C3=A4rtner > Priority: Major > > Due to a race condition between multiple management servers, in some rare= cases, CloudStack is creating multiple file SRs to the same secondary fold= er. This causes a problem when introducing the SR to the XenServer pools, a= s =E2=80=9Cthere will be VDIs with duplicated UUIDs=E2=80=9C. The VDIs are = the same, but they are seen in different SRs, and therefore cause an error. -- This message was sent by Atlassian JIRA (v7.6.3#76005)