public void DisableRemoteDesktopForEmptyService()
 {
     using (FileSystemHelper files = new FileSystemHelper(this))
     {
         files.CreateAzureSdkDirectoryAndImportPublishSettings();
         files.CreateNewService("NEW_SERVICE");
         new DisableAzureRemoteDesktopCommand().DisableRemoteDesktop();
     }
 }
 public void DisableRemoteDesktopForWebRole()
 {
     using (FileSystemHelper files = new FileSystemHelper(this))
     {
         files.CreateAzureSdkDirectoryAndImportPublishSettings();
         string root = files.CreateNewService("NEW_SERVICE");
         new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess("WebRole", 1, root);
         new DisableAzureRemoteDesktopCommand().DisableRemoteDesktop();
     }
 }
Exemple #3
0
 public void EnableDisableRemoteDesktopForWebRole()
 {
     using (FileSystemHelper files = new FileSystemHelper(this))
     {
         files.CreateAzureSdkDirectoryAndImportPublishSettings();
         string root = files.CreateNewService("NEW_SERVICE");
         new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess("WebRole", 1, root);
         EnableAzureRemoteDesktopCommandTest.EnableRemoteDesktop("user", "GoodPassword!");
         new DisableAzureRemoteDesktopCommand().DisableRemoteDesktop();
         // Verify the role has been setup with forwarding, access,
         // and certs
         AzureService service = new AzureService(root, null);
         EnableAzureRemoteDesktopCommandTest.VerifyWebRole(service.Components.Definition.WebRole[0], true);
         VerifyDisableRoleSettings(service);
     }
 }
Exemple #4
0
        public void EnableRemoteDesktopForMultipleWebAndWorkerRolesTwice()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                string root = files.CreateNewService("NEW_SERVICE");
                new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess("WebRole_1", 1, root);
                new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess("WebRole_2", 1, root);
                new AddAzureNodeWorkerRoleCommand().AddAzureNodeWorkerRoleProcess("WorkerRole_1", 1, root);
                new AddAzureNodeWorkerRoleCommand().AddAzureNodeWorkerRoleProcess("WorkerRole_2", 1, root);

                EnableRemoteDesktop("user", "GoodPassword!");
                EnableRemoteDesktop("other", "OtherPassword!");

                // Verify the roles have been setup with forwarding, access,
                // and certs
                AzureService service = new AzureService(root, null);
                VerifyWebRole(service.Components.Definition.WebRole[0], false);
                VerifyWebRole(service.Components.Definition.WebRole[0], false);
                VerifyWorkerRole(service.Components.Definition.WorkerRole[0], true);
                VerifyWorkerRole(service.Components.Definition.WorkerRole[1], false);
                VerifyRoleSettings(service);
            }
        }
        public void EnableRemoteDesktopBasicParameterValidation()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                files.CreateNewService("NEW_SERVICE");

                Testing.AssertThrows<ArgumentException>(
                    () => EnableRemoteDesktop(null, null));
                Testing.AssertThrows<ArgumentException>(
                    () => EnableRemoteDesktop(string.Empty, string.Empty));
                Testing.AssertThrows<ArgumentException>(
                    () => EnableRemoteDesktop("user", null));
                Testing.AssertThrows<ArgumentException>(
                    () => EnableRemoteDesktop("user", string.Empty));
                Testing.AssertThrows<ArgumentException>(
                    () => EnableRemoteDesktop("user", "short"));
                Testing.AssertThrows<ArgumentException>(
                    () => EnableRemoteDesktop("user", "onlylower"));
                Testing.AssertThrows<ArgumentException>(
                    () => EnableRemoteDesktop("user", "ONLYUPPER"));
                Testing.AssertThrows<ArgumentException>(
                    () => EnableRemoteDesktop("user", "1234567890"));
            }
        }
        public void EnableRemoteDesktopForWebRole()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                string root = files.CreateNewService("NEW_SERVICE");
                new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess("WebRole", 1, root);
                EnableRemoteDesktop("user", "GoodPassword!");

                // Verify the role has been setup with forwarding, access,
                // and certs
                AzureService service = new AzureService(root, null);
                VerifyWebRole(service.Components.Definition.WebRole[0], true);
                VerifyRoleSettings(service);
            }
        }
 public void EnableRemoteDesktopForEmptyService()
 {
     using (FileSystemHelper files = new FileSystemHelper(this))
     {
         files.CreateAzureSdkDirectoryAndImportPublishSettings();
         files.CreateNewService("NEW_SERVICE");
         Testing.AssertThrows<InvalidOperationException>(() =>
             EnableRemoteDesktop("user", "GoodPassword!"));
     }
 }