mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Changes for switching all wmi calls to V2 namespace. V1 namespace is deprecated so it is better
to be on v2 namespace.
This commit is contained in:
parent
36b8b357e6
commit
1601498bd7
@ -1,105 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{C963DFFF-65BA-4E71-ADA5-526A4DA4E0B2}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>HypervResource</RootNamespace>
|
||||
<AssemblyName>HypervResource</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTestsDebug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\NoUnitTestsDebug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTests|AnyCPU'">
|
||||
<OutputPath>bin\NoUnitTests\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AWSSDK">
|
||||
<HintPath>..\packages\AWSSDK.1.5.23.0\lib\AWSSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CloudStackTypes.cs" />
|
||||
<Compile Include="IWmiCalls.cs" />
|
||||
<Compile Include="IWmiCallsV2.cs" />
|
||||
<Compile Include="WmiCallsV2.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="HypervResourceController.cs" />
|
||||
<Compile Include="Utils.cs" />
|
||||
<Compile Include="WmiCalls.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WmiWrappers\WmiWrappers.csproj">
|
||||
<Project>{db824727-bdc3-437c-a364-7a811d8a160f}</Project>
|
||||
<Name>WmiWrappers</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{C963DFFF-65BA-4E71-ADA5-526A4DA4E0B2}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>HypervResource</RootNamespace>
|
||||
<AssemblyName>HypervResource</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTestsDebug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\NoUnitTestsDebug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTests|AnyCPU'">
|
||||
<OutputPath>bin\NoUnitTests\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AWSSDK">
|
||||
<HintPath>..\packages\AWSSDK.1.5.23.0\lib\AWSSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CloudStackTypes.cs" />
|
||||
<Compile Include="IWmiCallsV2.cs" />
|
||||
<Compile Include="WmiCallsV2.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="HypervResourceController.cs" />
|
||||
<Compile Include="Utils.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WmiWrappers\WmiWrappers.csproj">
|
||||
<Project>{db824727-bdc3-437c-a364-7a811d8a160f}</Project>
|
||||
<Name>WmiWrappers</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,22 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2;
|
||||
using System.Management;
|
||||
|
||||
namespace HypervResource
|
||||
{
|
||||
public interface IWmiCallsV2
|
||||
{
|
||||
ComputerSystem AddUserData(ComputerSystem vm, string userData);
|
||||
void DeleteHostKvpItem(ComputerSystem vm, string key);
|
||||
VirtualSystemManagementService GetVirtualisationSystemManagementService();
|
||||
ComputerSystem GetComputerSystem(string displayName);
|
||||
List<string> GetVmElementNames();
|
||||
VirtualSystemSettingData GetVmSettings(ComputerSystem vm);
|
||||
KvpExchangeComponentSettingData GetKvpSettings(VirtualSystemSettingData vmSettings);
|
||||
string GetDefaultDataRoot();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2;
|
||||
using System.Management;
|
||||
|
||||
namespace HypervResource
|
||||
{
|
||||
public interface IWmiCallsV2
|
||||
{
|
||||
System.Management.ManagementPath AddDiskDriveToVm(ComputerSystem vm, string vhdfile, string cntrllerAddr, string driveResourceType);
|
||||
ComputerSystem AddUserData(ComputerSystem vm, string userData);
|
||||
void AttachIso(string displayName, string iso);
|
||||
void CreateDynamicVirtualHardDisk(ulong MaxInternalSize, string Path);
|
||||
SyntheticEthernetPortSettingData CreateNICforVm(ComputerSystem vm, string mac);
|
||||
ComputerSystem CreateVM(string name, long memory_mb, int vcpus);
|
||||
void DeleteHostKvpItem(ComputerSystem vm, string key);
|
||||
void DeleteSwitchPort(string elementName);
|
||||
ComputerSystem DeployVirtualMachine(dynamic jsonObj, string systemVmIso);
|
||||
void DestroyVm(dynamic jsonObj);
|
||||
void DestroyVm(string displayName);
|
||||
void DetachDisk(string displayName, string diskFileName);
|
||||
ComputerSystem GetComputerSystem(string displayName);
|
||||
string GetDefaultDataRoot();
|
||||
string GetDefaultVirtualDiskFolder();
|
||||
ResourceAllocationSettingData GetDvdDriveSettings(VirtualSystemSettingData vmSettings);
|
||||
EthernetPortAllocationSettingData[] GetEthernetConnections(ComputerSystem vm);
|
||||
SyntheticEthernetPortSettingData[] GetEthernetPortSettings(ComputerSystem vm);
|
||||
ResourceAllocationSettingData GetIDEControllerSettings(VirtualSystemSettingData vmSettings, string cntrllerAddr);
|
||||
ImageManagementService GetImageManagementService();
|
||||
KvpExchangeComponentSettingData GetKvpSettings(VirtualSystemSettingData vmSettings);
|
||||
void GetMemoryResources(out ulong physicalRamKBs, out ulong freeMemoryKBs);
|
||||
MemorySettingData GetMemSettings(VirtualSystemSettingData vmSettings);
|
||||
void GetProcessorResources(out uint cores, out uint mhz);
|
||||
void GetProcessorUsageInfo(out double cpuUtilization);
|
||||
ProcessorSettingData GetProcSettings(VirtualSystemSettingData vmSettings);
|
||||
ResourceAllocationSettingData.ResourceAllocationSettingDataCollection GetResourceAllocationSettings(VirtualSystemSettingData vmSettings);
|
||||
void GetSummaryInfo(System.Collections.Generic.Dictionary<string, VmStatsEntry> vmProcessorInfo, System.Collections.Generic.List<System.Management.ManagementPath> vmsToInspect);
|
||||
SyntheticEthernetPortSettingData GetSyntheticEthernetPortSettings(EthernetSwitchPort port);
|
||||
VirtualSystemManagementService GetVirtualisationSystemManagementService();
|
||||
VirtualEthernetSwitchManagementService GetVirtualSwitchManagementService();
|
||||
EthernetSwitchPortVlanSettingData GetVlanSettings(EthernetPortAllocationSettingData ethernetConnection);
|
||||
System.Collections.Generic.List<string> GetVmElementNames();
|
||||
VirtualSystemSettingData GetVmSettings(ComputerSystem vm);
|
||||
void patchSystemVmIso(string vmName, string systemVmIso);
|
||||
void SetState(ComputerSystem vm, ushort requiredState);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,321 +1,320 @@
|
||||
// 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.
|
||||
using System;
|
||||
using CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION;
|
||||
using System.Management;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using log4net;
|
||||
using HypervResource;
|
||||
using CloudStack.Plugin.AgentShell;
|
||||
using System.Collections.Generic;
|
||||
using NSubstitute;
|
||||
using System.Web.Http;
|
||||
using Xunit;
|
||||
|
||||
namespace ServerResource.Tests
|
||||
{
|
||||
public class HypervResourceController1Test
|
||||
{
|
||||
|
||||
protected static string testCifsUrl = AgentSettings.Default.testCifsUrl;
|
||||
protected static string testCifsPath = AgentSettings.Default.testCifsPath;
|
||||
protected static String testPrimaryDataStoreHost = HypervResourceController.config.StorageIpAddress;
|
||||
protected static String testS3TemplateName = AgentSettings.Default.testS3TemplateName;
|
||||
protected static String testCifsTemplateName = AgentSettings.Default.testS3TemplateName;
|
||||
protected static String testSystemVMTemplateName = AgentSettings.Default.testSystemVMTemplateName;
|
||||
protected static String testSystemVMTemplateNameNoExt = AgentSettings.Default.testSystemVMTemplateNameNoExt;
|
||||
protected static String testLocalStoreUUID = "5fe2bad3-d785-394e-9949-89786b8a63d2";
|
||||
protected static String testLocalStorePath = Path.Combine(AgentSettings.Default.hyperv_plugin_root, "var", "test", "storagepool");
|
||||
protected static String testSecondaryStoreLocalPath = Path.Combine(AgentSettings.Default.hyperv_plugin_root, "var", "test", "secondary");
|
||||
|
||||
// TODO: differentiate between NFS and HTTP template URLs.
|
||||
protected static String testSampleTemplateUUID = "TestCopiedLocalTemplate.vhdx";
|
||||
protected static String testSampleTemplateURL = testSampleTemplateUUID;
|
||||
|
||||
// test volumes are both a minimal size vhdx. Changing the extension to .vhd makes on corrupt.
|
||||
protected static String testSampleVolumeWorkingUUID = "TestVolumeLegit.vhdx";
|
||||
protected static String testSampleVolumeCorruptUUID = "TestVolumeCorrupt.vhd";
|
||||
protected static String testSampleVolumeTempUUID = "TestVolumeTemp.vhdx";
|
||||
protected static String testSampleVolumeTempUUIDNoExt = "TestVolumeTemp";
|
||||
protected static String testSampleVolumeWorkingURIJSON;
|
||||
protected static String testSampleVolumeCorruptURIJSON;
|
||||
protected static String testSampleVolumeTempURIJSON;
|
||||
|
||||
protected static String testSampleTemplateURLJSON;
|
||||
protected static String testLocalStorePathJSON;
|
||||
|
||||
protected static IWmiCalls wmiCalls;
|
||||
|
||||
|
||||
private static ILog s_logger = LogManager.GetLogger(typeof(HypervResourceController1Test));
|
||||
|
||||
/// <summary>
|
||||
/// Test WmiCalls to which incoming HTTP POST requests are dispatched.
|
||||
///
|
||||
/// TODO: revise beyond first approximation
|
||||
/// First approximation is a quick port of the existing Java tests for Hyper-V server resource.
|
||||
/// A second approximation would use the AgentShell settings files directly.
|
||||
/// A third approximation would look to invoke ServerResource methods via an HTTP request
|
||||
/// </summary>
|
||||
|
||||
public HypervResourceController1Test()
|
||||
{
|
||||
wmiCalls = Substitute.For<IWmiCalls>();
|
||||
//AgentService.ConfigServerResource();
|
||||
HypervResourceController.config.PrivateMacAddress = AgentSettings.Default.private_mac_address;
|
||||
HypervResourceController.config.PrivateNetmask = AgentSettings.Default.private_ip_netmask;
|
||||
HypervResourceController.config.StorageIpAddress = HypervResourceController.config.PrivateIpAddress;
|
||||
HypervResourceController.config.StorageMacAddress = HypervResourceController.config.PrivateMacAddress;
|
||||
HypervResourceController.config.StorageNetmask = HypervResourceController.config.PrivateNetmask;
|
||||
|
||||
|
||||
// Used to create existing StoragePool in preparation for the ModifyStoragePool
|
||||
testLocalStoreUUID = AgentSettings.Default.local_storage_uuid.ToString();
|
||||
|
||||
// Make sure secondary store is available.
|
||||
string fullPath = Path.GetFullPath(testSecondaryStoreLocalPath);
|
||||
s_logger.Info("Test secondary storage in " + fullPath);
|
||||
DirectoryInfo testSecondarStoreDir = new DirectoryInfo(fullPath);
|
||||
if (!testSecondarStoreDir.Exists)
|
||||
{
|
||||
try
|
||||
{
|
||||
testSecondarStoreDir.Create();
|
||||
}
|
||||
catch (System.IO.IOException ex)
|
||||
{
|
||||
throw new NotImplementedException("Need to be able to create the folder " + testSecondarStoreDir.FullName + " failed due to " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
// Convert to secondary storage string to canonical path
|
||||
testSecondaryStoreLocalPath = testSecondarStoreDir.FullName;
|
||||
AgentSettings.Default.local_secondary_storage_path = testSecondaryStoreLocalPath;
|
||||
|
||||
// Make sure local primary storage is available
|
||||
DirectoryInfo testPoolDir = new DirectoryInfo(testLocalStorePath);
|
||||
//Assert.True(testPoolDir.Exists, "To simulate local file system Storage Pool, you need folder at " + testPoolDir.FullName);
|
||||
|
||||
// Convert to local primary storage string to canonical path
|
||||
testLocalStorePath = testPoolDir.FullName;
|
||||
AgentSettings.Default.local_storage_path = testLocalStorePath;
|
||||
|
||||
// Clean up old test files in local storage folder
|
||||
FileInfo testVolWorks = new FileInfo(Path.Combine(testLocalStorePath, testSampleVolumeWorkingUUID));
|
||||
// Assert.True(testVolWorks.Exists, "Create a working virtual disk at " + testVolWorks.FullName);
|
||||
|
||||
testSampleTemplateURLJSON = JsonConvert.SerializeObject(testSampleTemplateUUID);
|
||||
s_logger.Info("Created " + testSampleTemplateURLJSON + " in local storage.");
|
||||
|
||||
|
||||
// Capture other JSON encoded paths
|
||||
testSampleVolumeWorkingURIJSON = Newtonsoft.Json.JsonConvert.SerializeObject(testVolWorks.FullName);
|
||||
testLocalStorePathJSON = JsonConvert.SerializeObject(testLocalStorePath);
|
||||
|
||||
// TODO: may need to initialise the server resource in future.
|
||||
// s_hypervresource.initialize();
|
||||
|
||||
// Verify sample template is in place storage pool
|
||||
s_logger.Info("setUp complete, sample StoragePool at " + testLocalStorePathJSON
|
||||
+ " sample template at " + testSampleTemplateURLJSON);
|
||||
}
|
||||
|
||||
private String CreateTestDiskImageFromExistingImage(FileInfo srcFile,
|
||||
String dstPath,
|
||||
String dstFileName)
|
||||
{
|
||||
var newFullname = Path.Combine(dstPath, dstFileName);
|
||||
var newFileInfo = new FileInfo(newFullname);
|
||||
if (!newFileInfo.Exists)
|
||||
{
|
||||
newFileInfo = srcFile.CopyTo(newFullname);
|
||||
}
|
||||
newFileInfo.Refresh();
|
||||
Assert.True(newFileInfo.Exists, "Attempted to create " + newFullname + " from " + newFileInfo.FullName);
|
||||
|
||||
return JsonConvert.SerializeObject(newFileInfo.FullName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestCreateCommand()
|
||||
{
|
||||
DirectoryInfo localStorePath = new DirectoryInfo(testLocalStorePath);
|
||||
if (!localStorePath.Exists)
|
||||
{
|
||||
try
|
||||
{
|
||||
localStorePath.Create();
|
||||
}
|
||||
catch (System.IO.IOException ex)
|
||||
{
|
||||
throw new NotImplementedException("Need to be able to create the folder " + localStorePath.FullName + " failed due to " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
FileInfo sampleTemplateFile = new FileInfo(Path.Combine(testLocalStorePath, testSampleTemplateUUID));
|
||||
if (!sampleTemplateFile.Exists)
|
||||
{
|
||||
//Create a file to write to.
|
||||
using (StreamWriter sw = sampleTemplateFile.CreateText())
|
||||
{
|
||||
sw.WriteLine("This is fake template file for test");
|
||||
}
|
||||
}
|
||||
var counter = 0;
|
||||
wmiCalls.When(x => x.CreateDynamicVirtualHardDisk(Arg.Any<ulong>(), Arg.Any<String>())).Do(x => counter++);
|
||||
// TODO: Need sample to update the test.
|
||||
// Arrange
|
||||
String createCmd = "{\"volId\":10,\"pool\":{\"id\":201,\"uuid\":\"" + testLocalStoreUUID + "\",\"host\":\"" + HypervResourceController.config.StorageIpAddress + "\"" +
|
||||
",\"path\":" + testLocalStorePathJSON + ",\"port\":0,\"type\":\"Filesystem\"},\"diskCharacteristics\":{\"size\":0," +
|
||||
"\"tags\":[],\"type\":\"ROOT\",\"name\":\"ROOT-9\",\"useLocalStorage\":true,\"recreatable\":true,\"diskOfferingId\":11," +
|
||||
"\"volumeId\":10,\"hyperType\":\"Hyperv\"},\"templateUrl\":" + testSampleTemplateURLJSON + ",\"contextMap\":{},\"wait\":0}";
|
||||
dynamic jsonCreateCmd = JsonConvert.DeserializeObject(createCmd);
|
||||
HypervResourceController rsrcServer = new HypervResourceController();
|
||||
HypervResourceController.wmiCalls = wmiCalls;
|
||||
|
||||
Assert.True(Directory.Exists(testLocalStorePath), testLocalStorePath + " does not exist ");
|
||||
string filePath = Path.Combine(testLocalStorePath, (string)JsonConvert.DeserializeObject(testSampleTemplateURLJSON));
|
||||
Assert.True(File.Exists(filePath), "The template we make volumes from is missing from path " + filePath);
|
||||
int fileCount = Directory.GetFiles(testLocalStorePath).Length;
|
||||
s_logger.Debug(" test local store has " + fileCount + "files");
|
||||
|
||||
// Act
|
||||
// Test requires there to be a template at the tempalteUrl, which is its location in the local file system.
|
||||
dynamic jsonResult = rsrcServer.CreateCommand(jsonCreateCmd);
|
||||
s_logger.Debug("CreateDynamicVirtualHardDisk method is called " + counter + " times");
|
||||
|
||||
//Assert.Equal(counter, 1);
|
||||
|
||||
JObject ansAsProperty2 = jsonResult[0];
|
||||
dynamic ans = ansAsProperty2.GetValue(CloudStackTypes.CreateAnswer);
|
||||
Assert.NotNull(ans);
|
||||
Assert.True((bool)ans.result, "Failed to CreateCommand due to " + (string)ans.result);
|
||||
Assert.Equal(Directory.GetFiles(testLocalStorePath).Length, fileCount + 1);
|
||||
FileInfo newFile = new FileInfo((string)ans.volume.path);
|
||||
Assert.True(newFile.Length > 0, "The new file should have a size greater than zero");
|
||||
newFile.Delete();
|
||||
sampleTemplateFile.Delete();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Possible additional tests: place an ISO in the drive
|
||||
/// </summary>
|
||||
|
||||
[Fact]
|
||||
public void TestStartCommand()
|
||||
{
|
||||
ComputerSystem system = new ComputerSystem();
|
||||
wmiCalls.DeployVirtualMachine(Arg.Any<Object>(), Arg.Any<string>()).Returns(system);
|
||||
|
||||
// Arrange
|
||||
HypervResourceController rsrcServer = new HypervResourceController();
|
||||
HypervResourceController.wmiCalls = wmiCalls;
|
||||
String sample = getSampleStartCommand();
|
||||
|
||||
|
||||
dynamic jsonStartCmd = JsonConvert.DeserializeObject(sample);
|
||||
|
||||
// Act
|
||||
dynamic startAns = rsrcServer.StartCommand(jsonStartCmd);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(startAns[0][CloudStackTypes.StartAnswer]);
|
||||
Assert.True((bool)startAns[0][CloudStackTypes.StartAnswer].result, "StartCommand did not succeed " + startAns[0][CloudStackTypes.StartAnswer].details);
|
||||
|
||||
Assert.Null((string)startAns[0][CloudStackTypes.StartAnswer].details);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestStopCommand()
|
||||
{
|
||||
//string vmName = "Test VM";
|
||||
var counter = 0;
|
||||
wmiCalls.When(x => x.DestroyVm(Arg.Any<Object>())).Do(x => counter++);
|
||||
|
||||
// Arrange
|
||||
HypervResourceController rsrcServer = new HypervResourceController();
|
||||
HypervResourceController.wmiCalls = wmiCalls;
|
||||
|
||||
String sampleStop = "{\"isProxy\":false,\"vmName\":\"i-2-17-VM\",\"contextMap\":{},\"wait\":0}";
|
||||
dynamic jsonStopCmd = JsonConvert.DeserializeObject(sampleStop);
|
||||
|
||||
// Act
|
||||
dynamic stopAns = rsrcServer.StopCommand(jsonStopCmd);
|
||||
|
||||
// Assert VM is gone!
|
||||
Assert.NotNull(stopAns[0][CloudStackTypes.StopAnswer]);
|
||||
Assert.True((bool)stopAns[0][CloudStackTypes.StopAnswer].result, "StopCommand did not succeed " + stopAns[0][CloudStackTypes.StopAnswer].details);
|
||||
|
||||
Assert.Null((string)stopAns[0][CloudStackTypes.StopAnswer].details);
|
||||
Assert.Equal<int>(counter, 1);
|
||||
}
|
||||
|
||||
public static String getSamplePrimaryDataStoreInfo()
|
||||
{
|
||||
String samplePrimaryDataStoreInfo =
|
||||
"{\"org.apache.cloudstack.storage.to.PrimaryDataStoreTO\":" +
|
||||
"{\"uuid\":\"" + testLocalStoreUUID + "\"," +
|
||||
"\"id\":201," +
|
||||
"\"host\":\"" + testPrimaryDataStoreHost + "\"," +
|
||||
"\"type\":\"Filesystem\"," + // Not used in PrimaryDataStoreTO
|
||||
"\"poolType\":\"Filesystem\"," + // Not used in PrimaryDataStoreTO
|
||||
"\"path\":" + testLocalStorePathJSON + "," +
|
||||
"\"port\":0}" +
|
||||
"}";
|
||||
return samplePrimaryDataStoreInfo;
|
||||
}
|
||||
|
||||
public static String getSampleVolumeObjectTO()
|
||||
{
|
||||
String sampleVolumeObjectTO =
|
||||
"{\"org.apache.cloudstack.storage.to.VolumeObjectTO\":" +
|
||||
"{\"uuid\":\"19ae8e67-cb2c-4ab4-901e-e0b864272b59\"," +
|
||||
"\"volumeType\":\"ROOT\"," +
|
||||
"\"format\":\"VHDX\"," +
|
||||
"\"dataStore\":" + getSamplePrimaryDataStoreInfo() + "," +
|
||||
"\"name\":\"" + testSampleVolumeTempUUIDNoExt + "\"," +
|
||||
"\"size\":52428800," +
|
||||
"\"volumeId\":10," +
|
||||
// "\"vmName\":\"i-3-5-VM\"," + // TODO: do we have to fill in the vmName?
|
||||
"\"accountId\":3,\"id\":10}" +
|
||||
"}"; // end of destTO
|
||||
return sampleVolumeObjectTO;
|
||||
}
|
||||
|
||||
public static String getSampleStartCommand()
|
||||
{
|
||||
String sample = "{\"vm\":{\"id\":17,\"name\":\"i-2-17-VM\",\"type\":\"User\",\"cpus\":1,\"speed\":500," +
|
||||
"\"minRam\":536870912,\"maxRam\":536870912,\"arch\":\"x86_64\"," +
|
||||
"\"os\":\"CentOS 6.0 (64-bit)\",\"bootArgs\":\"\",\"rebootOnCrash\":false," +
|
||||
"\"enableHA\":false,\"limitCpuUse\":false,\"vncPassword\":\"31f82f29aff646eb\"," +
|
||||
"\"params\":{},\"uuid\":\"8b030b6a-0243-440a-8cc5-45d08815ca11\"" +
|
||||
",\"disks\":[" +
|
||||
"{\"data\":" + getSampleVolumeObjectTO() + ",\"diskSeq\":0,\"type\":\"ROOT\"}," +
|
||||
"{\"diskSeq\":1,\"type\":\"ISO\"}" +
|
||||
"]," +
|
||||
"\"nics\":[" +
|
||||
"{\"deviceId\":0,\"networkRateMbps\":100,\"defaultNic\":true,\"uuid\":\"99cb4813-23af-428c-a87a-2d1899be4f4b\"," +
|
||||
"\"ip\":\"10.1.1.67\",\"netmask\":\"255.255.255.0\",\"gateway\":\"10.1.1.1\"," +
|
||||
"\"mac\":\"02:00:51:2c:00:0e\",\"dns1\":\"4.4.4.4\",\"broadcastType\":\"Vlan\",\"type\":\"Guest\"," +
|
||||
"\"broadcastUri\":\"vlan://261\",\"isolationUri\":\"vlan://261\",\"isSecurityGroupEnabled\":false}" +
|
||||
"]},\"contextMap\":{},\"wait\":0}";
|
||||
return sample;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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.
|
||||
using System;
|
||||
using CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2;
|
||||
using System.Management;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using log4net;
|
||||
using HypervResource;
|
||||
using CloudStack.Plugin.AgentShell;
|
||||
using System.Collections.Generic;
|
||||
using NSubstitute;
|
||||
using System.Web.Http;
|
||||
using Xunit;
|
||||
|
||||
namespace ServerResource.Tests
|
||||
{
|
||||
public class HypervResourceController1Test
|
||||
{
|
||||
protected static string testCifsUrl = AgentSettings.Default.testCifsUrl;
|
||||
protected static string testCifsPath = AgentSettings.Default.testCifsPath;
|
||||
protected static String testPrimaryDataStoreHost = HypervResourceController.config.StorageIpAddress;
|
||||
protected static String testS3TemplateName = AgentSettings.Default.testS3TemplateName;
|
||||
protected static String testCifsTemplateName = AgentSettings.Default.testS3TemplateName;
|
||||
protected static String testSystemVMTemplateName = AgentSettings.Default.testSystemVMTemplateName;
|
||||
protected static String testSystemVMTemplateNameNoExt = AgentSettings.Default.testSystemVMTemplateNameNoExt;
|
||||
protected static String testLocalStoreUUID = "5fe2bad3-d785-394e-9949-89786b8a63d2";
|
||||
protected static String testLocalStorePath = Path.Combine(AgentSettings.Default.hyperv_plugin_root, "var", "test", "storagepool");
|
||||
protected static String testSecondaryStoreLocalPath = Path.Combine(AgentSettings.Default.hyperv_plugin_root, "var", "test", "secondary");
|
||||
|
||||
// TODO: differentiate between NFS and HTTP template URLs.
|
||||
protected static String testSampleTemplateUUID = "TestCopiedLocalTemplate.vhdx";
|
||||
protected static String testSampleTemplateURL = testSampleTemplateUUID;
|
||||
|
||||
// test volumes are both a minimal size vhdx. Changing the extension to .vhd makes on corrupt.
|
||||
protected static String testSampleVolumeWorkingUUID = "TestVolumeLegit.vhdx";
|
||||
protected static String testSampleVolumeCorruptUUID = "TestVolumeCorrupt.vhd";
|
||||
protected static String testSampleVolumeTempUUID = "TestVolumeTemp.vhdx";
|
||||
protected static String testSampleVolumeTempUUIDNoExt = "TestVolumeTemp";
|
||||
protected static String testSampleVolumeWorkingURIJSON;
|
||||
protected static String testSampleVolumeCorruptURIJSON;
|
||||
protected static String testSampleVolumeTempURIJSON;
|
||||
|
||||
protected static String testSampleTemplateURLJSON;
|
||||
protected static String testLocalStorePathJSON;
|
||||
|
||||
protected static IWmiCallsV2 wmiCallsV2;
|
||||
|
||||
|
||||
private static ILog s_logger = LogManager.GetLogger(typeof(HypervResourceController1Test));
|
||||
|
||||
/// <summary>
|
||||
/// Test WmiCalls to which incoming HTTP POST requests are dispatched.
|
||||
///
|
||||
/// TODO: revise beyond first approximation
|
||||
/// First approximation is a quick port of the existing Java tests for Hyper-V server resource.
|
||||
/// A second approximation would use the AgentShell settings files directly.
|
||||
/// A third approximation would look to invoke ServerResource methods via an HTTP request
|
||||
/// </summary>
|
||||
|
||||
public HypervResourceController1Test()
|
||||
{
|
||||
wmiCallsV2 = Substitute.For<IWmiCallsV2>();
|
||||
//AgentService.ConfigServerResource();
|
||||
HypervResourceController.config.PrivateMacAddress = AgentSettings.Default.private_mac_address;
|
||||
HypervResourceController.config.PrivateNetmask = AgentSettings.Default.private_ip_netmask;
|
||||
HypervResourceController.config.StorageIpAddress = HypervResourceController.config.PrivateIpAddress;
|
||||
HypervResourceController.config.StorageMacAddress = HypervResourceController.config.PrivateMacAddress;
|
||||
HypervResourceController.config.StorageNetmask = HypervResourceController.config.PrivateNetmask;
|
||||
|
||||
|
||||
// Used to create existing StoragePool in preparation for the ModifyStoragePool
|
||||
testLocalStoreUUID = AgentSettings.Default.local_storage_uuid.ToString();
|
||||
|
||||
// Make sure secondary store is available.
|
||||
string fullPath = Path.GetFullPath(testSecondaryStoreLocalPath);
|
||||
s_logger.Info("Test secondary storage in " + fullPath);
|
||||
DirectoryInfo testSecondarStoreDir = new DirectoryInfo(fullPath);
|
||||
if (!testSecondarStoreDir.Exists)
|
||||
{
|
||||
try
|
||||
{
|
||||
testSecondarStoreDir.Create();
|
||||
}
|
||||
catch (System.IO.IOException ex)
|
||||
{
|
||||
throw new NotImplementedException("Need to be able to create the folder " + testSecondarStoreDir.FullName + " failed due to " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
// Convert to secondary storage string to canonical path
|
||||
testSecondaryStoreLocalPath = testSecondarStoreDir.FullName;
|
||||
AgentSettings.Default.local_secondary_storage_path = testSecondaryStoreLocalPath;
|
||||
|
||||
// Make sure local primary storage is available
|
||||
DirectoryInfo testPoolDir = new DirectoryInfo(testLocalStorePath);
|
||||
//Assert.True(testPoolDir.Exists, "To simulate local file system Storage Pool, you need folder at " + testPoolDir.FullName);
|
||||
|
||||
// Convert to local primary storage string to canonical path
|
||||
testLocalStorePath = testPoolDir.FullName;
|
||||
AgentSettings.Default.local_storage_path = testLocalStorePath;
|
||||
|
||||
// Clean up old test files in local storage folder
|
||||
FileInfo testVolWorks = new FileInfo(Path.Combine(testLocalStorePath, testSampleVolumeWorkingUUID));
|
||||
// Assert.True(testVolWorks.Exists, "Create a working virtual disk at " + testVolWorks.FullName);
|
||||
|
||||
testSampleTemplateURLJSON = JsonConvert.SerializeObject(testSampleTemplateUUID);
|
||||
s_logger.Info("Created " + testSampleTemplateURLJSON + " in local storage.");
|
||||
|
||||
|
||||
// Capture other JSON encoded paths
|
||||
testSampleVolumeWorkingURIJSON = Newtonsoft.Json.JsonConvert.SerializeObject(testVolWorks.FullName);
|
||||
testLocalStorePathJSON = JsonConvert.SerializeObject(testLocalStorePath);
|
||||
|
||||
// TODO: may need to initialise the server resource in future.
|
||||
// s_hypervresource.initialize();
|
||||
|
||||
// Verify sample template is in place storage pool
|
||||
s_logger.Info("setUp complete, sample StoragePool at " + testLocalStorePathJSON
|
||||
+ " sample template at " + testSampleTemplateURLJSON);
|
||||
}
|
||||
|
||||
private String CreateTestDiskImageFromExistingImage(FileInfo srcFile,
|
||||
String dstPath,
|
||||
String dstFileName)
|
||||
{
|
||||
var newFullname = Path.Combine(dstPath, dstFileName);
|
||||
var newFileInfo = new FileInfo(newFullname);
|
||||
if (!newFileInfo.Exists)
|
||||
{
|
||||
newFileInfo = srcFile.CopyTo(newFullname);
|
||||
}
|
||||
newFileInfo.Refresh();
|
||||
Assert.True(newFileInfo.Exists, "Attempted to create " + newFullname + " from " + newFileInfo.FullName);
|
||||
|
||||
return JsonConvert.SerializeObject(newFileInfo.FullName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestCreateCommand()
|
||||
{
|
||||
DirectoryInfo localStorePath = new DirectoryInfo(testLocalStorePath);
|
||||
if (!localStorePath.Exists)
|
||||
{
|
||||
try
|
||||
{
|
||||
localStorePath.Create();
|
||||
}
|
||||
catch (System.IO.IOException ex)
|
||||
{
|
||||
throw new NotImplementedException("Need to be able to create the folder " + localStorePath.FullName + " failed due to " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
FileInfo sampleTemplateFile = new FileInfo(Path.Combine(testLocalStorePath, testSampleTemplateUUID));
|
||||
if (!sampleTemplateFile.Exists)
|
||||
{
|
||||
//Create a file to write to.
|
||||
using (StreamWriter sw = sampleTemplateFile.CreateText())
|
||||
{
|
||||
sw.WriteLine("This is fake template file for test");
|
||||
}
|
||||
}
|
||||
var counter = 0;
|
||||
wmiCallsV2.When(x => x.CreateDynamicVirtualHardDisk(Arg.Any<ulong>(), Arg.Any<String>())).Do(x => counter++);
|
||||
// TODO: Need sample to update the test.
|
||||
// Arrange
|
||||
String createCmd = "{\"volId\":10,\"pool\":{\"id\":201,\"uuid\":\"" + testLocalStoreUUID + "\",\"host\":\"" + HypervResourceController.config.StorageIpAddress + "\"" +
|
||||
",\"path\":" + testLocalStorePathJSON + ",\"port\":0,\"type\":\"Filesystem\"},\"diskCharacteristics\":{\"size\":0," +
|
||||
"\"tags\":[],\"type\":\"ROOT\",\"name\":\"ROOT-9\",\"useLocalStorage\":true,\"recreatable\":true,\"diskOfferingId\":11," +
|
||||
"\"volumeId\":10,\"hyperType\":\"Hyperv\"},\"templateUrl\":" + testSampleTemplateURLJSON + ",\"contextMap\":{},\"wait\":0}";
|
||||
dynamic jsonCreateCmd = JsonConvert.DeserializeObject(createCmd);
|
||||
HypervResourceController rsrcServer = new HypervResourceController();
|
||||
HypervResourceController.wmiCallsV2 = wmiCallsV2;
|
||||
|
||||
Assert.True(Directory.Exists(testLocalStorePath), testLocalStorePath + " does not exist ");
|
||||
string filePath = Path.Combine(testLocalStorePath, (string)JsonConvert.DeserializeObject(testSampleTemplateURLJSON));
|
||||
Assert.True(File.Exists(filePath), "The template we make volumes from is missing from path " + filePath);
|
||||
int fileCount = Directory.GetFiles(testLocalStorePath).Length;
|
||||
s_logger.Debug(" test local store has " + fileCount + "files");
|
||||
|
||||
// Act
|
||||
// Test requires there to be a template at the tempalteUrl, which is its location in the local file system.
|
||||
dynamic jsonResult = rsrcServer.CreateCommand(jsonCreateCmd);
|
||||
s_logger.Debug("CreateDynamicVirtualHardDisk method is called " + counter + " times");
|
||||
|
||||
//Assert.Equal(counter, 1);
|
||||
|
||||
JObject ansAsProperty2 = jsonResult[0];
|
||||
dynamic ans = ansAsProperty2.GetValue(CloudStackTypes.CreateAnswer);
|
||||
Assert.NotNull(ans);
|
||||
Assert.True((bool)ans.result, "Failed to CreateCommand due to " + (string)ans.result);
|
||||
Assert.Equal(Directory.GetFiles(testLocalStorePath).Length, fileCount + 1);
|
||||
FileInfo newFile = new FileInfo((string)ans.volume.path);
|
||||
Assert.True(newFile.Length > 0, "The new file should have a size greater than zero");
|
||||
newFile.Delete();
|
||||
sampleTemplateFile.Delete();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Possible additional tests: place an ISO in the drive
|
||||
/// </summary>
|
||||
|
||||
[Fact]
|
||||
public void TestStartCommand()
|
||||
{
|
||||
ComputerSystem system = new ComputerSystem();
|
||||
wmiCallsV2.DeployVirtualMachine(Arg.Any<Object>(), Arg.Any<string>()).Returns(system);
|
||||
|
||||
// Arrange
|
||||
HypervResourceController rsrcServer = new HypervResourceController();
|
||||
HypervResourceController.wmiCallsV2 = wmiCallsV2;
|
||||
String sample = getSampleStartCommand();
|
||||
|
||||
|
||||
dynamic jsonStartCmd = JsonConvert.DeserializeObject(sample);
|
||||
|
||||
// Act
|
||||
dynamic startAns = rsrcServer.StartCommand(jsonStartCmd);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(startAns[0][CloudStackTypes.StartAnswer]);
|
||||
Assert.True((bool)startAns[0][CloudStackTypes.StartAnswer].result, "StartCommand did not succeed " + startAns[0][CloudStackTypes.StartAnswer].details);
|
||||
|
||||
Assert.Null((string)startAns[0][CloudStackTypes.StartAnswer].details);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestStopCommand()
|
||||
{
|
||||
//string vmName = "Test VM";
|
||||
var counter = 0;
|
||||
wmiCallsV2.When(x => x.DestroyVm(Arg.Any<Object>())).Do(x => counter++);
|
||||
|
||||
// Arrange
|
||||
HypervResourceController rsrcServer = new HypervResourceController();
|
||||
HypervResourceController.wmiCallsV2 = wmiCallsV2;
|
||||
|
||||
String sampleStop = "{\"isProxy\":false,\"vmName\":\"i-2-17-VM\",\"contextMap\":{},\"wait\":0}";
|
||||
dynamic jsonStopCmd = JsonConvert.DeserializeObject(sampleStop);
|
||||
|
||||
// Act
|
||||
dynamic stopAns = rsrcServer.StopCommand(jsonStopCmd);
|
||||
|
||||
// Assert VM is gone!
|
||||
Assert.NotNull(stopAns[0][CloudStackTypes.StopAnswer]);
|
||||
Assert.True((bool)stopAns[0][CloudStackTypes.StopAnswer].result, "StopCommand did not succeed " + stopAns[0][CloudStackTypes.StopAnswer].details);
|
||||
|
||||
Assert.Null((string)stopAns[0][CloudStackTypes.StopAnswer].details);
|
||||
Assert.Equal<int>(counter, 1);
|
||||
}
|
||||
|
||||
public static String getSamplePrimaryDataStoreInfo()
|
||||
{
|
||||
String samplePrimaryDataStoreInfo =
|
||||
"{\"org.apache.cloudstack.storage.to.PrimaryDataStoreTO\":" +
|
||||
"{\"uuid\":\"" + testLocalStoreUUID + "\"," +
|
||||
"\"id\":201," +
|
||||
"\"host\":\"" + testPrimaryDataStoreHost + "\"," +
|
||||
"\"type\":\"Filesystem\"," + // Not used in PrimaryDataStoreTO
|
||||
"\"poolType\":\"Filesystem\"," + // Not used in PrimaryDataStoreTO
|
||||
"\"path\":" + testLocalStorePathJSON + "," +
|
||||
"\"port\":0}" +
|
||||
"}";
|
||||
return samplePrimaryDataStoreInfo;
|
||||
}
|
||||
|
||||
public static String getSampleVolumeObjectTO()
|
||||
{
|
||||
String sampleVolumeObjectTO =
|
||||
"{\"org.apache.cloudstack.storage.to.VolumeObjectTO\":" +
|
||||
"{\"uuid\":\"19ae8e67-cb2c-4ab4-901e-e0b864272b59\"," +
|
||||
"\"volumeType\":\"ROOT\"," +
|
||||
"\"format\":\"VHDX\"," +
|
||||
"\"dataStore\":" + getSamplePrimaryDataStoreInfo() + "," +
|
||||
"\"name\":\"" + testSampleVolumeTempUUIDNoExt + "\"," +
|
||||
"\"size\":52428800," +
|
||||
"\"volumeId\":10," +
|
||||
// "\"vmName\":\"i-3-5-VM\"," + // TODO: do we have to fill in the vmName?
|
||||
"\"accountId\":3,\"id\":10}" +
|
||||
"}"; // end of destTO
|
||||
return sampleVolumeObjectTO;
|
||||
}
|
||||
|
||||
public static String getSampleStartCommand()
|
||||
{
|
||||
String sample = "{\"vm\":{\"id\":17,\"name\":\"i-2-17-VM\",\"type\":\"User\",\"cpus\":1,\"speed\":500," +
|
||||
"\"minRam\":536870912,\"maxRam\":536870912,\"arch\":\"x86_64\"," +
|
||||
"\"os\":\"CentOS 6.0 (64-bit)\",\"bootArgs\":\"\",\"rebootOnCrash\":false," +
|
||||
"\"enableHA\":false,\"limitCpuUse\":false,\"vncPassword\":\"31f82f29aff646eb\"," +
|
||||
"\"params\":{},\"uuid\":\"8b030b6a-0243-440a-8cc5-45d08815ca11\"" +
|
||||
",\"disks\":[" +
|
||||
"{\"data\":" + getSampleVolumeObjectTO() + ",\"diskSeq\":0,\"type\":\"ROOT\"}," +
|
||||
"{\"diskSeq\":1,\"type\":\"ISO\"}" +
|
||||
"]," +
|
||||
"\"nics\":[" +
|
||||
"{\"deviceId\":0,\"networkRateMbps\":100,\"defaultNic\":true,\"uuid\":\"99cb4813-23af-428c-a87a-2d1899be4f4b\"," +
|
||||
"\"ip\":\"10.1.1.67\",\"netmask\":\"255.255.255.0\",\"gateway\":\"10.1.1.1\"," +
|
||||
"\"mac\":\"02:00:51:2c:00:0e\",\"dns1\":\"4.4.4.4\",\"broadcastType\":\"Vlan\",\"type\":\"Guest\"," +
|
||||
"\"broadcastUri\":\"vlan://261\",\"isolationUri\":\"vlan://261\",\"isSecurityGroupEnabled\":false}" +
|
||||
"]},\"contextMap\":{},\"wait\":0}";
|
||||
return sample;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,136 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{925FD1DE-6211-4E10-9949-3751B8ABDF59}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ServerResource.Tests</RootNamespace>
|
||||
<AssemblyName>ServerResource.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTestsDebug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\NoUnitTestsDebug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTests|AnyCPU'">
|
||||
<OutputPath>bin\NoUnitTests\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AWSSDK">
|
||||
<HintPath>..\packages\AWSSDK.1.5.23.0\lib\AWSSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NSubstitute">
|
||||
<HintPath>..\packages\NSubstitute.1.6.1.0\lib\NET40\NSubstitute.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Net.Http">
|
||||
</Reference>
|
||||
<Reference Include="xunit">
|
||||
<HintPath>..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="HypervResourceController1Test.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<!--<Compile Include="HypervResourceControllerTest.cs" /> -->
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="App.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AgentShell\AgentShell.csproj">
|
||||
<Project>{9060b539-62d0-4e71-a6c6-5944828774e9}</Project>
|
||||
<Name>AgentShell</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\HypervResource\HypervResource.csproj">
|
||||
<Project>{c963dfff-65ba-4e71-ada5-526a4da4e0b2}</Project>
|
||||
<Name>HypervResource</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WmiWrappers\WmiWrappers.csproj">
|
||||
<Project>{db824727-bdc3-437c-a364-7a811d8a160f}</Project>
|
||||
<Name>WmiWrappers</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{925FD1DE-6211-4E10-9949-3751B8ABDF59}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ServerResource.Tests</RootNamespace>
|
||||
<AssemblyName>ServerResource.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTestsDebug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\NoUnitTestsDebug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTests|AnyCPU'">
|
||||
<OutputPath>bin\NoUnitTests\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AWSSDK">
|
||||
<HintPath>..\packages\AWSSDK.1.5.23.0\lib\AWSSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NSubstitute">
|
||||
<HintPath>..\packages\NSubstitute.1.6.1.0\lib\NET40\NSubstitute.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Net.Http">
|
||||
</Reference>
|
||||
<Reference Include="xunit">
|
||||
<HintPath>..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="HypervResourceController1Test.cs" />
|
||||
<Compile Include="HypervResourceControllerTest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<!--<Compile Include="HypervResourceControllerTest.cs" /> -->
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="App.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AgentShell\AgentShell.csproj">
|
||||
<Project>{9060b539-62d0-4e71-a6c6-5944828774e9}</Project>
|
||||
<Name>AgentShell</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\HypervResource\HypervResource.csproj">
|
||||
<Project>{c963dfff-65ba-4e71-ada5-526a4da4e0b2}</Project>
|
||||
<Name>HypervResource</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WmiWrappers\WmiWrappers.csproj">
|
||||
<Project>{db824727-bdc3-437c-a364-7a811d8a160f}</Project>
|
||||
<Name>WmiWrappers</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<UsingTask AssemblyFile="..\packages\xunit.1.9.2\lib\net20\xunit.runner.msbuild.dll"
|
||||
TaskName="Xunit.Runner.MSBuild.xunit" />
|
||||
<Target Name="AfterBuild">
|
||||
<Xunit.Runner.MSBuild.xunit Assembly="..\ServerResource.Tests\bin\Debug\ServerResource.Tests.dll" />
|
||||
</Target>
|
||||
</Project>
|
||||
-->
|
||||
<UsingTask AssemblyFile="..\packages\xunit.1.9.2\lib\net20\xunit.runner.msbuild.dll" TaskName="Xunit.Runner.MSBuild.xunit" />
|
||||
<Target Name="AfterBuild">
|
||||
<Xunit.Runner.MSBuild.xunit Assembly="..\ServerResource.Tests\bin\Debug\ServerResource.Tests.dll" />
|
||||
</Target>
|
||||
</Project>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,731 +0,0 @@
|
||||
namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION {
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Management;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.ComponentModel.Design.Serialization;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
// Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
|
||||
// Functions Is<PropertyName>Null() are used to check if a property is NULL.
|
||||
// Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
|
||||
// Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
|
||||
// An Early Bound class generated for the WMI class.Msvm_VirtualSystemManagementServiceSettingData
|
||||
public class VirtualSystemManagementServiceSettingData : System.ComponentModel.Component {
|
||||
|
||||
// Private property to hold the WMI namespace in which the class resides.
|
||||
private static string CreatedWmiNamespace = "ROOT\\virtualization";
|
||||
|
||||
// Private property to hold the name of WMI class which created this class.
|
||||
private static string CreatedClassName = "Msvm_VirtualSystemManagementServiceSettingData";
|
||||
|
||||
// Private member variable to hold the ManagementScope which is used by the various methods.
|
||||
private static System.Management.ManagementScope statMgmtScope = null;
|
||||
|
||||
private ManagementSystemProperties PrivateSystemProperties;
|
||||
|
||||
// Underlying lateBound WMI object.
|
||||
private System.Management.ManagementObject PrivateLateBoundObject;
|
||||
|
||||
// Member variable to store the 'automatic commit' behavior for the class.
|
||||
private bool AutoCommitProp;
|
||||
|
||||
// Private variable to hold the embedded property representing the instance.
|
||||
private System.Management.ManagementBaseObject embeddedObj;
|
||||
|
||||
// The current WMI object used
|
||||
private System.Management.ManagementBaseObject curObj;
|
||||
|
||||
// Flag to indicate if the instance is an embedded object.
|
||||
private bool isEmbedded;
|
||||
|
||||
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
|
||||
public VirtualSystemManagementServiceSettingData() {
|
||||
this.InitializeObject(null, null, null);
|
||||
}
|
||||
|
||||
public VirtualSystemManagementServiceSettingData(string keyInstanceID) {
|
||||
this.InitializeObject(null, new System.Management.ManagementPath(VirtualSystemManagementServiceSettingData.ConstructPath(keyInstanceID)), null);
|
||||
}
|
||||
|
||||
public VirtualSystemManagementServiceSettingData(System.Management.ManagementScope mgmtScope, string keyInstanceID) {
|
||||
this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(VirtualSystemManagementServiceSettingData.ConstructPath(keyInstanceID)), null);
|
||||
}
|
||||
|
||||
public VirtualSystemManagementServiceSettingData(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
|
||||
this.InitializeObject(null, path, getOptions);
|
||||
}
|
||||
|
||||
public VirtualSystemManagementServiceSettingData(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
|
||||
this.InitializeObject(mgmtScope, path, null);
|
||||
}
|
||||
|
||||
public VirtualSystemManagementServiceSettingData(System.Management.ManagementPath path) {
|
||||
this.InitializeObject(null, path, null);
|
||||
}
|
||||
|
||||
public VirtualSystemManagementServiceSettingData(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
|
||||
this.InitializeObject(mgmtScope, path, getOptions);
|
||||
}
|
||||
|
||||
public VirtualSystemManagementServiceSettingData(System.Management.ManagementObject theObject) {
|
||||
Initialize();
|
||||
if ((CheckIfProperClass(theObject) == true)) {
|
||||
PrivateLateBoundObject = theObject;
|
||||
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
|
||||
curObj = PrivateLateBoundObject;
|
||||
}
|
||||
else {
|
||||
throw new System.ArgumentException("Class name does not match.");
|
||||
}
|
||||
}
|
||||
|
||||
public VirtualSystemManagementServiceSettingData(System.Management.ManagementBaseObject theObject) {
|
||||
Initialize();
|
||||
if ((CheckIfProperClass(theObject) == true)) {
|
||||
embeddedObj = theObject;
|
||||
PrivateSystemProperties = new ManagementSystemProperties(theObject);
|
||||
curObj = embeddedObj;
|
||||
isEmbedded = true;
|
||||
}
|
||||
else {
|
||||
throw new System.ArgumentException("Class name does not match.");
|
||||
}
|
||||
}
|
||||
|
||||
// Property returns the namespace of the WMI class.
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public string OriginatingNamespace {
|
||||
get {
|
||||
return "ROOT\\virtualization";
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public string ManagementClassName {
|
||||
get {
|
||||
string strRet = CreatedClassName;
|
||||
if ((curObj != null)) {
|
||||
if ((curObj.ClassPath != null)) {
|
||||
strRet = ((string)(curObj["__CLASS"]));
|
||||
if (((strRet == null)
|
||||
|| (strRet == string.Empty))) {
|
||||
strRet = CreatedClassName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return strRet;
|
||||
}
|
||||
}
|
||||
|
||||
// Property pointing to an embedded object to get System properties of the WMI object.
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public ManagementSystemProperties SystemProperties {
|
||||
get {
|
||||
return PrivateSystemProperties;
|
||||
}
|
||||
}
|
||||
|
||||
// Property returning the underlying lateBound object.
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public System.Management.ManagementBaseObject LateBoundObject {
|
||||
get {
|
||||
return curObj;
|
||||
}
|
||||
}
|
||||
|
||||
// ManagementScope of the object.
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public System.Management.ManagementScope Scope {
|
||||
get {
|
||||
if ((isEmbedded == false)) {
|
||||
return PrivateLateBoundObject.Scope;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
set {
|
||||
if ((isEmbedded == false)) {
|
||||
PrivateLateBoundObject.Scope = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public bool AutoCommit {
|
||||
get {
|
||||
return AutoCommitProp;
|
||||
}
|
||||
set {
|
||||
AutoCommitProp = value;
|
||||
}
|
||||
}
|
||||
|
||||
// The ManagementPath of the underlying WMI object.
|
||||
[Browsable(true)]
|
||||
public System.Management.ManagementPath Path {
|
||||
get {
|
||||
if ((isEmbedded == false)) {
|
||||
return PrivateLateBoundObject.Path;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
set {
|
||||
if ((isEmbedded == false)) {
|
||||
if ((CheckIfProperClass(null, value, null) != true)) {
|
||||
throw new System.ArgumentException("Class name does not match.");
|
||||
}
|
||||
PrivateLateBoundObject.Path = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Public static scope property which is used by the various methods.
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public static System.Management.ManagementScope StaticScope {
|
||||
get {
|
||||
return statMgmtScope;
|
||||
}
|
||||
set {
|
||||
statMgmtScope = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
[Description(@"Used by OEMs to allow BIOS-locked Windows operating systems to run in the virtual machine. This string must be exactly 32 characters in length.
|
||||
This is a read-only property, but it can be changed using the ModifyServiceSettings method of the Msvm_VirtualSystemManagementService class.")]
|
||||
public string BiosLockString {
|
||||
get {
|
||||
return ((string)(curObj["BiosLockString"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public string Caption {
|
||||
get {
|
||||
return ((string)(curObj["Caption"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
[Description("The default external data root. By default, \"root\\ProgramData\\Microsoft\\Windows\\V" +
|
||||
"irtualization\".\nThis is a read-only property, but it can be changed using the Mo" +
|
||||
"difyServiceSettings method of the Msvm_VirtualSystemManagementService class.")]
|
||||
public string DefaultExternalDataRoot {
|
||||
get {
|
||||
return ((string)(curObj["DefaultExternalDataRoot"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
[Description("The default virtual hard disk path. By default, \"root\\Users\\Public\\Documents\\Virt" +
|
||||
"ual Hard Disks\".\nThis is a read-only property, but it can be changed using the M" +
|
||||
"odifyServiceSettings method of the Msvm_VirtualSystemManagementService class.")]
|
||||
public string DefaultVirtualHardDiskPath {
|
||||
get {
|
||||
return ((string)(curObj["DefaultVirtualHardDiskPath"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public string Description {
|
||||
get {
|
||||
return ((string)(curObj["Description"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public string ElementName {
|
||||
get {
|
||||
return ((string)(curObj["ElementName"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public string InstanceID {
|
||||
get {
|
||||
return ((string)(curObj["InstanceID"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
[Description("The maximum MAC address for dynamically generated MAC addresses.\nThis is a read-o" +
|
||||
"nly property, but it can be changed using the ModifyServiceSettings method of th" +
|
||||
"e Msvm_VirtualSystemManagementService class.")]
|
||||
public string MaximumMacAddress {
|
||||
get {
|
||||
return ((string)(curObj["MaximumMacAddress"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
[Description("The minimum MAC address for dynamically generated MAC addresses.\nThis is a read-o" +
|
||||
"nly property, but it can be changed using the ModifyServiceSettings method of th" +
|
||||
"e Msvm_VirtualSystemManagementService class.")]
|
||||
public string MinimumMacAddress {
|
||||
get {
|
||||
return ((string)(curObj["MinimumMacAddress"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public bool IsNumaSpanningEnabledNull {
|
||||
get {
|
||||
if ((curObj["NumaSpanningEnabled"] == null)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
[Description("Reserved for future use.")]
|
||||
[TypeConverter(typeof(WMIValueTypeConverter))]
|
||||
public bool NumaSpanningEnabled {
|
||||
get {
|
||||
if ((curObj["NumaSpanningEnabled"] == null)) {
|
||||
return System.Convert.ToBoolean(0);
|
||||
}
|
||||
return ((bool)(curObj["NumaSpanningEnabled"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
[Description("Controls memory allocation for the VMs on non-uniform memory access (NUMA) system" +
|
||||
"s.\nThis is a read-only property, but it can be changed using the ModifyServiceSe" +
|
||||
"ttings method of the Msvm_VirtualSystemManagementService class.")]
|
||||
public string PrimaryOwnerContact {
|
||||
get {
|
||||
return ((string)(curObj["PrimaryOwnerContact"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
[Description(@"Describes how the primary system owner can be reached (for example, phone number or e-mail address). By default, empty. This name may not exceed 256 characters in length.
|
||||
This is a read-only property, but it can be changed using the ModifyServiceSettings method of the Msvm_VirtualSystemManagementService class.")]
|
||||
public string PrimaryOwnerName {
|
||||
get {
|
||||
return ((string)(curObj["PrimaryOwnerName"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
[Description("This is a read-only property, but it can be changed using the ModifyServiceSettin" +
|
||||
"gs method of the Msvm_VirtualSystemManagementService class.")]
|
||||
public string ScopeOfResidence {
|
||||
get {
|
||||
return ((string)(curObj["ScopeOfResidence"]));
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
|
||||
if (((path != null)
|
||||
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
|
||||
if (((theObj != null)
|
||||
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
System.Array parentClasses = ((System.Array)(theObj["__DERIVATION"]));
|
||||
if ((parentClasses != null)) {
|
||||
int count = 0;
|
||||
for (count = 0; (count < parentClasses.Length); count = (count + 1)) {
|
||||
if ((string.Compare(((string)(parentClasses.GetValue(count))), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool ShouldSerializeNumaSpanningEnabled() {
|
||||
if ((this.IsNumaSpanningEnabledNull == false)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public void CommitObject() {
|
||||
if ((isEmbedded == false)) {
|
||||
PrivateLateBoundObject.Put();
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public void CommitObject(System.Management.PutOptions putOptions) {
|
||||
if ((isEmbedded == false)) {
|
||||
PrivateLateBoundObject.Put(putOptions);
|
||||
}
|
||||
}
|
||||
|
||||
private void Initialize() {
|
||||
AutoCommitProp = true;
|
||||
isEmbedded = false;
|
||||
}
|
||||
|
||||
private static string ConstructPath(string keyInstanceID) {
|
||||
string strPath = "ROOT\\virtualization:Msvm_VirtualSystemManagementServiceSettingData";
|
||||
strPath = string.Concat(strPath, string.Concat(".InstanceID=", string.Concat("\"", string.Concat(keyInstanceID, "\""))));
|
||||
return strPath;
|
||||
}
|
||||
|
||||
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
|
||||
Initialize();
|
||||
if ((path != null)) {
|
||||
if ((CheckIfProperClass(mgmtScope, path, getOptions) != true)) {
|
||||
throw new System.ArgumentException("Class name does not match.");
|
||||
}
|
||||
}
|
||||
PrivateLateBoundObject = new System.Management.ManagementObject(mgmtScope, path, getOptions);
|
||||
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
|
||||
curObj = PrivateLateBoundObject;
|
||||
}
|
||||
|
||||
// Different overloads of GetInstances() help in enumerating instances of the WMI class.
|
||||
public static VirtualSystemManagementServiceSettingDataCollection GetInstances() {
|
||||
return GetInstances(null, null, null);
|
||||
}
|
||||
|
||||
public static VirtualSystemManagementServiceSettingDataCollection GetInstances(string condition) {
|
||||
return GetInstances(null, condition, null);
|
||||
}
|
||||
|
||||
public static VirtualSystemManagementServiceSettingDataCollection GetInstances(string[] selectedProperties) {
|
||||
return GetInstances(null, null, selectedProperties);
|
||||
}
|
||||
|
||||
public static VirtualSystemManagementServiceSettingDataCollection GetInstances(string condition, string[] selectedProperties) {
|
||||
return GetInstances(null, condition, selectedProperties);
|
||||
}
|
||||
|
||||
public static VirtualSystemManagementServiceSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
|
||||
if ((mgmtScope == null)) {
|
||||
if ((statMgmtScope == null)) {
|
||||
mgmtScope = new System.Management.ManagementScope();
|
||||
mgmtScope.Path.NamespacePath = "root\\virtualization";
|
||||
}
|
||||
else {
|
||||
mgmtScope = statMgmtScope;
|
||||
}
|
||||
}
|
||||
System.Management.ManagementPath pathObj = new System.Management.ManagementPath();
|
||||
pathObj.ClassName = "Msvm_VirtualSystemManagementServiceSettingData";
|
||||
pathObj.NamespacePath = "root\\virtualization";
|
||||
System.Management.ManagementClass clsObject = new System.Management.ManagementClass(mgmtScope, pathObj, null);
|
||||
if ((enumOptions == null)) {
|
||||
enumOptions = new System.Management.EnumerationOptions();
|
||||
enumOptions.EnsureLocatable = true;
|
||||
}
|
||||
return new VirtualSystemManagementServiceSettingDataCollection(clsObject.GetInstances(enumOptions));
|
||||
}
|
||||
|
||||
public static VirtualSystemManagementServiceSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
|
||||
return GetInstances(mgmtScope, condition, null);
|
||||
}
|
||||
|
||||
public static VirtualSystemManagementServiceSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
|
||||
return GetInstances(mgmtScope, null, selectedProperties);
|
||||
}
|
||||
|
||||
public static VirtualSystemManagementServiceSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
|
||||
if ((mgmtScope == null)) {
|
||||
if ((statMgmtScope == null)) {
|
||||
mgmtScope = new System.Management.ManagementScope();
|
||||
mgmtScope.Path.NamespacePath = "root\\virtualization";
|
||||
}
|
||||
else {
|
||||
mgmtScope = statMgmtScope;
|
||||
}
|
||||
}
|
||||
System.Management.ManagementObjectSearcher ObjectSearcher = new System.Management.ManagementObjectSearcher(mgmtScope, new SelectQuery("Msvm_VirtualSystemManagementServiceSettingData", condition, selectedProperties));
|
||||
System.Management.EnumerationOptions enumOptions = new System.Management.EnumerationOptions();
|
||||
enumOptions.EnsureLocatable = true;
|
||||
ObjectSearcher.Options = enumOptions;
|
||||
return new VirtualSystemManagementServiceSettingDataCollection(ObjectSearcher.Get());
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public static VirtualSystemManagementServiceSettingData CreateInstance() {
|
||||
System.Management.ManagementScope mgmtScope = null;
|
||||
if ((statMgmtScope == null)) {
|
||||
mgmtScope = new System.Management.ManagementScope();
|
||||
mgmtScope.Path.NamespacePath = CreatedWmiNamespace;
|
||||
}
|
||||
else {
|
||||
mgmtScope = statMgmtScope;
|
||||
}
|
||||
System.Management.ManagementPath mgmtPath = new System.Management.ManagementPath(CreatedClassName);
|
||||
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
|
||||
return new VirtualSystemManagementServiceSettingData(tmpMgmtClass.CreateInstance());
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public void Delete() {
|
||||
PrivateLateBoundObject.Delete();
|
||||
}
|
||||
|
||||
// Enumerator implementation for enumerating instances of the class.
|
||||
public class VirtualSystemManagementServiceSettingDataCollection : object, ICollection {
|
||||
|
||||
private ManagementObjectCollection privColObj;
|
||||
|
||||
public VirtualSystemManagementServiceSettingDataCollection(ManagementObjectCollection objCollection) {
|
||||
privColObj = objCollection;
|
||||
}
|
||||
|
||||
public virtual int Count {
|
||||
get {
|
||||
return privColObj.Count;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool IsSynchronized {
|
||||
get {
|
||||
return privColObj.IsSynchronized;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual object SyncRoot {
|
||||
get {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void CopyTo(System.Array array, int index) {
|
||||
privColObj.CopyTo(array, index);
|
||||
int nCtr;
|
||||
for (nCtr = 0; (nCtr < array.Length); nCtr = (nCtr + 1)) {
|
||||
array.SetValue(new VirtualSystemManagementServiceSettingData(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual System.Collections.IEnumerator GetEnumerator() {
|
||||
return new VirtualSystemManagementServiceSettingDataEnumerator(privColObj.GetEnumerator());
|
||||
}
|
||||
|
||||
public class VirtualSystemManagementServiceSettingDataEnumerator : object, System.Collections.IEnumerator {
|
||||
|
||||
private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
|
||||
|
||||
public VirtualSystemManagementServiceSettingDataEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
|
||||
privObjEnum = objEnum;
|
||||
}
|
||||
|
||||
public virtual object Current {
|
||||
get {
|
||||
return new VirtualSystemManagementServiceSettingData(((System.Management.ManagementObject)(privObjEnum.Current)));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool MoveNext() {
|
||||
return privObjEnum.MoveNext();
|
||||
}
|
||||
|
||||
public virtual void Reset() {
|
||||
privObjEnum.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TypeConverter to handle null values for ValueType properties
|
||||
public class WMIValueTypeConverter : TypeConverter {
|
||||
|
||||
private TypeConverter baseConverter;
|
||||
|
||||
private System.Type baseType;
|
||||
|
||||
public WMIValueTypeConverter(System.Type inBaseType) {
|
||||
baseConverter = TypeDescriptor.GetConverter(inBaseType);
|
||||
baseType = inBaseType;
|
||||
}
|
||||
|
||||
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
|
||||
return baseConverter.CanConvertFrom(context, srcType);
|
||||
}
|
||||
|
||||
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
|
||||
return baseConverter.CanConvertTo(context, destinationType);
|
||||
}
|
||||
|
||||
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
|
||||
return baseConverter.ConvertFrom(context, culture, value);
|
||||
}
|
||||
|
||||
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
|
||||
return baseConverter.CreateInstance(context, dictionary);
|
||||
}
|
||||
|
||||
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
|
||||
return baseConverter.GetCreateInstanceSupported(context);
|
||||
}
|
||||
|
||||
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
|
||||
return baseConverter.GetProperties(context, value, attributeVar);
|
||||
}
|
||||
|
||||
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
|
||||
return baseConverter.GetPropertiesSupported(context);
|
||||
}
|
||||
|
||||
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
|
||||
return baseConverter.GetStandardValues(context);
|
||||
}
|
||||
|
||||
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
|
||||
return baseConverter.GetStandardValuesExclusive(context);
|
||||
}
|
||||
|
||||
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
|
||||
return baseConverter.GetStandardValuesSupported(context);
|
||||
}
|
||||
|
||||
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
|
||||
if ((baseType.BaseType == typeof(System.Enum))) {
|
||||
if ((value.GetType() == destinationType)) {
|
||||
return value;
|
||||
}
|
||||
if ((((value == null)
|
||||
&& (context != null))
|
||||
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
|
||||
return "NULL_ENUM_VALUE" ;
|
||||
}
|
||||
return baseConverter.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
if (((baseType == typeof(bool))
|
||||
&& (baseType.BaseType == typeof(System.ValueType)))) {
|
||||
if ((((value == null)
|
||||
&& (context != null))
|
||||
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
|
||||
return "";
|
||||
}
|
||||
return baseConverter.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
if (((context != null)
|
||||
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
|
||||
return "";
|
||||
}
|
||||
return baseConverter.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
}
|
||||
|
||||
// Embedded class to represent WMI system Properties.
|
||||
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
|
||||
public class ManagementSystemProperties {
|
||||
|
||||
private System.Management.ManagementBaseObject PrivateLateBoundObject;
|
||||
|
||||
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
|
||||
PrivateLateBoundObject = ManagedObject;
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public int GENUS {
|
||||
get {
|
||||
return ((int)(PrivateLateBoundObject["__GENUS"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public string CLASS {
|
||||
get {
|
||||
return ((string)(PrivateLateBoundObject["__CLASS"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public string SUPERCLASS {
|
||||
get {
|
||||
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public string DYNASTY {
|
||||
get {
|
||||
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public string RELPATH {
|
||||
get {
|
||||
return ((string)(PrivateLateBoundObject["__RELPATH"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public int PROPERTY_COUNT {
|
||||
get {
|
||||
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public string[] DERIVATION {
|
||||
get {
|
||||
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public string SERVER {
|
||||
get {
|
||||
return ((string)(PrivateLateBoundObject["__SERVER"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public string NAMESPACE {
|
||||
get {
|
||||
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
public string PATH {
|
||||
get {
|
||||
return ((string)(PrivateLateBoundObject["__PATH"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1447,8 +1447,8 @@
|
||||
inParams["TimeoutPeriod"] = ToDmtfDateTime(((System.DateTime)(TimeoutPeriod)));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RequestReplicationStateChange", inParams, null);
|
||||
Job = null;
|
||||
if ((outParams.Properties["Job"] != null)) {
|
||||
Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
if ((outParams.Properties["Job"] != null) && outParams.Properties["Job"].Value != null) {
|
||||
Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1462,12 +1462,13 @@
|
||||
if ((isEmbedded == false)) {
|
||||
System.Management.ManagementBaseObject inParams = null;
|
||||
inParams = PrivateLateBoundObject.GetMethodParameters("RequestStateChange");
|
||||
inParams["RequestedState"] = ((ushort)(RequestedState));
|
||||
inParams["TimeoutPeriod"] = ToDmtfDateTime(((System.DateTime)(TimeoutPeriod)));
|
||||
inParams["RequestedState"] = RequestedState;
|
||||
inParams["TimeoutPeriod"] = null; // ToDmtfDateTime(((System.DateTime)(TimeoutPeriod)));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RequestStateChange", inParams, null);
|
||||
Job = null;
|
||||
if ((outParams.Properties["Job"] != null)) {
|
||||
Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
if ((outParams.Properties["Job"] != null) && outParams.Properties["Job"].Value != null)
|
||||
{
|
||||
Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1311,8 +1311,9 @@
|
||||
inParams["TimeoutPeriod"] = ToDmtfDateTime(((System.DateTime)(TimeoutPeriod)));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RequestStateChange", inParams, null);
|
||||
Job = null;
|
||||
if ((outParams.Properties["Job"] != null)) {
|
||||
Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1006,13 +1006,13 @@
|
||||
inParams["FeatureSettings"] = ((string[])(FeatureSettings));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("AddFeatureSettings", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
ResultingFeatureSettings = null;
|
||||
if ((outParams.Properties["ResultingFeatureSettings"] != null)) {
|
||||
if ((outParams.Properties["ResultingFeatureSettings"] != null && outParams.Properties["ResultingFeatureSettings"].Value != null))
|
||||
{
|
||||
int len = ((System.Array)(outParams.Properties["ResultingFeatureSettings"].Value)).Length;
|
||||
System.Management.ManagementPath[] arrToRet = new System.Management.ManagementPath[len];
|
||||
for (int iCounter = 0; (iCounter < len); iCounter = (iCounter + 1)) {
|
||||
@ -1052,11 +1052,9 @@
|
||||
inParams["TargetSystem"] = ((System.Management.ManagementPath)(TargetSystem)).Path;
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("AddKvpItems", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1074,13 +1072,13 @@
|
||||
inParams["ResourceSettings"] = ((string[])(ResourceSettings));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("AddResourceSettings", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
ResultingResourceSettings = null;
|
||||
if ((outParams.Properties["ResultingResourceSettings"] != null)) {
|
||||
if ((outParams.Properties["ResultingResourceSettings"] != null && outParams.Properties["ResultingResourceSettings"].Value != null))
|
||||
{
|
||||
int len = ((System.Array)(outParams.Properties["ResultingResourceSettings"].Value)).Length;
|
||||
System.Management.ManagementPath[] arrToRet = new System.Management.ManagementPath[len];
|
||||
for (int iCounter = 0; (iCounter < len); iCounter = (iCounter + 1)) {
|
||||
@ -1097,23 +1095,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
public uint DefineSystem(System.Management.ManagementPath ReferenceConfiguration, string[] ResourceSettings, string SystemSettings, out System.Management.ManagementPath Job, out System.Management.ManagementPath ResultingSystem) {
|
||||
public uint DefineSystem(string ReferenceConfigurationPath, string[] ResourceSettings, string SystemSettings, out System.Management.ManagementPath Job, out System.Management.ManagementPath ResultingSystem) {
|
||||
if ((isEmbedded == false)) {
|
||||
System.Management.ManagementBaseObject inParams = null;
|
||||
inParams = PrivateLateBoundObject.GetMethodParameters("DefineSystem");
|
||||
inParams["ReferenceConfiguration"] = ((System.Management.ManagementPath)(ReferenceConfiguration)).Path;
|
||||
inParams["ResourceSettings"] = ((string[])(ResourceSettings));
|
||||
inParams["SystemSettings"] = ((string)(SystemSettings));
|
||||
inParams["ReferenceConfiguration"] = ReferenceConfigurationPath;
|
||||
inParams["ResourceSettings"] = ResourceSettings;
|
||||
inParams["SystemSettings"] = SystemSettings;
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("DefineSystem", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null) && outParams.Properties["Job"].Value != null)
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
ResultingSystem = null;
|
||||
if ((outParams.Properties["ResultingSystem"] != null)) {
|
||||
ResultingSystem = new System.Management.ManagementPath(outParams.Properties["ResultingSystem"].ToString());
|
||||
if ((outParams.Properties["ResultingSystem"] != null && outParams.Properties["ResultingSystem"].Value != null))
|
||||
{
|
||||
ResultingSystem = new System.Management.ManagementPath((string)outParams.Properties["ResultingSystem"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1131,10 +1129,9 @@
|
||||
inParams["AffectedSystem"] = ((System.Management.ManagementPath)(AffectedSystem)).Path;
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("DestroySystem", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1153,11 +1150,11 @@
|
||||
inParams["ExportSettingData"] = ((string)(ExportSettingData));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ExportSystemDefinition", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
else {
|
||||
@ -1290,7 +1287,8 @@
|
||||
inParams["SnapshotFolder"] = ((string)(SnapshotFolder));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ImportSnapshotDefinitions", inParams, null);
|
||||
ImportedSnapshots = null;
|
||||
if ((outParams.Properties["ImportedSnapshots"] != null)) {
|
||||
if ((outParams.Properties["ImportedSnapshots"] != null && outParams.Properties["ImportedSnapshots"].Value != null))
|
||||
{
|
||||
int len = ((System.Array)(outParams.Properties["ImportedSnapshots"].Value)).Length;
|
||||
System.Management.ManagementPath[] arrToRet = new System.Management.ManagementPath[len];
|
||||
for (int iCounter = 0; (iCounter < len); iCounter = (iCounter + 1)) {
|
||||
@ -1299,10 +1297,9 @@
|
||||
ImportedSnapshots = arrToRet;
|
||||
}
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1322,15 +1319,16 @@
|
||||
inParams["SystemDefinitionFile"] = ((string)(SystemDefinitionFile));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ImportSystemDefinition", inParams, null);
|
||||
ImportedSystem = null;
|
||||
if ((outParams.Properties["ImportedSystem"] != null)) {
|
||||
if ((outParams.Properties["ImportedSystem"] != null && outParams.Properties["ImportedSystem"].Value != null))
|
||||
{
|
||||
ImportedSystem = new System.Management.ManagementPath(outParams.Properties["ImportedSystem"].ToString());
|
||||
}
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
else {
|
||||
@ -1347,10 +1345,9 @@
|
||||
inParams["SettingData"] = ((string)(SettingData));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifyDiskMergeSettings", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1367,13 +1364,13 @@
|
||||
inParams["FeatureSettings"] = ((string[])(FeatureSettings));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifyFeatureSettings", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
ResultingFeatureSettings = null;
|
||||
if ((outParams.Properties["ResultingFeatureSettings"] != null)) {
|
||||
if ((outParams.Properties["ResultingFeatureSettings"] != null && outParams.Properties["ResultingFeatureSettings"].Value != null))
|
||||
{
|
||||
int len = ((System.Array)(outParams.Properties["ResultingFeatureSettings"].Value)).Length;
|
||||
System.Management.ManagementPath[] arrToRet = new System.Management.ManagementPath[len];
|
||||
for (int iCounter = 0; (iCounter < len); iCounter = (iCounter + 1)) {
|
||||
@ -1398,10 +1395,9 @@
|
||||
inParams["TargetSystem"] = ((System.Management.ManagementPath)(TargetSystem)).Path;
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifyKvpItems", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1418,13 +1414,13 @@
|
||||
inParams["ResourceSettings"] = ((string[])(ResourceSettings));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifyResourceSettings", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null) && outParams.Properties["Job"].Value != null)
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
ResultingResourceSettings = null;
|
||||
if ((outParams.Properties["ResultingResourceSettings"] != null)) {
|
||||
if ((outParams.Properties["ResultingResourceSettings"] != null && outParams.Properties["ResultingResourceSettings"].Value != null))
|
||||
{
|
||||
int len = ((System.Array)(outParams.Properties["ResultingResourceSettings"].Value)).Length;
|
||||
System.Management.ManagementPath[] arrToRet = new System.Management.ManagementPath[len];
|
||||
for (int iCounter = 0; (iCounter < len); iCounter = (iCounter + 1)) {
|
||||
@ -1448,10 +1444,9 @@
|
||||
inParams["SettingData"] = ((string)(SettingData));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifyServiceSettings", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1468,10 +1463,9 @@
|
||||
inParams["SystemSettings"] = ((string)(SystemSettings));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifySystemSettings", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1488,10 +1482,9 @@
|
||||
inParams["PlannedSystem"] = ((System.Management.ManagementPath)(PlannedSystem)).Path;
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RealizePlannedSystem", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
ResultingSystem = null;
|
||||
if ((outParams.Properties["ResultingSystem"] != null)) {
|
||||
@ -1523,10 +1516,9 @@
|
||||
}
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RemoveFeatureSettings", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1557,11 +1549,9 @@
|
||||
inParams["TargetSystem"] = ((System.Management.ManagementPath)(TargetSystem)).Path;
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RemoveKvpItems", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1588,11 +1578,9 @@
|
||||
}
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RemoveResourceSettings", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1610,11 +1598,9 @@
|
||||
inParams["TimeoutPeriod"] = ToDmtfDateTime(((System.DateTime)(TimeoutPeriod)));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RequestStateChange", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1632,11 +1618,9 @@
|
||||
inParams["NetworkConfiguration"] = ((string[])(NetworkConfiguration));
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("SetGuestNetworkAdapterConfiguration", inParams, null);
|
||||
Job = null;
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
@ -1675,10 +1659,9 @@
|
||||
inParams["PlannedSystem"] = ((System.Management.ManagementPath)(PlannedSystem)).Path;
|
||||
System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ValidatePlannedSystem", inParams, null);
|
||||
Job = null;
|
||||
// if (outParams.Properties["Job"] != null)
|
||||
if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
|
||||
if ((outParams.Properties["Job"] != null))
|
||||
{
|
||||
// Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
|
||||
Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
|
||||
}
|
||||
return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,193 +1,175 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DB824727-BDC3-437C-A364-7A811D8A160F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CloudStack.Plugin.WmiWrappers</RootNamespace>
|
||||
<AssemblyName>WmiWrappers</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTestsDebug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\NoUnitTestsDebug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTests|AnyCPU'">
|
||||
<OutputPath>bin\NoUnitTests\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AWSSDK">
|
||||
<HintPath>..\packages\AWSSDK.1.5.23.0\lib\AWSSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NSubstitute">
|
||||
<HintPath>..\packages\NSubstitute.1.6.1.0\lib\NET40\NSubstitute.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="xunit">
|
||||
<HintPath>..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ROOT.CIMV2.Win32_OperatingSystem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="root.CIMV2.Win32_PerfFormattedData_Counters_ProcessorInformation.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.CIMV2.Win32_Processor.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_ComputerSystem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_ConcreteJob.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_ExternalEthernetPort.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_ImageManagementService.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_MemorySettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_ProcessorSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_ResourceAllocationSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_SummaryInformation.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_SwitchLANEndpoint.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_SwitchPort.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_SyntheticEthernetPort.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_SyntheticEthernetPortSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_VirtualSwitch.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_VirtualSwitchManagementService.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_VirtualSystemGlobalSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_VirtualSystemManagementService.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_VirtualSystemManagementServiceSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_VirtualSystemSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_VLANEndpoint.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_VLANEndpointSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.Msvm_VmLANEndpoint.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_ComputerSystem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_ConcreteJob.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_KvpExchangeComponent.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_KvpExchangeComponentSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_KvpExchangeDataItem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_VirtualSystemManagementService.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_VirtualSystemManagementServiceSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_VirtualSystemSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DB824727-BDC3-437C-A364-7A811D8A160F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CloudStack.Plugin.WmiWrappers</RootNamespace>
|
||||
<AssemblyName>WmiWrappers</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTestsDebug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\NoUnitTestsDebug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTests|AnyCPU'">
|
||||
<OutputPath>bin\NoUnitTests\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AWSSDK">
|
||||
<HintPath>..\packages\AWSSDK.1.5.23.0\lib\AWSSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NSubstitute">
|
||||
<HintPath>..\packages\NSubstitute.1.6.1.0\lib\NET40\NSubstitute.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="xunit">
|
||||
<HintPath>..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ROOT.CIMV2.Win32_OperatingSystem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="root.CIMV2.Win32_PerfFormattedData_Counters_ProcessorInformation.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.CIMV2.Win32_Processor.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_ComputerSystem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_ConcreteJob.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_EthernetPortAllocationSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_EthernetSwitchPort.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_EthernetSwitchPortVlanSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_ExternalEthernetPort.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_ImageManagementService.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_KvpExchangeComponent.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_KvpExchangeComponentSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_KvpExchangeDataItem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_LANEndpoint.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_MemorySettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_ProcessorSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_ResourceAllocationSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_StorageAllocationSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_SummaryInformation.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_SyntheticEthernetPortSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_VirtualEthernetSwitch.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_VirtualEthernetSwitchManagementService.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_VirtualHardDiskSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_VirtualSystemManagementService.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_VirtualSystemManagementServiceSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROOT.virtualization.v2.Msvm_VirtualSystemSettingData.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user