C# Class Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestHelpers

Helper methods for the Batch cmdlet scenario tests
Mostrar archivo Open project: Azure/azure-powershell Class Usage Examples

Public Methods

Method Description
AddTestCertificate ( BatchController controller, BatchAccountContext context, string filePath ) : string

Adds a test certificate for use in Scenario tests. Returns the thumbprint of the cert.

CleanupTestAccount ( BatchController controller, string resourceGroupName, string accountName ) : void

Cleans up an account and resource group used in a Scenario test.

CreateApplicationPackage ( BatchController controller, BatchAccountContext context, string applicationId, string version, string filePath ) : Microsoft.Azure.Management.Batch.Models.ApplicationPackage

Uploads an application package to Storage

CreateComputeNodeUser ( BatchController controller, BatchAccountContext context, string poolId, string computeNodeId, string computeNodeUserName ) : void

Creates a compute node user for use in Scenario tests.

CreateMpiPoolIfNotExists ( BatchController controller, BatchAccountContext context, int targetDedicated = 3 ) : void

Creates an MPI pool.

CreateTestAccountAndResourceGroup ( BatchController controller, string resourceGroupName, string accountName, string location ) : BatchAccountContext

Creates an account and resource group for use with the Scenario tests

CreateTestJob ( BatchController controller, BatchAccountContext context, string jobId, string poolId = SharedPool ) : void

Creates a test job for use in Scenario tests.

CreateTestJobSchedule ( BatchController controller, BatchAccountContext context, string jobScheduleId, System.TimeSpan recurrenceInterval ) : void

Creates a test job schedule for use in Scenario tests.

CreateTestPool ( BatchController controller, BatchAccountContext context, string poolId, int targetDedicated, CertificateReference certReference = null, StartTask startTask = null ) : void

Creates a test pool for use in Scenario tests.

CreateTestTask ( BatchController controller, BatchAccountContext context, string jobId, string taskId, string cmdLine = "cmd /c dir /s", int numInstances ) : void

Creates a test task for use in Scenario tests.

DeleteApplication ( BatchController controller, BatchAccountContext context, string applicationId ) : void

Deletes an application used in a Scenario test.

DeleteApplicationPackage ( BatchController controller, BatchAccountContext context, string applicationId, string version ) : void

Deletes an application package used in a Scenario test.

DeleteComputeNodeUser ( BatchController controller, BatchAccountContext context, string poolId, string computeNodeId, string computeNodeUserName ) : void

Deletes a compute node user for use in Scenario tests.

DeleteJob ( BatchController controller, BatchAccountContext context, string jobId ) : void

Deletes a job used in a Scenario test.

DeleteJobSchedule ( BatchController controller, BatchAccountContext context, string jobScheduleId ) : void

Deletes a job schedule used in a Scenario test.

DeletePool ( BatchController controller, BatchAccountContext context, string poolId ) : void

Deletes a pool used in a Scenario test.

DeleteTestCertificate ( BatchController controller, BatchAccountContext context, string thumbprintAlgorithm, string thumbprint ) : void

Deletes a certificate.

DisableAutoScale ( BatchController controller, BatchAccountContext context, string poolId ) : void
EnableAutoScale ( BatchController controller, BatchAccountContext context, string poolId ) : void
GetComputeNodeId ( BatchController controller, BatchAccountContext context, string poolId, int index ) : string

Gets the id of a compute node in the specified pool

GetPoolCount ( BatchController controller, BatchAccountContext context ) : int

Gets the number of pools under the specified account

GetPoolCurrentDedicated ( BatchController controller, BatchAccountContext context, string poolId ) : int

Gets the CurrentDedicated count from a pool

GetTaskComputeNodeId ( BatchController controller, BatchAccountContext context, string jobId, string taskId ) : string

Gets the id of the compute node that the specified task completed on. Returns null if the task isn't complete.

ResizePool ( BatchController controller, BatchAccountContext context, string poolId, int targetDedicated ) : void
TerminateJob ( BatchController controller, BatchAccountContext context, string jobId ) : void

Terminates a job

WaitForCertificateToFailDeletion ( BatchController controller, BatchAccountContext context, string thumbprintAlgorithm, string thumbprint ) : void

Deletes a certificate.

WaitForIdleComputeNode ( BatchController controller, BatchAccountContext context, string poolId, string computeNodeId ) : void

Waits for a compute node to get to the idle state

WaitForJobCompletion ( BatchController controller, BatchAccountContext context, string jobId, string taskId ) : PSCloudJob

Waits for the job to complete

WaitForOSVersionChange ( BatchController controller, BatchAccountContext context, string poolId ) : string
WaitForRecentJob ( BatchController controller, BatchAccountContext context, string jobScheduleId, string previousJob = null ) : string

Waits for a recent job on a job schedule and returns its id. If a previous job is specified, this method waits until a new job is created.

WaitForSteadyPoolAllocation ( BatchController controller, BatchAccountContext context, string poolId ) : void
WaitForTaskCompletion ( BatchController controller, BatchAccountContext context, string jobId, string taskId ) : void

Waits for the specified task to complete

Private Methods

Method Description
Sleep ( int milliseconds ) : void

Sleep method used for Scenario Tests. Only sleep when recording.

Method Details

AddTestCertificate() public static method

Adds a test certificate for use in Scenario tests. Returns the thumbprint of the cert.
public static AddTestCertificate ( BatchController controller, BatchAccountContext context, string filePath ) : string
controller BatchController
context BatchAccountContext
filePath string
return string

CleanupTestAccount() public static method

Cleans up an account and resource group used in a Scenario test.
public static CleanupTestAccount ( BatchController controller, string resourceGroupName, string accountName ) : void
controller BatchController
resourceGroupName string
accountName string
return void

CreateApplicationPackage() public static method

Uploads an application package to Storage
public static CreateApplicationPackage ( BatchController controller, BatchAccountContext context, string applicationId, string version, string filePath ) : Microsoft.Azure.Management.Batch.Models.ApplicationPackage
controller BatchController
context BatchAccountContext
applicationId string
version string
filePath string
return Microsoft.Azure.Management.Batch.Models.ApplicationPackage

CreateComputeNodeUser() public static method

Creates a compute node user for use in Scenario tests.
public static CreateComputeNodeUser ( BatchController controller, BatchAccountContext context, string poolId, string computeNodeId, string computeNodeUserName ) : void
controller BatchController
context BatchAccountContext
poolId string
computeNodeId string
computeNodeUserName string
return void

CreateMpiPoolIfNotExists() public static method

Creates an MPI pool.
public static CreateMpiPoolIfNotExists ( BatchController controller, BatchAccountContext context, int targetDedicated = 3 ) : void
controller BatchController
context BatchAccountContext
targetDedicated int
return void

CreateTestAccountAndResourceGroup() public static method

Creates an account and resource group for use with the Scenario tests
public static CreateTestAccountAndResourceGroup ( BatchController controller, string resourceGroupName, string accountName, string location ) : BatchAccountContext
controller BatchController
resourceGroupName string
accountName string
location string
return BatchAccountContext

CreateTestJob() public static method

Creates a test job for use in Scenario tests.
public static CreateTestJob ( BatchController controller, BatchAccountContext context, string jobId, string poolId = SharedPool ) : void
controller BatchController
context BatchAccountContext
jobId string
poolId string
return void

CreateTestJobSchedule() public static method

Creates a test job schedule for use in Scenario tests.
public static CreateTestJobSchedule ( BatchController controller, BatchAccountContext context, string jobScheduleId, System.TimeSpan recurrenceInterval ) : void
controller BatchController
context BatchAccountContext
jobScheduleId string
recurrenceInterval System.TimeSpan
return void

CreateTestPool() public static method

Creates a test pool for use in Scenario tests.
public static CreateTestPool ( BatchController controller, BatchAccountContext context, string poolId, int targetDedicated, CertificateReference certReference = null, StartTask startTask = null ) : void
controller BatchController
context BatchAccountContext
poolId string
targetDedicated int
certReference CertificateReference
startTask StartTask
return void

CreateTestTask() public static method

Creates a test task for use in Scenario tests.
public static CreateTestTask ( BatchController controller, BatchAccountContext context, string jobId, string taskId, string cmdLine = "cmd /c dir /s", int numInstances ) : void
controller BatchController
context BatchAccountContext
jobId string
taskId string
cmdLine string
numInstances int
return void

DeleteApplication() public static method

Deletes an application used in a Scenario test.
public static DeleteApplication ( BatchController controller, BatchAccountContext context, string applicationId ) : void
controller BatchController
context BatchAccountContext
applicationId string
return void

DeleteApplicationPackage() public static method

Deletes an application package used in a Scenario test.
public static DeleteApplicationPackage ( BatchController controller, BatchAccountContext context, string applicationId, string version ) : void
controller BatchController
context BatchAccountContext
applicationId string
version string
return void

DeleteComputeNodeUser() public static method

Deletes a compute node user for use in Scenario tests.
public static DeleteComputeNodeUser ( BatchController controller, BatchAccountContext context, string poolId, string computeNodeId, string computeNodeUserName ) : void
controller BatchController
context BatchAccountContext
poolId string
computeNodeId string
computeNodeUserName string
return void

DeleteJob() public static method

Deletes a job used in a Scenario test.
public static DeleteJob ( BatchController controller, BatchAccountContext context, string jobId ) : void
controller BatchController
context BatchAccountContext
jobId string
return void

DeleteJobSchedule() public static method

Deletes a job schedule used in a Scenario test.
public static DeleteJobSchedule ( BatchController controller, BatchAccountContext context, string jobScheduleId ) : void
controller BatchController
context BatchAccountContext
jobScheduleId string
return void

DeletePool() public static method

Deletes a pool used in a Scenario test.
public static DeletePool ( BatchController controller, BatchAccountContext context, string poolId ) : void
controller BatchController
context BatchAccountContext
poolId string
return void

DeleteTestCertificate() public static method

Deletes a certificate.
public static DeleteTestCertificate ( BatchController controller, BatchAccountContext context, string thumbprintAlgorithm, string thumbprint ) : void
controller BatchController
context BatchAccountContext
thumbprintAlgorithm string
thumbprint string
return void

DisableAutoScale() public static method

public static DisableAutoScale ( BatchController controller, BatchAccountContext context, string poolId ) : void
controller BatchController
context BatchAccountContext
poolId string
return void

EnableAutoScale() public static method

public static EnableAutoScale ( BatchController controller, BatchAccountContext context, string poolId ) : void
controller BatchController
context BatchAccountContext
poolId string
return void

GetComputeNodeId() public static method

Gets the id of a compute node in the specified pool
public static GetComputeNodeId ( BatchController controller, BatchAccountContext context, string poolId, int index ) : string
controller BatchController
context BatchAccountContext
poolId string
index int
return string

GetPoolCount() public static method

Gets the number of pools under the specified account
public static GetPoolCount ( BatchController controller, BatchAccountContext context ) : int
controller BatchController
context BatchAccountContext
return int

GetPoolCurrentDedicated() public static method

Gets the CurrentDedicated count from a pool
public static GetPoolCurrentDedicated ( BatchController controller, BatchAccountContext context, string poolId ) : int
controller BatchController
context BatchAccountContext
poolId string
return int

GetTaskComputeNodeId() public static method

Gets the id of the compute node that the specified task completed on. Returns null if the task isn't complete.
public static GetTaskComputeNodeId ( BatchController controller, BatchAccountContext context, string jobId, string taskId ) : string
controller BatchController
context BatchAccountContext
jobId string
taskId string
return string

ResizePool() public static method

public static ResizePool ( BatchController controller, BatchAccountContext context, string poolId, int targetDedicated ) : void
controller BatchController
context BatchAccountContext
poolId string
targetDedicated int
return void

TerminateJob() public static method

Terminates a job
public static TerminateJob ( BatchController controller, BatchAccountContext context, string jobId ) : void
controller BatchController
context BatchAccountContext
jobId string
return void

WaitForCertificateToFailDeletion() public static method

Deletes a certificate.
public static WaitForCertificateToFailDeletion ( BatchController controller, BatchAccountContext context, string thumbprintAlgorithm, string thumbprint ) : void
controller BatchController
context BatchAccountContext
thumbprintAlgorithm string
thumbprint string
return void

WaitForIdleComputeNode() public static method

Waits for a compute node to get to the idle state
public static WaitForIdleComputeNode ( BatchController controller, BatchAccountContext context, string poolId, string computeNodeId ) : void
controller BatchController
context BatchAccountContext
poolId string
computeNodeId string
return void

WaitForJobCompletion() public static method

Waits for the job to complete
public static WaitForJobCompletion ( BatchController controller, BatchAccountContext context, string jobId, string taskId ) : PSCloudJob
controller BatchController
context BatchAccountContext
jobId string
taskId string
return PSCloudJob

WaitForOSVersionChange() public static method

public static WaitForOSVersionChange ( BatchController controller, BatchAccountContext context, string poolId ) : string
controller BatchController
context BatchAccountContext
poolId string
return string

WaitForRecentJob() public static method

Waits for a recent job on a job schedule and returns its id. If a previous job is specified, this method waits until a new job is created.
public static WaitForRecentJob ( BatchController controller, BatchAccountContext context, string jobScheduleId, string previousJob = null ) : string
controller BatchController
context BatchAccountContext
jobScheduleId string
previousJob string
return string

WaitForSteadyPoolAllocation() public static method

public static WaitForSteadyPoolAllocation ( BatchController controller, BatchAccountContext context, string poolId ) : void
controller BatchController
context BatchAccountContext
poolId string
return void

WaitForTaskCompletion() public static method

Waits for the specified task to complete
public static WaitForTaskCompletion ( BatchController controller, BatchAccountContext context, string jobId, string taskId ) : void
controller BatchController
context BatchAccountContext
jobId string
taskId string
return void