Inheritance: BatchAccountContext
Exemplo n.º 1
0
 public void TestListPoolsByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     string poolId1 = "testFilter1";
     string poolId2 = "testFilter2";
     string poolId3 = "thirdFilterTest";
     string poolPrefix = "testFilter";
     int matches = 2;
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListPoolsByFilter '{0}' '{1}'", poolPrefix, matches) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId1, 0);
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId2, 0);
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId3, 0);
         },
         () =>
         {
             ScenarioTestHelpers.DeletePool(controller, context, poolId1);
             ScenarioTestHelpers.DeletePool(controller, context, poolId2);
             ScenarioTestHelpers.DeletePool(controller, context, poolId3);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
        public void TestUpdateApplicationPackage()
        {
            string id = "updateApplicationPackage";

            BatchController controller = BatchController.NewInstance;
            BatchAccountContext context = null;
            controller.RunPsTestWorkflow(
                () =>
                {
                    return new string[]
                    {
                        string.Format(string.Format("Test-UpdateApplicationPackage '{0}' '{1}' '{2}'", id, version, filePath))
                    };
                },
                () =>
                {
                    context = new ScenarioTestContext();
                    ScenarioTestHelpers.CreateApplicationPackage(controller, context, id, version, filePath);
                },
                () =>
                {
                    ScenarioTestHelpers.DeleteApplicationPackage(controller, context, id, version);
                    ScenarioTestHelpers.DeleteApplication(controller, context, id);
                },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
 public void TestListJobSchedulesByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     string jobScheduleId1 = "testId1";
     string jobScheduleId2 = "testId2";
     string jobScheduleId3 = "thirdtestId";
     string jobSchedulePrefix = "testId";
     int matches = 2;
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListJobSchedulesByFilter '{0}' '{1}'", jobSchedulePrefix, matches) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId1, null);
             ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId2, null);
             ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId3, null);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId1);
             ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId2);
             ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId3);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
 public void TestListCertificatesByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string state = "active";
     string thumbprint1 = null;
     string toDeleteThumbprint = null;
     int matchCount = 1;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListCertificatesByFilter '{0}' '{1}' '{2}'", state, toDeleteThumbprint, matchCount) }; },
         () =>
         {
             context = new ScenarioTestContext();
             thumbprint1 = ScenarioTestHelpers.AddTestCertificate(controller, context, BatchTestHelpers.TestCertificateFileName1);
             toDeleteThumbprint = ScenarioTestHelpers.AddTestCertificate(controller, context, BatchTestHelpers.TestCertificateFileName2);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint1);
             // Other cert is deleted as the first part of the PowerShell test script, but we ensure it's gone.
             try
             {
                 ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, toDeleteThumbprint);
             }
             catch { }
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
 public void TestCancelCertificateDelete()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string thumbprint = null;
     string poolId = "certPool";
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-TestCancelCertificateDelete '{0}' '{1}'", BatchTestHelpers.TestCertificateAlgorithm, thumbprint) }; },
         () =>
         {
             context = new ScenarioTestContext();
             thumbprint = ScenarioTestHelpers.AddTestCertificate(controller, context, BatchTestHelpers.TestCertificateFileName);
             CertificateReference certRef = new CertificateReference();
             certRef.StoreLocation = CertStoreLocation.CurrentUser;
             certRef.StoreName = "My";
             certRef.ThumbprintAlgorithm = BatchTestHelpers.TestCertificateAlgorithm;
             certRef.Thumbprint = thumbprint;
             certRef.Visibility = CertificateVisibility.Task;
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId, 0, certRef);
             ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint);
             ScenarioTestHelpers.WaitForCertificateToFailDeletion(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint);
         },
         () =>
         {
             ScenarioTestHelpers.DeletePool(controller, context, poolId);
             ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
        /// <summary>
        /// Get Batch Context with keys
        /// </summary>
        public static BatchAccountContext GetBatchAccountContextWithKeys(BatchController controller, string accountName)
        {
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);
            BatchAccountContext context = client.ListKeys(null, accountName);

            ScenarioTestContext testContext = new ScenarioTestContext(context);

            return testContext;
        }
 public void TestGetAndListComputeNodesWithSelect()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string computeNodeId = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-GetAndListComputeNodesWithSelect '{0}' '{1}'", poolId, computeNodeId) }; },
         () =>
         {
             context = new ScenarioTestContext();
             computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
         },
         null,
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
 public void TestListComputeNodesByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string state = "idle";
     int matches = 0;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListComputeNodesByFilter '{0}' '{1}' '{2}'", poolId, state, matches) }; },
         () =>
         {
             context = new ScenarioTestContext();
             matches = ScenarioTestHelpers.GetPoolCurrentDedicated(controller, context, poolId);
         },
         null,
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 9
0
        private void TestReimageComputeNode(bool usePipeline, string testMethodName)
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ReimageComputeNode '{0}' '{1}' '{2}'", poolId, computeNodeId, usePipeline ? 1 : 0) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
                ScenarioTestHelpers.WaitForIdleComputeNode(controller, context, poolId, computeNodeId);
            },
                null,
                TestUtilities.GetCallingClass(),
                testMethodName);
        }
Exemplo n.º 10
0
        public void TestListNodeFileByComputeNodePipeline()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;
            int    count = 4; // shared, startup, workitems, applications

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ListNodeFileByComputeNodePipeline '{0}' '{1}' '{2}'", poolId, computeNodeId, count) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 11
0
        public void TestListNodeFilesByComputeNodeWithMaxCount()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;
            int    maxCount = 1;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ListNodeFilesByComputeNodeWithMaxCount '{0}' '{1}' '{2}'", poolId, computeNodeId, maxCount) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 12
0
        public void TestGetNodeFileByComputeNodeByName()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;
            string nodeFileName            = "startup\\stdout.txt";

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-GetNodeFileByComputeNodeByName '{0}' '{1}' '{2}'", poolId, computeNodeId, nodeFileName) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 13
0
        public void TestDeleteJob()
        {
            BatchController controller = BatchController.NewInstance;
            string          jobId      = "deleteJobTest";

            BatchAccountContext context = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DeleteJob '{0}' '0'", jobId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
        public void TestCreateComputeNodeUserPipeline()
        {
            BatchController controller = BatchController.NewInstance;
            BatchAccountContext context = null;
            string computeNodeId = null;
            string userName = "******";
            controller.RunPsTestWorkflow(
                () => { return new string[] { string.Format("Test-CreateComputeNodeUser '{0}' '{1}' '{2}' 1", poolId, computeNodeId, userName) }; },
                () =>
                {
                    context = new ScenarioTestContext();
                    computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
                },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());

        }
Exemplo n.º 15
0
        private void TestChangeOSVersion(bool usePipeline)
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string newTargetOSVersion      = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ChangeOSVersion '{0}' '{1}' '{2}'", testPoolId, newTargetOSVersion, usePipeline ? 1 : 0) }); },
                () =>
            {
                context = new ScenarioTestContext();
                string currentTargetOSVersion = ScenarioTestHelpers.WaitForOSVersionChange(controller, context, testPoolId);
                newTargetOSVersion            = currentTargetOSVersion == "*" ? specificOSVersion : "*";
            },
                null,
                TestUtilities.GetCallingClass(),
                usePipeline ? "TestChangeOSVersionPipeline" : "TestChangeOSVersionById");
        }
Exemplo n.º 16
0
        public void TestListComputeNodesByFilter()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string state   = "idle";
            int    matches = 0;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ListComputeNodesByFilter '{0}' '{1}' '{2}'", poolId, state, matches) }); },
                () =>
            {
                context = new ScenarioTestContext();
                matches = ScenarioTestHelpers.GetPoolCurrentDedicated(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 17
0
        public void TestDeletePoolPipeline()
        {
            BatchController controller = BatchController.NewInstance;
            string          poolId     = "testDeletePipe";

            BatchAccountContext context = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DeletePool '{0}' '1'", poolId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestPool(controller, context, poolId, 0);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 18
0
        public void TestDisableAutoScaleByPipeline()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DisableAutoScale '{0}' '1'", testPoolId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.WaitForSteadyPoolAllocation(controller, context, testPoolId);
                ScenarioTestHelpers.EnableAutoScale(controller, context, testPoolId);
                ScenarioTestHelpers.WaitForSteadyPoolAllocation(controller, context, testPoolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 19
0
        public void TestDisableAndEnableComputeNodeScheduling()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DisableAndEnableComputeNodeScheduling '{0}' '{1}'", poolId, computeNodeId) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
                ScenarioTestHelpers.WaitForIdleComputeNode(controller, context, poolId, computeNodeId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 20
0
        public void TestGetRemoteDesktopProtocolFile()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                _logger,
                () => { return(new string[] { string.Format("Test-GetRDPFile '{0}' '{1}'", poolId, computeNodeId) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
Exemplo n.º 21
0
        public void TestGetNodeFileContentByComputeNode()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                _logger,
                () => { return(new string[] { string.Format("Test-GetNodeFileContentByComputeNode '{0}' '{1}' '{2}' '{3}'", poolId, computeNodeId, startTaskStdOutName, startTaskStdOutContent) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
Exemplo n.º 22
0
        public void TestCreateComputeNodeUserPipeline()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;
            string userName = "******";

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-CreateComputeNodeUser '{0}' '{1}' '{2}' 1", poolId, computeNodeId, userName) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 23
0
        public void TestDisableAndEnableComputeNodeScheduling()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                _logger,
                () => { return(new string[] { string.Format("Test-DisableAndEnableComputeNodeScheduling '{0}' '{1}'", poolId, computeNodeId) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
                ScenarioTestHelpers.WaitForIdleComputeNode(controller, context, poolId, computeNodeId);
            },
                null,
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
Exemplo n.º 24
0
 public void TestCreateTaskCollection()
 {
     BatchController controller = BatchController.NewInstance;
     string jobId = "createTaskCollectionJob";
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-CreateTaskCollection '{0}'", jobId) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJob(controller, context, jobId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 25
0
 public void TestGetPoolById()
 {
     BatchController controller = BatchController.NewInstance;
     string poolId = "testGetPool";
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-GetPoolById '{0}'", poolId) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId, 0);
         },
         () =>
         {
             ScenarioTestHelpers.DeletePool(controller, context, poolId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 26
0
        public void TestListNodeFilesByComputeNodeRecursive()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;
            string startupFolder           = "startup";
            int    recursiveCount          = 5;// dir itself, ProcessEnv, stdout, stderr, wd

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ListNodeFilesByComputeNodeRecursive '{0}' '{1}' '{2}' '{3}'", poolId, computeNodeId, startupFolder, recursiveCount) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
 public void TestGetCertificateByThumbprint()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string thumbprint = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-GetCertificateByThumbprint '{0}' '{1}'", BatchTestHelpers.TestCertificateAlgorithm, thumbprint) }; },
         () =>
         {
             context = new ScenarioTestContext();
             thumbprint = ScenarioTestHelpers.AddTestCertificate(controller, context, BatchTestHelpers.TestCertificateFileName1);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
        public void TestDisableEnableTerminateJobSchedule()
        {
            BatchController controller = BatchController.NewInstance;
            string jobScheduleId = "testDisableEnableTerminateJobSchedule";

            BatchAccountContext context = null;
            controller.RunPsTestWorkflow(
                () => { return new string[] { string.Format("Test-DisableEnableTerminateJobSchedule '{0}'", jobScheduleId) }; },
                () =>
                {
                    context = new ScenarioTestContext();
                    ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null);
                },
                () =>
                {
                    ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId);
                },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 29
0
        public void TestChangeOSVersion()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string poolId = "changeospool";

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ChangeOSVersion '{0}' '{1}'", poolId, specificOSVersion) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestPool(controller, context, poolId, 0);
            },
                () =>
            {
                ScenarioTestHelpers.DeletePool(controller, context, poolId);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 30
0
        public void TestGetAndListCertificatesWithSelect()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string thumbprint = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-GetAndListCertificatesWithSelect '{0}' '{1}'", BatchTestHelpers.TestCertificateAlgorithm, thumbprint) }); },
                () =>
            {
                context    = new ScenarioTestContext();
                thumbprint = ScenarioTestHelpers.AddTestCertificate(controller, context, BatchTestHelpers.TestCertificateFileName1);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 31
0
        public void TestAutoScaleActions()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string poolId = "autoscalePool";

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-AutoScaleActions '{0}'", poolId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestPool(controller, context, poolId, targetDedicated: 0, targetLowPriority: 0);
            },
                () =>
            {
                ScenarioTestHelpers.DeletePool(controller, context, poolId);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 32
0
        public void TestGetAndListJobSchedulesWithSelect()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string jobScheduleId           = "selectTest";

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-GetAndListJobSchedulesWithSelect '{0}'", jobScheduleId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 33
0
        public void TestCreateTaskCollection()
        {
            BatchController     controller = BatchController.NewInstance;
            string              jobId      = "createTaskCollectionJob";
            BatchAccountContext context    = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-CreateTaskCollection '{0}'", jobId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJob(controller, context, jobId);
            },
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
Exemplo n.º 34
0
        public void TestChangeOSVersion()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string poolId = "changeospool";

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ChangeOSVersion '{0}' '{1}'", poolId, specificOSVersion) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestPool(controller, context, poolId, targetDedicated: 0, targetLowPriority: 0);
            },
                () =>
            {
                ScenarioTestHelpers.DeletePool(controller, context, poolId);
            },
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
Exemplo n.º 35
0
        private void TestTerminateJobSchedule(bool usePipeline)
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string jobScheduleId           = "testTerminateJobSchedule" + (usePipeline ? "Pipeline" : "Id");

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-TerminateJobSchedule '{0}' '{1}'", jobScheduleId, usePipeline ? 1 : 0) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId);
            },
                TestUtilities.GetCallingClass(),
                usePipeline ? "TestTerminateJobSchedulePipeline" : "TestTerminateJobScheduleById");
        }
Exemplo n.º 36
0
        public void TestAutoScaleActions()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string poolId = "autoscalePool";

            controller.RunPsTestWorkflow(
                _logger,
                () => { return(new string[] { string.Format("Test-AutoScaleActions '{0}'", poolId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestPool(controller, context, poolId, targetDedicated: 0, targetLowPriority: 0);
            },
                () =>
            {
                ScenarioTestHelpers.DeletePool(controller, context, poolId);
            },
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
Exemplo n.º 37
0
        public void TestDisableEnableTerminateJobSchedule()
        {
            BatchController controller    = BatchController.NewInstance;
            string          jobScheduleId = "testDisableEnableTerminateJobSchedule";

            BatchAccountContext context = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DisableEnableTerminateJobSchedule '{0}'", jobScheduleId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId);
            },
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
Exemplo n.º 38
0
        public void TestRemoveComputeNodes()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string removeNodePoolId        = "removenodepool";

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-RemoveComputeNodes '{0}'", removeNodePoolId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestPool(controller, context, removeNodePoolId, targetDedicated: 2, targetLowPriority: 0);
                ScenarioTestHelpers.WaitForSteadyPoolAllocation(controller, context, removeNodePoolId);
            },
                () =>
            {
                ScenarioTestHelpers.DeletePool(controller, context, removeNodePoolId);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 39
0
        public void IfJobSetsAutoFailure_ItCompletesWhenAnyTaskFails()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string     jobId        = "testJobCompletesWhenTaskFails";
            string     taskId       = "taskId-1";
            PSCloudJob completedJob = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("IfJobSetsAutoFailure-ItCompletesWhenAnyTaskFails '{0}' '{1}'", jobId, taskId) }); },
                null,
                () =>
            {
                context      = new ScenarioTestContext();
                completedJob = ScenarioTestHelpers.WaitForJobCompletion(controller, context, jobId, taskId);
                AssertJobIsCompleteDueToTaskFailure(completedJob);
                ScenarioTestHelpers.DeleteJob(controller, context, jobId);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 40
0
        public void TestRebootAndReimageComputeNode()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;
            string computeNodeId2          = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-RebootAndReimageComputeNode '{0}' '{1}' '{2}'", poolId, computeNodeId, computeNodeId2) }); },
                () =>
            {
                context        = new ScenarioTestContext();
                computeNodeId  = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId, 0);
                computeNodeId2 = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId, 1);
                ScenarioTestHelpers.WaitForIdleComputeNode(controller, context, poolId, computeNodeId);
                ScenarioTestHelpers.WaitForIdleComputeNode(controller, context, poolId, computeNodeId2);
            },
                null,
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
Exemplo n.º 41
0
        public void TestGetTaskById()
        {
            BatchController     controller = BatchController.NewInstance;
            string              jobId      = "getTaskJob";
            string              taskId     = "testTask";
            BatchAccountContext context    = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-GetTaskById '{0}' '{1}'", jobId, taskId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
                ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJob(controller, context, jobId);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Exemplo n.º 42
0
 public void TestGetNodeFileByTaskByName()
 {
     BatchController controller = BatchController.NewInstance;
     string jobId = "testGetNodeFileByTaskJob";
     string taskId = "testTask";
     string nodeFileName = "stdout.txt";
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-GetNodeFileByTaskByName '{0}' '{1}' '{2}'", jobId, taskId, nodeFileName) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
             ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId);
             ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJob(controller, context, jobId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 43
0
        public void IfJobSetsAutoFailure_ItCompletesWhenAnyTaskFails()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string     poolId       = "testPool";
            string     jobId        = "testJobCompletesWhenTaskFails";
            string     taskId       = "taskId-1";
            PSCloudJob completedJob = null;

            controller.RunPsTestWorkflow(
                _logger,
                () => { return(new string[] { string.Format("IfJobSetsAutoFailure-ItCompletesWhenAnyTaskFails '{0}' '{1}' '{2}'", poolId, jobId, taskId) }); },
                null,
                () =>
            {
                context      = new ScenarioTestContext();
                completedJob = ScenarioTestHelpers.WaitForJobCompletion(controller, context, jobId, taskId);
                AssertJobIsCompleteDueToTaskFailure(completedJob);
                ScenarioTestHelpers.DeleteJob(controller, context, jobId);
            },
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
Exemplo n.º 44
0
 public void TestListNodeFilesByTaskByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     string jobId = "listNodeFileByTaskFilterJob";
     string taskId = "testTask";
     string nodeFilePrefix = "std";
     int matches = 2;
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListNodeFilesByTaskByFilter '{0}' '{1}' '{2}' '{3}'", jobId, taskId, nodeFilePrefix, matches) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
             ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId);
             ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJob(controller, context, jobId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 45
0
 public void TestListNodeFilesByTaskRecursive()
 {
     BatchController controller = BatchController.NewInstance;
     string jobId = "listNodeFileByTaskRecursiveJob";
     string taskId = "testTask";
     string newFile = "testFile.txt";
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListNodeFilesByTaskRecursive '{0}' '{1}' '{2}'", jobId, taskId, newFile) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
             ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId, string.Format("cmd /c echo \"test file\" > {0}", newFile));
             ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJob(controller, context, jobId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 46
0
 public void TestListNodeFileByComputeNodePipeline()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string computeNodeId = null;
     int count = 4; // shared, startup, workitems, applications
     controller.RunPsTestWorkflow(
     () => { return new string[] { string.Format("Test-ListNodeFileByComputeNodePipeline '{0}' '{1}' '{2}'", poolId, computeNodeId, count) }; },
     () =>
     {
         context = new ScenarioTestContext();
         computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
     },
     null,
     TestUtilities.GetCallingClass(),
     TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 47
0
 public void TestListPoolsWithMaxCount()
 {
     BatchController controller = BatchController.NewInstance;
     string poolId1 = "testMaxCount1";
     string poolId2 = "testMaxCount2";
     string poolId3 = "thirdMaxCount";
     int maxCount = 1;
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListPoolsWithMaxCount '{0}'", maxCount) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId1, 0);
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId2, 0);
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId3, 0);
         },
         () =>
         {
             ScenarioTestHelpers.DeletePool(controller, context, poolId1);
             ScenarioTestHelpers.DeletePool(controller, context, poolId2);
             ScenarioTestHelpers.DeletePool(controller, context, poolId3);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 48
0
 public void TestGetNodeFileContentByComputeNodeByPipeline()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string computeNodeId = null;
     controller.RunPsTestWorkflow(
     () => { return new string[] { string.Format("Test-GetNodeFileContentByComputeNodePipeline '{0}' '{1}' '{2}' '{3}'", poolId, computeNodeId, startTaskStdOutName, startTaskStdOutContent) }; },
     () =>
     {
         context = new ScenarioTestContext();
         computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
     },
     null,
     TestUtilities.GetCallingClass(),
     TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 49
0
 private void TestChangeOSVersion(bool usePipeline)
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string newTargetOSVersion = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ChangeOSVersion '{0}' '{1}' '{2}'", testPoolId, newTargetOSVersion, usePipeline ? 1 : 0) }; },
         () =>
         {
             context = new ScenarioTestContext();
             string currentTargetOSVersion = ScenarioTestHelpers.WaitForOSVersionChange(controller, context, testPoolId);
             newTargetOSVersion = currentTargetOSVersion == "*" ? specificOSVersion : "*";
         },
         null,
         TestUtilities.GetCallingClass(),
         usePipeline ? "TestChangeOSVersionPipeline" : "TestChangeOSVersionById");
 }
 private void TestDisableAndEnableComputeNodeScheduling(bool usePipeline, string testMethodName)
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string computeNodeId = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-DisableAndEnableComputeNodeScheduling '{0}' '{1}' '{2}'", poolId, computeNodeId, usePipeline ? 1 : 0) }; },
         () =>
         {
             context = new ScenarioTestContext();
             computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
             ScenarioTestHelpers.WaitForIdleComputeNode(controller, context, poolId, computeNodeId);
         },
         null,
         TestUtilities.GetCallingClass(),
         testMethodName);
 }
Exemplo n.º 51
0
 public void TestEvaluateAutoScaleByPipeline()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-EvaluateAutoScale '{0}' '1'", testPoolId) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.EnableAutoScale(controller, context, testPoolId);
             ScenarioTestHelpers.WaitForSteadyPoolAllocation(controller, context, testPoolId);
         },
         () =>
         {
             ScenarioTestHelpers.DisableAutoScale(controller, context, testPoolId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 52
0
 public void TestListNodeFilesByComputeNodeRecursive()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string computeNodeId = null;
     string startupFolder = "startup";
     int recursiveCount = 5; // dir itself, ProcessEnv, stdout, stderr, wd
     controller.RunPsTestWorkflow(
     () => { return new string[] { string.Format("Test-ListNodeFilesByComputeNodeRecursive '{0}' '{1}' '{2}' '{3}'", poolId, computeNodeId, startupFolder, recursiveCount) }; },
     () =>
     {
         context = new ScenarioTestContext();
         computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
     },
     null,
     TestUtilities.GetCallingClass(),
     TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 53
0
 public void TestListNodeFileByTaskPipeline()
 {
     BatchController controller = BatchController.NewInstance;
     string jobId = "nodeFileByTaskPipe";
     string taskId = "testTask";
     int count = 4; // ProcessEnv, stdout, stderr, wd
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListNodeFileByTaskPipeline '{0}' '{1}' '{2}'", jobId, taskId, count) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
             ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId);
             ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJob(controller, context, jobId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 54
0
 private void TestDeleteNodeFileByComputeNode(bool usePipeline, string testMethodName)
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string jobId = string.Format("deleteNodeByFileComputeNodeBy{0}", usePipeline ? "Pipeline" : "Name");
     string taskId = "task1";
     string computeNodeId = null;
     string fileName = "testFile.txt";
     string filePath = string.Format("workitems\\{0}\\job-1\\{1}\\wd\\{2}", jobId, taskId, fileName);
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-DeleteNodeFileByComputeNode '{0}' '{1}' '{2}' '{3}'", poolId, computeNodeId, filePath, usePipeline ? "1" : "0") }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
             ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId, string.Format("cmd /c echo \"test\" > {0}", fileName));
             ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId);
             computeNodeId = ScenarioTestHelpers.GetTaskComputeNodeId(controller, context, jobId, taskId);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJob(controller, context, jobId);
         },
         TestUtilities.GetCallingClass(),
         testMethodName);
 }
        private void TestGetComputeNodeRemoteLoginSettings(bool usePipeline, string testMethodName)
        {
            BatchController controller = BatchController.NewInstance;
            BatchAccountContext context = null;
            string computeNodeId = null;

            controller.RunPsTestWorkflow(
                () => { return new string[] { string.Format("Test-GetRemoteLoginSettings '{0}' '{1}' '{2}'", iaasPoolId, computeNodeId, usePipeline ? 1 : 0) }; },
                () =>
                {
                    context = new ScenarioTestContext();
                    computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, iaasPoolId);
                },
                null,
                TestUtilities.GetCallingClass(),
                testMethodName);
        }
Exemplo n.º 56
0
 public void TestGetNodeFileByComputeNodeByName()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string computeNodeId = null;
     string nodeFileName = "startup\\stdout.txt";
     controller.RunPsTestWorkflow(
     () => { return new string[] { string.Format("Test-GetNodeFileByComputeNodeByName '{0}' '{1}' '{2}'", poolId, computeNodeId, nodeFileName) }; },
     () =>
     {
         context = new ScenarioTestContext();
         computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
     },
     null,
     TestUtilities.GetCallingClass(),
     TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 57
0
 public void TestGetNodeFileContentByTaskPipeline()
 {
     BatchController controller = BatchController.NewInstance;
     string jobId = "nodeFileContentByTaskPipe";
     string taskId = "testTask";
     string fileName = "testFile.txt";
     string nodeFileName = string.Format("wd\\{0}", fileName);
     string fileContents = "test file contents";
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-GetNodeFileContentByTaskPipeline '{0}' '{1}' '{2}' '{3}'", jobId, taskId, nodeFileName, fileContents) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
             ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId, string.Format("cmd /c echo {0} > {1}", fileContents, fileName));
             ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJob(controller, context, jobId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 58
0
 public void TestListAllPools()
 {
     BatchController controller = BatchController.NewInstance;
     string poolId1 = "testList1";
     string poolId2 = "testList2";
     string poolId3 = "thirdTestList";
     int beforeAddCount = 0;
     int afterAddCount = 0;
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListAllPools '{0}'", afterAddCount) }; },
         () =>
         {
             context = new ScenarioTestContext();
             beforeAddCount = ScenarioTestHelpers.GetPoolCount(controller, context);
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId1, 0);
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId2, 0);
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId3, 0);
             afterAddCount = beforeAddCount + 3;
         },
         () =>
         {
             ScenarioTestHelpers.DeletePool(controller, context, poolId1);
             ScenarioTestHelpers.DeletePool(controller, context, poolId2);
             ScenarioTestHelpers.DeletePool(controller, context, poolId3);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 59
0
 public void TestStopResizePoolById()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-StopResizePoolById '{0}'", testPoolId) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.WaitForSteadyPoolAllocation(controller, context, testPoolId);
         },
         null,
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
Exemplo n.º 60
0
 public void TestListNodeFilesByComputeNodeByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string computeNodeId = null;
     string nodeFilePrefix = "s";
     int matches = 2;
     controller.RunPsTestWorkflow(
     () => { return new string[] { string.Format("Test-ListNodeFilesByComputeNodeByFilter '{0}' '{1}' '{2}' '{3}'", poolId, computeNodeId, nodeFilePrefix, matches) }; },
     () =>
     {
         context = new ScenarioTestContext();
         computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
     },
     null,
     TestUtilities.GetCallingClass(),
     TestUtilities.GetCurrentMethodName());
 }