2013-06-24 13:41:48 +02:00
|
|
|
|
/* Copyright (c) Citrix Systems Inc.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms,
|
|
|
|
|
* with or without modification, are permitted provided
|
|
|
|
|
* that the following conditions are met:
|
|
|
|
|
*
|
|
|
|
|
* * Redistributions of source code must retain the above
|
|
|
|
|
* copyright notice, this list of conditions and the
|
|
|
|
|
* following disclaimer.
|
|
|
|
|
* * Redistributions in binary form must reproduce the above
|
|
|
|
|
* copyright notice, this list of conditions and the
|
|
|
|
|
* following disclaimer in the documentation and/or other
|
|
|
|
|
* materials provided with the distribution.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
|
|
|
|
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
|
|
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
|
*/
|
|
|
|
|
|
2013-10-08 11:17:57 +02:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
2013-06-24 13:41:48 +02:00
|
|
|
|
using NUnit.Framework;
|
2013-08-28 15:44:46 +02:00
|
|
|
|
|
|
|
|
|
using XenAdmin.Controls.MainWindowControls;
|
|
|
|
|
|
2013-06-24 13:41:48 +02:00
|
|
|
|
using XenAPI;
|
|
|
|
|
using XenAdmin;
|
|
|
|
|
using XenAdmin.Controls;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using XenAdmin.Model;
|
|
|
|
|
|
|
|
|
|
namespace XenAdminTests.TabsAndMenus
|
|
|
|
|
{
|
|
|
|
|
[TestFixture, Category(TestCategories.UICategoryB)]
|
|
|
|
|
public class ToolbarGeorge : TabsAndMenus
|
|
|
|
|
{
|
|
|
|
|
public ToolbarGeorge()
|
|
|
|
|
: base("state1.xml")
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected ToolbarGeorge(string db)
|
|
|
|
|
: base(db)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_XenCenterNode()
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", false ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", false ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
VerifyToolbar(null, buttons);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_Pool()
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VerifyToolbar(GetAnyPool(), buttons);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_Host()
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", true ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", true ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (Host host in GetAllXenObjects<Host>())
|
|
|
|
|
{
|
|
|
|
|
VerifyToolbar(host, buttons);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_DefaultTemplate()
|
|
|
|
|
{
|
|
|
|
|
EnsureChecked(MainWindowWrapper.ViewMenuItems.TemplatesToolStripMenuItem);
|
|
|
|
|
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
VerifyToolbar(GetAnyDefaultTemplate(), buttons);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_UserTemplate()
|
|
|
|
|
{
|
|
|
|
|
EnsureChecked(MainWindowWrapper.ViewMenuItems.TemplatesToolStripMenuItem);
|
|
|
|
|
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (VM vm in GetAllXenObjects<VM>(v => v.is_a_template && !v.DefaultTemplate && !v.is_a_snapshot))
|
|
|
|
|
{
|
|
|
|
|
VerifyToolbar(vm, buttons);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_SR()
|
|
|
|
|
{
|
|
|
|
|
EnsureChecked(MainWindowWrapper.ViewMenuItems.LocalStorageToolStripMenuItem);
|
|
|
|
|
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (SR sr in GetAllXenObjects<SR>(s => !s.IsToolsSR))
|
|
|
|
|
{
|
|
|
|
|
VerifyToolbar(sr, buttons);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_Snapshot()
|
|
|
|
|
{
|
2013-08-28 15:44:46 +02:00
|
|
|
|
PutInNavigationMode(NavigationPane.NavigationMode.Objects);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", false ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", false ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (VM snapshot in GetAllXenObjects<VM>(v => v.is_a_snapshot))
|
|
|
|
|
{
|
|
|
|
|
VerifyToolbar(snapshot, buttons);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
2013-08-28 15:44:46 +02:00
|
|
|
|
PutInNavigationMode(NavigationPane.NavigationMode.Infrastructure);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_VDI()
|
|
|
|
|
{
|
2013-08-28 15:44:46 +02:00
|
|
|
|
PutInNavigationMode(NavigationPane.NavigationMode.Objects);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", false ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", false ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
VerifyToolbar(GetAnyVDI(v => v.name_label != "base copy"), buttons);
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
2013-08-28 15:44:46 +02:00
|
|
|
|
PutInNavigationMode(NavigationPane.NavigationMode.Infrastructure);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_Network()
|
|
|
|
|
{
|
2013-08-28 15:44:46 +02:00
|
|
|
|
PutInNavigationMode(NavigationPane.NavigationMode.Objects);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", false ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", false ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (XenAPI.Network network in GetAllXenObjects<XenAPI.Network>(n => n.name_label != "Guest installer network"))
|
|
|
|
|
{
|
|
|
|
|
VerifyToolbar(network, buttons);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
2013-08-28 15:44:46 +02:00
|
|
|
|
PutInNavigationMode(NavigationPane.NavigationMode.Infrastructure);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_GroupingTag()
|
|
|
|
|
{
|
2013-08-28 15:44:46 +02:00
|
|
|
|
PutInNavigationMode(NavigationPane.NavigationMode.Objects);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", false ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", false ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (GroupingTag gt in GetAllTreeNodes().FindAll(v => v.Tag is GroupingTag).ConvertAll(v => (GroupingTag)v.Tag))
|
|
|
|
|
{
|
|
|
|
|
VerifyToolbar(gt, buttons);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
2013-08-28 15:44:46 +02:00
|
|
|
|
PutInNavigationMode(NavigationPane.NavigationMode.Infrastructure);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_Folder()
|
|
|
|
|
{
|
2013-08-28 15:44:46 +02:00
|
|
|
|
PutInNavigationMode(NavigationPane.NavigationMode.Folders);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", false ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", false ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
2013-10-08 11:17:57 +02:00
|
|
|
|
var folders = GetAllXenObjects<Folder>().Where(f => !(string.IsNullOrEmpty(f.ToString())));
|
|
|
|
|
foreach (Folder folder in folders)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
VerifyToolbar(folder, buttons);
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
2013-08-28 15:44:46 +02:00
|
|
|
|
PutInNavigationMode(NavigationPane.NavigationMode.Infrastructure);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_Master()
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", true ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", true ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
VerifyToolbar(GetAnyHost(IsMaster), buttons);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_Slave()
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", true ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", true ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
VerifyToolbar(GetAnyHost(IsSlave), buttons);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_VMWithTools()
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", true ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", true ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", true ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (VM vm in GetAllXenObjects<VM>(HasTools))
|
|
|
|
|
{
|
|
|
|
|
VerifyToolbar(vm, buttons);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_VMWithoutTools()
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Shut Down", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
2013-11-20 14:09:17 +01:00
|
|
|
|
new ExpectedTextMenuItem("Force Shut Down", true ),
|
2013-06-24 13:41:48 +02:00
|
|
|
|
new ExpectedTextMenuItem("Force Reboot", true ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (VM vm in GetAllXenObjects<VM>(NoTools))
|
|
|
|
|
{
|
|
|
|
|
VerifyToolbar(vm, buttons);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void ToolBar_VMShutdown()
|
|
|
|
|
{
|
|
|
|
|
ExpectedMenuItem[] buttons = new ExpectedMenuItem[]{
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Add New Server", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("New Pool", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New Storage", true ),
|
|
|
|
|
new ExpectedTextMenuItem("New VM", true ),
|
|
|
|
|
new ExpectedSeparator(),
|
|
|
|
|
new ExpectedTextMenuItem("Start", true ),
|
|
|
|
|
new ExpectedTextMenuItem("Reboot", false ),
|
|
|
|
|
new ExpectedTextMenuItem("Suspend", false ),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (VM vm in GetAllXenObjects<VM>(IsShutdown))
|
|
|
|
|
{
|
|
|
|
|
VerifyToolbar(vm, buttons);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|