Merge pull request #89 from MihaelaStoica/CP-8667

CP-8667: Update RPU hotfixes in XenCenter
This commit is contained in:
Gabor Apati-Nagy 2014-06-10 17:43:54 +01:00
commit 0e5c2932e4
8 changed files with 31 additions and 29 deletions

View File

@ -52,8 +52,8 @@ namespace XenAdmin.Diagnostics.Checks
if (!Host.IsLive)
return new HostNotLive(this, Host);
if (Helpers.SanibelOrGreater(Host) && !Helpers.TampaOrGreater(Host)
&& hotfixFactory.Hotfix(HotfixFactory.HotfixableServerVersion.Sanibel).ShouldBeAppliedTo(Host))
if (Helpers.SanibelOrGreater(Host) && !Helpers.CreedenceOrGreater(Host)
&& hotfixFactory.Hotfix(HotfixFactory.HotfixableServerVersion.SanibelToClearwater).ShouldBeAppliedTo(Host))
{
return new HostDoesNotHaveHotfix(this, Host);
}

View File

@ -43,7 +43,7 @@ namespace XenAdmin.Diagnostics.Hotfixing
MNR,
Cowley,
Boston,
Sanibel
SanibelToClearwater
}
private readonly Hotfix mnrHotfix = new SingleHotfix
@ -69,22 +69,22 @@ namespace XenAdmin.Diagnostics.Hotfixing
},
new SingleHotfix
{
Filename = "XS60E009.xsupdate",
UUID = "8d7ba04f-bcdf-4f34-afdf-acd3206b59ec"
Filename = "XS62E006.xsupdate",
UUID = "b412a910-0453-42ed-bae0-982cc48b00d6"
}
}
};
private readonly Hotfix sanibelHotfix = new SingleHotfix
private readonly Hotfix sanibelToClearwaterHotfix = new SingleHotfix
{
Filename = "XS60E009.xsupdate",
UUID = "8d7ba04f-bcdf-4f34-afdf-acd3206b59ec"
Filename = "XS62E006.xsupdate",
UUID = "b412a910-0453-42ed-bae0-982cc48b00d6"
};
public Hotfix Hotfix(Host host)
{
if (Helpers.SanibelOrGreater(host) && !Helpers.TampaOrGreater(host))
return Hotfix(HotfixableServerVersion.Sanibel);
if (Helpers.SanibelOrGreater(host) && !Helpers.CreedenceOrGreater(host))
return Hotfix(HotfixableServerVersion.SanibelToClearwater);
if (Helpers.BostonOrGreater(host) && !Helpers.SanibelOrGreater(host))
return Hotfix(HotfixableServerVersion.Boston);
if (Helpers.CowleyOrGreater(host) && !Helpers.BostonOrGreater(host))
@ -97,8 +97,8 @@ namespace XenAdmin.Diagnostics.Hotfixing
public Hotfix Hotfix(HotfixableServerVersion version)
{
if (version == HotfixableServerVersion.Sanibel)
return sanibelHotfix;
if (version == HotfixableServerVersion.SanibelToClearwater)
return sanibelToClearwaterHotfix;
if (version == HotfixableServerVersion.Boston)
return bostonHotfix;
if (version == HotfixableServerVersion.Cowley)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
XenAdmin/XS62E006.xsupdate Normal file

Binary file not shown.

View File

@ -2124,6 +2124,9 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="XS62E006.xsupdate">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="AppIcon.ico" />
@ -6514,9 +6517,6 @@
<None Include="XS60E001.xsupdate">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="XS60E009.xsupdate">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\XenCenterLib\XenCenterLib.csproj">

View File

@ -59,7 +59,7 @@ namespace XenAdminTests.UnitTests.Diagnostics
string[] enumNames = Enum.GetNames(typeof (HotfixFactory.HotfixableServerVersion));
Array.Sort(enumNames);
string[] expectedNames = new []{"Cowley", "MNR", "Boston", "Sanibel"};
string[] expectedNames = new []{"Cowley", "MNR", "Boston", "SanibelToClearwater"};
Array.Sort(expectedNames);
CollectionAssert.AreEqual(expectedNames, enumNames, "Expected contents of HotfixableServerVersion enum");
@ -68,7 +68,7 @@ namespace XenAdminTests.UnitTests.Diagnostics
[Test]
public void UUIDLookedUpFromEnum()
{
Assert.AreEqual("8d7ba04f-bcdf-4f34-afdf-acd3206b59ec;95ac709c-e408-423f-8d22-84b8134a149e",
Assert.AreEqual("95ac709c-e408-423f-8d22-84b8134a149e;b412a910-0453-42ed-bae0-982cc48b00d6",
factory.Hotfix(HotfixFactory.HotfixableServerVersion.Boston).UUID,
"Boston UUID lookup from enum");
@ -80,15 +80,15 @@ namespace XenAdminTests.UnitTests.Diagnostics
factory.Hotfix(HotfixFactory.HotfixableServerVersion.MNR).UUID,
"MNR UUID lookup from enum");
Assert.AreEqual("8d7ba04f-bcdf-4f34-afdf-acd3206b59ec",
factory.Hotfix(HotfixFactory.HotfixableServerVersion.Sanibel).UUID,
"Sanibel UUID lookup from enum");
Assert.AreEqual("b412a910-0453-42ed-bae0-982cc48b00d6",
factory.Hotfix(HotfixFactory.HotfixableServerVersion.SanibelToClearwater).UUID,
"SanibelToClearwater UUID lookup from enum");
}
[Test]
public void FilenameLookedUpFromEnum()
{
Assert.AreEqual("XS60E001.xsupdate;XS60E009.xsupdate",
Assert.AreEqual("XS60E001.xsupdate;XS62E006.xsupdate",
factory.Hotfix(HotfixFactory.HotfixableServerVersion.Boston).Filename,
"Boston Filename lookup from enum");
@ -100,15 +100,15 @@ namespace XenAdminTests.UnitTests.Diagnostics
factory.Hotfix(HotfixFactory.HotfixableServerVersion.MNR).Filename,
"MNR Filename lookup from enum");
Assert.AreEqual("XS60E009.xsupdate",
factory.Hotfix(HotfixFactory.HotfixableServerVersion.Sanibel).Filename,
"Sanibel Filename lookup from enum");
Assert.AreEqual("XS62E006.xsupdate",
factory.Hotfix(HotfixFactory.HotfixableServerVersion.SanibelToClearwater).Filename,
"SanibelToClearwater Filename lookup from enum");
}
[Test]
[TestCase("1.6.10", Description = "Tampa")]
[TestCase("1.9.0", Description = "Creedence")]
[TestCase("9999.9999.9999", Description = "Future")]
public void TestPlatformVersionNumbersTampaOrGreaterGiveNulls(string platformVersion)
public void TestPlatformVersionNumbersCreedenceOrGreaterGiveNulls(string platformVersion)
{
Mock<Host> host = ObjectManager.NewXenObject<Host>(id);
host.Setup(h => h.PlatformVersion).Returns(platformVersion);
@ -116,8 +116,8 @@ namespace XenAdminTests.UnitTests.Diagnostics
}
[Test]
[TestCase("6.0.2", "XS60E009.xsupdate", Description = "Sanibel")]
[TestCase("6.0.0", "XS60E001.xsupdate;XS60E009.xsupdate", Description = "Boston")]
[TestCase("6.0.2", "XS62E006.xsupdate", Description = "Sanibel")]
[TestCase("6.0.0", "XS60E001.xsupdate;XS62E006.xsupdate", Description = "Boston")]
[TestCase("5.6.100", "XS56EFP1002.xsupdate", Description = "Cowley")]
[TestCase("5.6.0", "XS56E008.xsupdate", Description = "MNR")]
public void TestProductVersionNumbersWithHotfixes(string productVersion, string filenames)
@ -128,7 +128,9 @@ namespace XenAdminTests.UnitTests.Diagnostics
}
[Test]
[TestCase("1.6.10", Description = "Tampa", Result = false)]
[TestCase("1.9.0", Description = "Creedence", Result = false)]
[TestCase("1.8.0", Description = "Clearwater", Result = true)]
[TestCase("1.6.10", Description = "Tampa", Result = true)]
[TestCase("9999.9999.9999", Description = "Future", Result = false)]
public bool TestIsHotfixRequiredBasedOnPlatformVersion(string version)
{