mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-24 22:06:59 +01:00
CP-19664: Update RPU hotfixes in XenCenter
Added the RPU hotfix for Dundee Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
parent
e7f4f3b8a0
commit
d76c450c41
@ -52,23 +52,9 @@ namespace XenAdmin.Diagnostics.Checks
|
||||
if (!Host.IsLive)
|
||||
return new HostNotLiveWarning(this, Host);
|
||||
|
||||
if (Helpers.CreedenceOrGreater(Host) && !Helpers.DundeeOrGreater(Host)
|
||||
&& hotfixFactory.Hotfix(HotfixFactory.HotfixableServerVersion.Creedence).ShouldBeAppliedTo(Host))
|
||||
{
|
||||
var hotfix = hotfixFactory.Hotfix(Host);
|
||||
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
|
||||
return new HostDoesNotHaveHotfix(this, Host);
|
||||
}
|
||||
|
||||
if (Helpers.SanibelOrGreater(Host) && !Helpers.CreedenceOrGreater(Host)
|
||||
&& hotfixFactory.Hotfix(HotfixFactory.HotfixableServerVersion.SanibelToClearwater).ShouldBeAppliedTo(Host))
|
||||
{
|
||||
return new HostDoesNotHaveHotfix(this, Host);
|
||||
}
|
||||
|
||||
if (!Helpers.SanibelOrGreater(Host)
|
||||
&& hotfixFactory.Hotfix(HotfixFactory.HotfixableServerVersion.Boston).ShouldBeAppliedTo(Host))
|
||||
{
|
||||
return new HostDoesNotHaveHotfix(this, Host);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -42,7 +42,8 @@ namespace XenAdmin.Diagnostics.Hotfixing
|
||||
{
|
||||
Boston,
|
||||
SanibelToClearwater,
|
||||
Creedence
|
||||
Creedence,
|
||||
Dundee
|
||||
}
|
||||
|
||||
private readonly Hotfix bostonHotfix = new MultipleHotfix()
|
||||
@ -74,8 +75,16 @@ namespace XenAdmin.Diagnostics.Hotfixing
|
||||
UUID = "3f92b111-0a90-4ec6-b85a-737f241a3fc1 "
|
||||
};
|
||||
|
||||
private readonly Hotfix dundeeHotfix = new SingleHotfix
|
||||
{
|
||||
Filename = "RPU003",
|
||||
UUID = "474a0f28-0d33-4c9b-9e20-52baaea8ce5e"
|
||||
};
|
||||
|
||||
public Hotfix Hotfix(Host host)
|
||||
{
|
||||
if (Helpers.DundeeOrGreater(host) && !Helpers.ElyOrGreater(host))
|
||||
return Hotfix(HotfixableServerVersion.Dundee);
|
||||
if (Helpers.CreedenceOrGreater(host) && !Helpers.DundeeOrGreater(host))
|
||||
return Hotfix(HotfixableServerVersion.Creedence);
|
||||
if (Helpers.SanibelOrGreater(host) && !Helpers.CreedenceOrGreater(host))
|
||||
@ -88,6 +97,8 @@ namespace XenAdmin.Diagnostics.Hotfixing
|
||||
|
||||
public Hotfix Hotfix(HotfixableServerVersion version)
|
||||
{
|
||||
if (version == HotfixableServerVersion.Dundee)
|
||||
return dundeeHotfix;
|
||||
if (version == HotfixableServerVersion.Creedence)
|
||||
return creedenceHotfix;
|
||||
if (version == HotfixableServerVersion.SanibelToClearwater)
|
||||
|
@ -59,7 +59,7 @@ namespace XenAdminTests.UnitTests.Diagnostics
|
||||
string[] enumNames = Enum.GetNames(typeof (HotfixFactory.HotfixableServerVersion));
|
||||
Array.Sort(enumNames);
|
||||
|
||||
string[] expectedNames = new []{"Boston", "SanibelToClearwater", "Creedence"};
|
||||
string[] expectedNames = new []{"Boston", "SanibelToClearwater", "Creedence", "Dundee"};
|
||||
Array.Sort(expectedNames);
|
||||
|
||||
CollectionAssert.AreEqual(expectedNames, enumNames, "Expected contents of HotfixableServerVersion enum");
|
||||
@ -79,6 +79,10 @@ namespace XenAdminTests.UnitTests.Diagnostics
|
||||
Assert.AreEqual("3f92b111-0a90-4ec6-b85a-737f241a3fc1 ",
|
||||
factory.Hotfix(HotfixFactory.HotfixableServerVersion.Creedence).UUID,
|
||||
"Creedence UUID lookup from enum");
|
||||
|
||||
Assert.AreEqual("474a0f28-0d33-4c9b-9e20-52baaea8ce5e",
|
||||
factory.Hotfix(HotfixFactory.HotfixableServerVersion.Dundee).UUID,
|
||||
"Dundee UUID lookup from enum");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -95,12 +99,16 @@ namespace XenAdminTests.UnitTests.Diagnostics
|
||||
Assert.AreEqual("RPU002",
|
||||
factory.Hotfix(HotfixFactory.HotfixableServerVersion.Creedence).Filename,
|
||||
"Creedence Filename lookup from enum");
|
||||
|
||||
Assert.AreEqual("RPU003",
|
||||
factory.Hotfix(HotfixFactory.HotfixableServerVersion.Dundee).Filename,
|
||||
"Dundee Filename lookup from enum");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[TestCase("2.0.0", Description = "Dundee")]
|
||||
[TestCase("2.1.1", Description = "Ely")]
|
||||
[TestCase("9999.9999.9999", Description = "Future")]
|
||||
public void TestPlatformVersionNumbersDundeeOrGreaterGiveNulls(string platformVersion)
|
||||
public void TestPlatformVersionNumbersElyOrGreaterGiveNulls(string platformVersion)
|
||||
{
|
||||
Mock<Host> host = ObjectManager.NewXenObject<Host>(id);
|
||||
host.Setup(h => h.PlatformVersion).Returns(platformVersion);
|
||||
@ -118,7 +126,8 @@ namespace XenAdminTests.UnitTests.Diagnostics
|
||||
}
|
||||
|
||||
[Test]
|
||||
[TestCase("2.0.0", Description = "Dundee", Result = false)]
|
||||
[TestCase("2.1.1", Description = "Ely", Result = false)]
|
||||
[TestCase("2.0.0", Description = "Dundee", Result = true)]
|
||||
[TestCase("1.9.0", Description = "Creedence", Result = true)]
|
||||
[TestCase("1.8.0", Description = "Clearwater", Result = true)]
|
||||
[TestCase("1.6.10", Description = "Tampa", Result = true)]
|
||||
|
@ -150,6 +150,11 @@ then
|
||||
latest=$(ls RPU002 | /usr/bin/sort -n | tail -n 1)
|
||||
echo "INFO: Latest version of RPU002 hotfix is $latest"
|
||||
cp RPU002/$latest/RPU002.xsupdate RPU002.xsupdate
|
||||
if [ -d "RPU003" ]; then
|
||||
latest=$(ls RPU003 | /usr/bin/sort -n | tail -n 1)
|
||||
echo "INFO: Latest version of RPU003 hotfix is $latest"
|
||||
cp RPU003/$latest/RPU003.xsupdate RPU003.xsupdate
|
||||
fi
|
||||
fi
|
||||
|
||||
#build
|
||||
|
Loading…
Reference in New Issue
Block a user