RunPsTestWorkflow() public method

public RunPsTestWorkflow ( Func scriptBuilder, System.Action initialize, System.Action cleanup, string callingClassType, string mockName ) : void
scriptBuilder Func
initialize System.Action
cleanup System.Action
callingClassType string
mockName string
return void
        public void TestResizePoolByPipeline()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ResizePoolByPipeline '{0}' '{1}'", commonAccountName, testPoolId) }); },
                () =>
            {
                context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, commonAccountName);
                ScenarioTestHelpers.WaitForSteadyPoolAllocation(controller, context, testPoolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Beispiel #2
0
        public void TestCreateUserPipeline()
        {
            BatchController controller = BatchController.NewInstance;
            string          userName   = "******";

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-CreateUser '{0}' '{1}' '{2}' '{3}' 1", accountName, poolName, vmName, userName) }); },
                null,
                () =>
            {
                BatchAccountContext context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                ScenarioTestHelpers.DeleteUser(controller, context, poolName, vmName, userName);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Beispiel #3
0
        public void TestGetRemoteDesktopProtocolFilePipeline()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-GetRDPFilePipeline '{0}' '{1}'", poolId, computeNodeId) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
        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}' '{4}'", accountName, poolId, computeNodeId, startTaskStdOutName, startTaskStdOutContent) }); },
                () =>
            {
                context       = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Beispiel #5
0
        public void TestGetAndListComputeNodesWithSelect()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-GetAndListComputeNodesWithSelect '{0}' '{1}' '{2}'", accountName, poolId, computeNodeId) }); },
                () =>
            {
                context       = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Beispiel #6
0
        public void TestListAllComputeNodes()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            int computeNodeCount           = 0;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ListAllComputeNodes '{0}' '{1}' '{2}'", accountName, poolId, computeNodeCount) }); },
                () =>
            {
                context          = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                computeNodeCount = ScenarioTestHelpers.GetPoolCurrentDedicated(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
        public void TestDeleteCertificate()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string thumbprint = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DeleteCertificate '{0}' '{1}' '{2}'", accountName, BatchTestHelpers.TestCertificateAlgorithm, thumbprint) }); },
                () =>
            {
                context    = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                thumbprint = ScenarioTestHelpers.AddTestCertificate(controller, context, BatchTestHelpers.TestCertificateFileName1);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
        public void TestGetComputeNodeRemoteLoginSettings()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-GetRemoteLoginSettings '{0}' '{1}'", iaasPoolId, computeNodeId) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, iaasPoolId);
            },
                null,
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
Beispiel #9
0
        public void TestGetNodeFileContentByComputeNode()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                () => { 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);
        }
Beispiel #10
0
        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);
        }
        public void TestComputeNodeUserEndToEnd()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                _logger,
                () => { return(new string[] { string.Format("Test-ComputeNodeUserEndToEnd '{0}' '{1}'", poolId, computeNodeId) }); },
                () =>
            {
                context       = new ScenarioTestContext();
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }
        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());
        }
        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());
        }
Beispiel #14
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());
        }
        private void TestReimageComputeNode(bool usePipeline)
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ReimageComputeNode '{0}' '{1}' '{2}' '{3}'", accountName, poolId, computeNodeId, usePipeline ? 1 : 0) }); },
                () =>
            {
                context       = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
                ScenarioTestHelpers.WaitForIdleComputeNode(controller, context, poolId, computeNodeId);
            },
                null,
                TestUtilities.GetCallingClass(),
                usePipeline ? "TestReimageComputeNodePipeline" : "TestReimageComputeNodeById");
        }
        public void TestDeleteWorkItemPipeline()
        {
            BatchController controller   = BatchController.NewInstance;
            string          workItemName = "testWorkItem";

            BatchAccountContext context = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DeleteWorkItem '{0}' '{1}' '1'", accountName, workItemName) }); },
                () =>
            {
                context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                ScenarioTestHelpers.CreateTestWorkItem(controller, context, workItemName);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Beispiel #17
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());
        }
Beispiel #18
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());
        }
        public void TestListAllNodeFilesByComputeNode()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;
            int    count = 3; // shared, startup, workitems

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ListAllNodeFilesByComputeNode '{0}' '{1}' '{2}' '{3}'", accountName, poolId, computeNodeId, count) }); },
                () =>
            {
                context       = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Beispiel #20
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());
        }
Beispiel #21
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());
        }
Beispiel #22
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}' '1'", commonAccountName, poolId) }); },
                () =>
            {
                context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, commonAccountName);
                ScenarioTestHelpers.CreateTestPool(controller, context, poolId, 0);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Beispiel #23
0
        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}' '{3}'", ScenarioTestHelpers.MpiOnlineAccount, poolId, computeNodeId, usePipeline ? 1 : 0) }); },
                () =>
            {
                context       = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, ScenarioTestHelpers.MpiOnlineAccount);
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
                ScenarioTestHelpers.WaitForIdleComputeNode(controller, context, poolId, computeNodeId);
            },
                null,
                TestUtilities.GetCallingClass(),
                testMethodName);
        }
        public void TestDeleteJobSchedulePipeline()
        {
            BatchController controller    = BatchController.NewInstance;
            string          jobScheduleId = "testDeleteJobSchedulePipe";

            BatchAccountContext context = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DeleteJobSchedule '{0}' '1'", jobScheduleId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Beispiel #25
0
        public void TestDeleteJob()
        {
            BatchController controller = BatchController.NewInstance;
            string          jobId      = "deleteJobTest";

            BatchAccountContext context = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DeleteJob '{0}' '{1}' '0'", accountName, jobId) }); },
                () =>
            {
                context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Beispiel #26
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}' '{3}'", commonAccountName, testPoolId, newTargetOSVersion, usePipeline ? 1 : 0) }); },
                () =>
            {
                context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, commonAccountName);
                string currentTargetOSVersion = ScenarioTestHelpers.WaitForOSVersionChange(controller, context, testPoolId);
                newTargetOSVersion            = currentTargetOSVersion == "*" ? specificOSVersion : "*";
            },
                null,
                TestUtilities.GetCallingClass(),
                usePipeline ? "TestChangeOSVersionPipeline" : "TestChangeOSVersionById");
        }
Beispiel #27
0
        public void TestDeleteComputeNodeUser()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string computeNodeId           = null;
            string userName = "******";

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DeleteComputeNodeUser '{0}' '{1}' '{2}' '{3}'", accountName, poolId, computeNodeId, userName) }); },
                () =>
            {
                context       = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
                ScenarioTestHelpers.CreateComputeNodeUser(controller, context, poolId, computeNodeId, userName);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
        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}' '{4}'", accountName, poolId, computeNodeId, nodeFilePrefix, matches) }); },
                () =>
            {
                context       = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
        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}' '{4}'", accountName, poolId, computeNodeId, startupFolder, recursiveCount) }); },
                () =>
            {
                context       = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
            },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
Beispiel #30
0
        public void TestEvaluateAutoScaleById()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-EvaluateAutoScale '{0}' '{1}' '0'", commonAccountName, testPoolId) }); },
                () =>
            {
                context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, commonAccountName);
                ScenarioTestHelpers.EnableAutoScale(controller, context, testPoolId);
                ScenarioTestHelpers.WaitForSteadyPoolAllocation(controller, context, testPoolId);
            },
                () =>
            {
                ScenarioTestHelpers.DisableAutoScale(controller, context, testPoolId);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }