2017-01-16 20:59:50 +01:00
/ * Copyright ( c ) Citrix Systems , Inc .
2013-06-24 13:41:48 +02:00
* 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 ;
using XenAdmin ;
using XenAdmin.Controls ;
2013-08-28 15:44:46 +02:00
using XenAdmin.Controls.MainWindowControls ;
2013-06-24 13:41:48 +02:00
using XenAdmin.Model ;
using XenAPI ;
namespace XenAdminTests.TabsAndMenus
{
[TestFixture, Category(TestCategories.UICategoryB)]
public class MainMenuGeorge : TabsAndMenus
{
public MainMenuGeorge ( )
: base ( "state1.xml" )
{
}
protected MainMenuGeorge ( string db )
: base ( db )
{
}
[TestFixtureSetUp]
public void TestFixtureSetUp ( )
{
DisableAllPlugins ( ) ;
}
[Test]
public void MainMenu_XenCenterNode ( )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Add Server" , false , false ) ,
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , false , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Manage &vApps..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , false , false ) ,
new ExpectedTextMenuItem ( "Di&saster Recovery" , false , false ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , false , false ) ,
2014-08-15 08:10:45 +02:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , false , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Start" , false ) , new ExpectedTextMenuItem ( "S&uspend" , false ) , new ExpectedTextMenuItem ( "Reb&oot" , false ) , new ExpectedTextMenuItem ( "Start in Reco&very Mode" , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "Force Shut&down" , false ) , new ExpectedTextMenuItem ( "Force Re&boot" , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , false ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , false ) } ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( null , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
[Test]
public void MainMenu_Pool ( )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
2016-11-11 18:04:08 +01:00
new ExpectedTextMenuItem ( "&Add Server" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Add New Server..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , true , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , true , false ) ,
new ExpectedSeparator ( ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Manage &vApps..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , true , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Di&saster Recovery" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Configure..." , true ) , new ExpectedTextMenuItem ( "&Disaster Recovery Wizard..." , true ) } ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , true , false ) ,
2014-10-29 10:49:09 +01:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , true , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , false , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , true , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , true , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Start" , false ) , new ExpectedTextMenuItem ( "S&uspend" , false ) , new ExpectedTextMenuItem ( "Reb&oot" , false ) , new ExpectedTextMenuItem ( "Start in Reco&very Mode" , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "Force Shut&down" , false ) , new ExpectedTextMenuItem ( "Force Re&boot" , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , true , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , false ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , false ) } ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( GetAnyPool ( ) , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
[Test]
public void MainMenu_Host ( )
{
foreach ( Host host in GetAllXenObjects < Host > ( ) )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
2016-11-11 18:04:08 +01:00
new ExpectedTextMenuItem ( "&Add Server" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Add New Server..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , true , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , true , false ) ,
new ExpectedSeparator ( ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Manage &vApps..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , true , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Di&saster Recovery" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Configure..." , true ) , new ExpectedTextMenuItem ( "&Disaster Recovery Wizard..." , true ) } ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , true , false ) ,
2014-10-29 10:49:09 +01:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , true , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , true , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , true , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , host . IsMaster ( ) ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , host . IsMaster ( ) ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , true , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , true , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , true , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , true , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , host . IsMaster ( ) , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Start" , false ) , new ExpectedTextMenuItem ( "S&uspend" , false ) , new ExpectedTextMenuItem ( "Reb&oot" , false ) , new ExpectedTextMenuItem ( "Start in Reco&very Mode" , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "Force Shut&down" , false ) , new ExpectedTextMenuItem ( "Force Re&boot" , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , true , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , false ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , false ) } ) ,
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( host , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
}
[Test]
public void MainMenu_DefaultTemplate ( )
{
EnsureDefaultTemplatesShown ( ) ;
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
2016-11-11 18:04:08 +01:00
new ExpectedTextMenuItem ( "&Add Server" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Add New Server..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , true , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , true , false ) ,
new ExpectedSeparator ( ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Manage &vApps..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , true , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Di&saster Recovery" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Configure..." , true ) , new ExpectedTextMenuItem ( "&Disaster Recovery Wizard..." , true ) } ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , true , false ) ,
2014-10-29 10:49:09 +01:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , false , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Start" , false ) , new ExpectedTextMenuItem ( "S&uspend" , false ) , new ExpectedTextMenuItem ( "Reb&oot" , false ) , new ExpectedTextMenuItem ( "Start in Reco&very Mode" , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "Force Shut&down" , false ) , new ExpectedTextMenuItem ( "Force Re&boot" , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , true ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , true ) } ) ,
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , true , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , true , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
2015-09-17 17:48:52 +02:00
new ExpectedTextMenuItem ( "&Export to File..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Copy..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
VerifyMainMenu ( GetAnyDefaultTemplate ( t = > t . name_label = = "CentOS 4.5" ) , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
[Test]
public void MainMenu_UserTemplate ( )
{
EnsureDefaultTemplatesShown ( ) ;
foreach ( VM vm in GetAllXenObjects < VM > ( v = > v . is_a_template & & ! v . DefaultTemplate & & ! v . is_a_snapshot ) )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
2016-11-11 18:04:08 +01:00
new ExpectedTextMenuItem ( "&Add Server" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Add New Server..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , true , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , true , false ) ,
new ExpectedSeparator ( ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Manage &vApps..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , true , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Di&saster Recovery" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Configure..." , true ) , new ExpectedTextMenuItem ( "&Disaster Recovery Wizard..." , true ) } ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , true , false ) ,
2014-10-29 10:49:09 +01:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , vm . Home ( ) ! = null , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , vm . Home ( ) ! = null , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Start" , true ) , new ExpectedTextMenuItem ( "S&uspend" , false ) , new ExpectedTextMenuItem ( "Reb&oot" , false ) , new ExpectedTextMenuItem ( "Start in Reco&very Mode" , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "Force Shut&down" , false ) , new ExpectedTextMenuItem ( "Force Re&boot" , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , true ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , true ) } ) ,
// new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , true , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , true , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , vm . InstantTemplate , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , true , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
VerifyMainMenu ( vm , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
}
[Test]
public void MainMenu_SR ( )
{
EnsureChecked ( MainWindowWrapper . ViewMenuItems . LocalStorageToolStripMenuItem ) ;
foreach ( SR sr in GetAllXenObjects < SR > ( s = > ! s . IsToolsSR ) )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
2016-11-11 18:04:08 +01:00
new ExpectedTextMenuItem ( "&Add Server" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Add New Server..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , true , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , true , false ) ,
new ExpectedSeparator ( ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Manage &vApps..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , true , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Di&saster Recovery" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Configure..." , true ) , new ExpectedTextMenuItem ( "&Disaster Recovery Wizard..." , true ) } ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , true , false ) ,
2014-10-29 10:49:09 +01:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , sr . Home ! = null , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , sr . Home ! = null , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Start" , false ) , new ExpectedTextMenuItem ( "S&uspend" , false ) , new ExpectedTextMenuItem ( "Reb&oot" , false ) , new ExpectedTextMenuItem ( "Start in Reco&very Mode" , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "Force Shut&down" , false ) , new ExpectedTextMenuItem ( "Force Re&boot" , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , CanSetAsDefault ( sr ) , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , true ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , false ) } ) ,
// new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , CanDetach ( sr ) , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , CanForget ( sr ) , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , CanDestroy ( sr ) , false ) ,
2016-02-18 11:44:17 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", CanConvertSR(sr), false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( sr , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
}
[Test]
public void MainMenu_Snapshot ( )
{
2013-08-28 15:44:46 +02:00
PutInNavigationMode ( NavigationPane . NavigationMode . Objects ) ;
2013-06-24 13:41:48 +02:00
try
{
foreach ( VM snapshot in GetAllXenObjects < VM > ( v = > v . is_a_snapshot ) )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Add Server" , false , false ) ,
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , false , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Manage &vApps..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , false , false ) ,
new ExpectedTextMenuItem ( "Di&saster Recovery" , false , false ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , false , false ) ,
2014-08-15 08:10:45 +02:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , false , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , false , false ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( snapshot , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
}
finally
{
2013-08-28 15:44:46 +02:00
PutInNavigationMode ( NavigationPane . NavigationMode . Infrastructure ) ;
2013-06-24 13:41:48 +02:00
}
}
[Test]
public void MainMenu_VDI ( )
{
2013-08-28 15:44:46 +02:00
PutInNavigationMode ( NavigationPane . NavigationMode . Objects ) ;
2013-06-24 13:41:48 +02:00
try
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Add Server" , false , false ) ,
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , false , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Manage &vApps..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , false , false ) ,
new ExpectedTextMenuItem ( "Di&saster Recovery" , false , false ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , false , false ) ,
2014-08-15 08:10:45 +02:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , false , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , false , false ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( GetAnyVDI ( v = > v . name_label ! = "base copy" ) , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
finally
{
2013-08-28 15:44:46 +02:00
PutInNavigationMode ( NavigationPane . NavigationMode . Infrastructure ) ;
2013-06-24 13:41:48 +02:00
}
}
[Test]
public void MainMenu_Network ( )
{
2013-08-28 15:44:46 +02:00
PutInNavigationMode ( NavigationPane . NavigationMode . Objects ) ;
2013-06-24 13:41:48 +02:00
try
{
foreach ( XenAPI . Network network in GetAllXenObjects < XenAPI . Network > ( n = > n . name_label ! = "Guest installer network" ) )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Add Server" , false , false ) ,
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , false , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Manage &vApps..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , false , false ) ,
new ExpectedTextMenuItem ( "Di&saster Recovery" , false , false ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , false , false ) ,
2014-08-15 08:10:45 +02:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , false , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , false , false ) ,
// new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( network , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
}
finally
{
2013-08-28 15:44:46 +02:00
PutInNavigationMode ( NavigationPane . NavigationMode . Infrastructure ) ;
2013-06-24 13:41:48 +02:00
}
}
[Test]
public void MainMenu_GroupingTag ( )
{
2013-08-28 15:44:46 +02:00
PutInNavigationMode ( NavigationPane . NavigationMode . Tags ) ;
2013-06-24 13:41:48 +02:00
try
{
VirtualTreeNode n = GetAllTreeNodes ( ) . Find ( v = > v . Tag is GroupingTag ) ;
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Add Server" , false , false ) ,
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , false , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Manage &vApps..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , false , false ) ,
new ExpectedTextMenuItem ( "Di&saster Recovery" , false , false ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , false , false ) ,
2014-08-15 08:10:45 +02:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , false , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , false , false ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( ( GroupingTag ) n . Tag , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
finally
{
2013-08-28 15:44:46 +02:00
PutInNavigationMode ( NavigationPane . NavigationMode . Infrastructure ) ;
2013-06-24 13:41:48 +02:00
}
}
[Test]
public void MainMenu_Folder ( )
{
2013-08-28 15:44:46 +02:00
PutInNavigationMode ( NavigationPane . NavigationMode . Folders ) ;
2013-06-24 13:41:48 +02:00
try
{
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
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Add Server" , false , false ) ,
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , false , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Manage &vApps..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , false , false ) ,
new ExpectedTextMenuItem ( "Di&saster Recovery" , false , false ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , false , false ) ,
2014-08-15 08:10:45 +02:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , false , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , false , false ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( folder , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
}
finally
{
2013-08-28 15:44:46 +02:00
PutInNavigationMode ( NavigationPane . NavigationMode . Infrastructure ) ;
2013-06-24 13:41:48 +02:00
}
}
[Test]
public void MainMenu_Master ( )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
2016-11-11 18:04:08 +01:00
new ExpectedTextMenuItem ( "&Add Server" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Add New Server..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , true , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , true , false ) ,
new ExpectedSeparator ( ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Manage &vApps..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , true , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Di&saster Recovery" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Configure..." , true ) , new ExpectedTextMenuItem ( "&Disaster Recovery Wizard..." , true ) } ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , true , false ) ,
2014-10-29 10:49:09 +01:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , true , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , true , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , true , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , true ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , true ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , true , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , true , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , true , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , true , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Start" , false ) , new ExpectedTextMenuItem ( "S&uspend" , false ) , new ExpectedTextMenuItem ( "Reb&oot" , false ) , new ExpectedTextMenuItem ( "Start in Reco&very Mode" , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "Force Shut&down" , false ) , new ExpectedTextMenuItem ( "Force Re&boot" , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , true , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , false ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , false ) } ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( GetAnyHost ( IsMaster ) , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
[Test]
public void MainMenu_Slave ( )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
2016-11-11 18:04:08 +01:00
new ExpectedTextMenuItem ( "&Add Server" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Add New Server..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , true , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , true , false ) ,
new ExpectedSeparator ( ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Manage &vApps..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , true , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Di&saster Recovery" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Configure..." , true ) , new ExpectedTextMenuItem ( "&Disaster Recovery Wizard..." , true ) } ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , true , false ) ,
2014-10-29 10:49:09 +01:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , true , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , true , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , true , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , true , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , true , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , true , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , true , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Start" , false ) , new ExpectedTextMenuItem ( "S&uspend" , false ) , new ExpectedTextMenuItem ( "Reb&oot" , false ) , new ExpectedTextMenuItem ( "Start in Reco&very Mode" , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "Force Shut&down" , false ) , new ExpectedTextMenuItem ( "Force Re&boot" , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
new ExpectedTextMenuItem ( "Assign to vA&pp" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , false , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , true , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , false , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , false ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , false ) } ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( GetAnyHost ( t = > t . name_label = = "incubus" & & ! t . IsMaster ( ) ) , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
[Test]
public void MainMenu_VMWithTools ( )
{
foreach ( VM vm in GetAllXenObjects < VM > ( HasTools ) )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
2016-11-11 18:04:08 +01:00
new ExpectedTextMenuItem ( "&Add Server" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Add New Server..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , true , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , true , false ) ,
new ExpectedSeparator ( ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Manage &vApps..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , true , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Di&saster Recovery" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Configure..." , true ) , new ExpectedTextMenuItem ( "&Disaster Recovery Wizard..." , true ) } ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , true , false ) ,
2014-10-29 10:49:09 +01:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , true , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
bool residentOnInflames = vm . Connection . Resolve < Host > ( vm . resident_on ) . name_label = = "inflames" ;
ExpectedMenuItem [ ] VMToolStripMenuItem =
new ExpectedMenuItem [ ]
{
new ExpectedTextMenuItem ( "&New VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , true , false ,
new ExpectedMenuItem [ ]
{
new ExpectedTextMenuItem ( "S&hut Down" , true ) ,
new ExpectedTextMenuItem ( "S&uspend" , true ) ,
new ExpectedTextMenuItem ( "Reb&oot" , true ) ,
new ExpectedTextMenuItem ( "Start in Reco&very Mode" , false ) ,
new ExpectedSeparator ( ) ,
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 Re&boot" , true ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "S&tart vApp" , false ) ,
new ExpectedTextMenuItem ( "Shut Dow&n vApp" , false )
} ) ,
new ExpectedTextMenuItem ( "M&igrate to Server" , true , false ,
new ExpectedMenuItem [ ]
{
new ExpectedTextMenuItem ( "&Home Server (Current server)" , false ) ,
residentOnInflames
? new ExpectedTextMenuItem ( "inflames (Current server)" , false , false , true )
: new ExpectedTextMenuItem ( "inflames (INTERNAL_ERROR)" , false , false , true ) ,
residentOnInflames
? new ExpectedTextMenuItem ( "incubus (INTERNAL_ERROR)" , false , false , true )
: new ExpectedTextMenuItem ( "incubus (Current server)" , false , false , true ) ,
} ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Assign to vA&pp" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&New vApp..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , true , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , true ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , true ) } ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
VerifyMainMenu ( vm , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
}
[Test]
public void MainMenu_VMWithoutTools ( )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
2016-11-11 18:04:08 +01:00
new ExpectedTextMenuItem ( "&Add Server" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Add New Server..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , true , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , true , false ) ,
new ExpectedSeparator ( ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Manage &vApps..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , true , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Di&saster Recovery" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Configure..." , true ) , new ExpectedTextMenuItem ( "&Disaster Recovery Wizard..." , true ) } ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , true , false ) ,
2014-10-29 10:49:09 +01:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , true , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem =
new ExpectedMenuItem [ ]
{
new ExpectedTextMenuItem ( "&New VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , true , false ,
new ExpectedMenuItem [ ]
{
new ExpectedTextMenuItem ( "&Start" , false ) ,
new ExpectedTextMenuItem ( "S&uspend" , false ) , new ExpectedTextMenuItem ( "Reb&oot" , false ) ,
new ExpectedTextMenuItem ( "Start in Reco&very Mode" , false ) , new ExpectedSeparator ( ) ,
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 Re&boot" , true ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "S&tart vApp" , false ) ,
new ExpectedTextMenuItem ( "Shut Dow&n vApp" , false )
} ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Assign to vA&pp" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&New vApp..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , false , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , true , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , false , false ) ,
new ExpectedTextMenuItem ( "&Export..." , false , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , true ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , true ) } ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
foreach ( VM vm in GetAllXenObjects < VM > ( NoTools ) )
{
VerifyMainMenu ( vm , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
}
[Test]
public void MainMenu_VMShutdown ( )
{
ExpectedMenuItem [ ] poolToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New Pool..." , true , false ) ,
new ExpectedSeparator ( ) ,
2016-11-11 18:04:08 +01:00
new ExpectedTextMenuItem ( "&Add Server" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Add New Server..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Re&move Server" , false , false ) ,
new ExpectedTextMenuItem ( "Reconnec&t As..." , true , false ) ,
new ExpectedTextMenuItem ( "Dis&connect" , true , false ) ,
new ExpectedSeparator ( ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Manage &vApps..." , true , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&High Availability..." , true , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Di&saster Recovery" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Configure..." , true ) , new ExpectedTextMenuItem ( "&Disaster Recovery Wizard..." , true ) } ) ,
new ExpectedTextMenuItem ( "VM &Protection Policies..." , true , false ) ,
2014-10-29 10:49:09 +01:00
new ExpectedTextMenuItem ( "E&xport Resource Data..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "View Wor&kload Reports..." , false , false ) ,
new ExpectedTextMenuItem ( "Disconnect Workload &Balancing Server" , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Change Server Pass&word..." , false , false ) ,
new ExpectedSeparator ( ) ,
2014-05-16 15:15:46 +02:00
new ExpectedTextMenuItem ( "Mak&e into standalone server" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] HostMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Add..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false , false ) ,
new ExpectedTextMenuItem ( "Power O&n" , false , false ) ,
new ExpectedTextMenuItem ( "S&hut Down" , false , false ) ,
new ExpectedTextMenuItem ( "Restart Toolstac&k" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Connect/Disconnect" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&Connect" , false ) , new ExpectedTextMenuItem ( "Dis&connect" , false ) , new ExpectedTextMenuItem ( "Reconnec&t As..." , false ) , new ExpectedSeparator ( ) , new ExpectedTextMenuItem ( "C&onnect All" , false ) , new ExpectedTextMenuItem ( "Di&sconnect All" , true ) } ) ,
new ExpectedTextMenuItem ( "Add to &Pool" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Back Up..." , false , false ) ,
new ExpectedTextMenuItem ( "Restore From Back&up..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Enter &Maintenance Mode..." , false , false ) ,
2016-08-01 10:25:10 +02:00
new ExpectedTextMenuItem ( "Control &Domain Memory..." , false , false ) ,
new ExpectedTextMenuItem ( "Remove Crash Dump &Files" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Pass&word" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&Change..." , false , false ) ,
2015-11-16 17:11:40 +01:00
new ExpectedTextMenuItem ( "&Forget Password" , false , false ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "D&estroy" , false , false ) ,
2016-01-14 11:52:53 +01:00
new ExpectedTextMenuItem ( "Remo&ve from " + Branding . BRAND_CONSOLE , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] VMToolStripMenuItem =
new ExpectedMenuItem [ ]
{
new ExpectedTextMenuItem ( "&New VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Start/Shut down" , true , false ,
new ExpectedMenuItem [ ]
{
new ExpectedTextMenuItem ( "&Start" , true ) ,
new ExpectedTextMenuItem ( "S&uspend" , false ) ,
new ExpectedTextMenuItem ( "Reb&oot" , false ) ,
new ExpectedTextMenuItem ( "Start in Reco&very Mode" , true ) ,
new ExpectedSeparator ( ) ,
2013-11-20 14:09:17 +01:00
new ExpectedTextMenuItem ( "Force Shut &Down" , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Force Re&boot" , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "S&tart vApp" , false ) ,
new ExpectedTextMenuItem ( "Shut Dow&n vApp" , false )
} ) ,
new ExpectedTextMenuItem ( "Start on Ser&ver" , true , false ,
new ExpectedMenuItem [ ]
{
new ExpectedTextMenuItem ( "&Home Server (Home Server is not set)" , false ) ,
new ExpectedTextMenuItem ( "inflames (INTERNAL_ERROR)" , false , false , true ) ,
new ExpectedTextMenuItem ( "incubus (INTERNAL_ERROR)" , false , false , true )
} ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Assign to VM Protection Polic&y" , false , false ) ,
2015-11-08 12:23:10 +01:00
new ExpectedTextMenuItem ( "Assign to vA&pp" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "&New vApp..." , true ) } ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Copy VM..." , true , false ) ,
new ExpectedTextMenuItem ( "&Move VM..." , false , false ) ,
new ExpectedTextMenuItem ( "Ta&ke a Snapshot..." , true , false ) ,
new ExpectedTextMenuItem ( "Convert to &Template..." , true , false ) ,
new ExpectedTextMenuItem ( "&Export..." , true , false ) ,
2017-01-04 18:13:20 +01:00
new ExpectedTextMenuItem ( "Ena&ble PVS-Accelerator..." , false , false ) ,
new ExpectedTextMenuItem ( "Disable P&VS-Accelerator" , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
2016-01-18 04:07:13 +01:00
new ExpectedTextMenuItem ( "Inst&all " + Branding . PRODUCT_BRAND + " Tools..." , false , false ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "Send Ctrl+&Alt+Del" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete VM..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , true , false )
} ;
ExpectedMenuItem [ ] StorageToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New SR..." , true , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "Re&pair..." , false , false ) ,
new ExpectedTextMenuItem ( "Set as Defaul&t" , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Virtual Disks" , true , false , new ExpectedMenuItem [ ] { new ExpectedTextMenuItem ( "New &Virtual Disk..." , true ) , new ExpectedTextMenuItem ( "&Attach Virtual Disk..." , true ) } ) ,
//new ExpectedTextMenuItem("Storage&Link", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Change Server Password...", false),new ExpectedTextMenuItem("&Remove Servers...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add Storage System...", false), new ExpectedTextMenuItem("R&emove Storage System...", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Destroy Storage Volume...", false)} ),
2014-07-04 14:36:41 +02:00
new ExpectedTextMenuItem ( "Re&claim freed space" , false , false ) ,
new ExpectedSeparator ( ) ,
2013-06-24 13:41:48 +02:00
new ExpectedTextMenuItem ( "&Detach..." , false , false ) ,
new ExpectedTextMenuItem ( "R&eattach..." , false , false ) ,
new ExpectedTextMenuItem ( "&Forget" , false , false ) ,
new ExpectedTextMenuItem ( "Destr&oy..." , false , false ) ,
2016-02-17 15:02:25 +01:00
/* REMOVED THIN PROVISIONING new ExpectedTextMenuItem("&Convert SR...", false, false ), */
2013-06-24 13:41:48 +02:00
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
ExpectedMenuItem [ ] templatesToolStripMenuItem = new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "Create &VM From Selection" , false , false , new ExpectedMenuItem [ ] {
new ExpectedTextMenuItem ( "&New VM wizard..." , false , false ) ,
new ExpectedTextMenuItem ( "&Quick Create" , false , false ) } ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Export to File..." , false , false ) ,
new ExpectedTextMenuItem ( "&Copy..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "&Delete Template..." , false , false ) ,
new ExpectedSeparator ( ) ,
new ExpectedTextMenuItem ( "P&roperties" , false , false )
} ;
foreach ( VM vm in GetAllXenObjects < VM > ( IsShutdown ) )
{
VerifyMainMenu ( vm , poolToolStripMenuItem , HostMenuItem , VMToolStripMenuItem , StorageToolStripMenuItem , templatesToolStripMenuItem ) ;
}
}
}
}