diff --git a/nodeSDK.njsproj b/nodeSDK.njsproj
index 1d2958cac..8f77b9d41 100644
--- a/nodeSDK.njsproj
+++ b/nodeSDK.njsproj
@@ -104,195 +104,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/test/services/batch/batchClient-tests.js b/test/services/batch/batchClient-tests.js
index 84d470440..8c7b65391 100644
--- a/test/services/batch/batchClient-tests.js
+++ b/test/services/batch/batchClient-tests.js
@@ -14,7 +14,6 @@
// limitations under the License.
//
-
var should = require('should');
var util = require('util');
var fs = require('fs');
@@ -155,7 +154,7 @@ describe('Batch Service', function () {
});
it('should update pool target OS version successfully', function (done) {
- client.pool.upgradeOS('nodesdktestpool1', 'WA-GUEST-OS-4.27_201512-01', function (err, result, request, response) {
+ client.pool.upgradeOS('nodesdktestpool1', 'WA-GUEST-OS-4.33_201606-01', function (err, result, request, response) {
should.not.exist(err);
should.not.exist(result);
response.statusCode.should.equal(202);
@@ -220,6 +219,24 @@ describe('Batch Service', function () {
});
});
+ it('should add a pool with vnet and get expected error', function (done) {
+ var pool = {
+ id: 'nodesdkvnetpool',
+ vmSize: 'small',
+ cloudServiceConfiguration: { osFamily: '4' },
+ targetDedicated: 0,
+ networkConfiguration: { subnetId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1' }
+ };
+
+ client.pool.add(pool, function (err, result, request, response) {
+ should.exist(err);
+ should.not.exist(result);
+ err.statusCode.should.equal(400);
+ err.body.code.should.equal('InvalidPropertyValue');
+ done();
+ });
+ });
+
it('should list compute nodes successfully', function (done) {
client.computeNodeOperations.list('nodesdktestpool1', function (err, result, request, response) {
should.not.exist(err);
@@ -518,6 +535,61 @@ describe('Batch Service', function () {
});
});
+ it.only('should create a task with exit conditions successfully', function (done) {
+ var jobId = 'JobWithAutoComplete';
+ var taskId = 'TaskWithAutoComplete';
+ var job = {
+ id: jobId,
+ poolInfo: {
+ poolId: 'dummypool'
+ },
+ onAllTasksComplete: 'noAction',
+ onTaskFailure: 'performExitOptionsJobAction'
+ };
+
+ client.job.add(job, function (err, result, request, response) {
+ should.not.exist(err);
+ should.not.exist(result);
+ response.statusCode.should.equal(201);
+
+ var task = {
+ id: taskId,
+ commandLine: 'echo Hello World',
+ exitConditions: {
+ default: {
+ jobAction: 'terminate'
+ },
+ exitCodes: [
+ {
+ code: 1,
+ exitOptions: {
+ jobAction: 'none'
+ }
+ }]
+ }
+ };
+
+ client.task.add(jobId, task, function (err, result, request, response) {
+ should.not.exist(err);
+ should.not.exist(result);
+ response.statusCode.should.equal(201);
+
+ client.task.get(jobId, taskId, function (err, result, request, response) {
+ should.not.exist(err);
+ should.exist(result);
+ result.exitConditions.default.jobAction.should.equal('terminate');
+ result.exitConditions.exitCodes[0].code.should.equal(1);
+ result.exitConditions.exitCodes[0].exitOptions.jobAction.should.equal('none');
+
+ client.job.deleteMethod(jobId, function (err, result, request, response) {
+ should.not.exist(err);
+ done();
+ });
+ });
+ });
+ });
+ });
+
it('should terminate a task successfully', function (done) {
client.task.terminate('HelloWorldJobNodeSDKTest', 'HelloWorldNodeSDKTestTask', function (err, result, request, response) {
should.not.exist(err);
diff --git a/test/services/batch/readme.txt b/test/services/batch/readme.txt
index 3712c1893..520e57c37 100644
--- a/test/services/batch/readme.txt
+++ b/test/services/batch/readme.txt
@@ -8,8 +8,9 @@ WARNING: When running this test in live mode, it takes a long time, as waiting i
it takes to start up the machines and perform operations on them. This waiting is not done in replay mode.
Expect this suite to take around 10 minutes when run in live mode (and when run exclusive of the other test suites).
-Note, if you wish to run this test suite exclusive of the other client tests, the environment variables AZURE_SUBSCRIPTION_ID, CLIENT_ID and APPLICATION_SECRET will need to
-be set regardless. However they can be set to any random values, as they will not actually be tested.
+Note, if you wish to run this test suite exclusive of the other client tests, the environment variables AZURE_SUBSCRIPTION_ID, CLIENT_ID and APPLICATION_SECRET will still need to
+be set. However they can be set to any random values, as they will not actually be tested. You also will need to remove all of the other files from the test/testlistarm.txt file,
+and then run "npm -s run-script unit-arm" to actually run the tests.
In order to test (and record) against a specific Batch Account, set the following variables:
AZURE_BATCH_ACCOUNT (just the account name)