Fix an error in the tests where the tests can select a default template which is not shown in the tree

(e.g. XenSource P2V Server, which is an internal template, not displayed in the tree)

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2015-07-24 16:28:23 +01:00
parent 84ed24cd0c
commit 173a5877dd

View File

@ -37,6 +37,7 @@ using XenAdmin.Core;
using XenAdmin.Model;
using XenAdmin.Network;
using XenAdmin.Network.StorageLink;
using XenAdminTests.XenModelTests;
using XenAPI;
namespace XenAdminTests
@ -158,7 +159,8 @@ namespace XenAdminTests
foreach (VM vm in connection.Cache.VMs)
{
if (vm.is_a_template && !vm.is_a_snapshot &&
if (vm.is_a_template && !vm.is_a_snapshot &&
vm.Show(XenAdminConfigManager.Provider.ShowHiddenVMs) &&
vm.DefaultTemplate && (cond == null || cond(vm)))
return vm;
}