From 0ee966e1c843aecc344225d94b73ed6240ad9427 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Wed, 7 Oct 2015 12:19:26 -0700 Subject: [PATCH] joyent/node-triton#39 change the test config 'destructiveAllowed' var to 'writeActionsAllowed' Fixes #39 --- CHANGES.md | 3 ++- README.md | 4 ++-- test/config.json.sample | 6 +++--- test/integration/cli-manage-workflow.test.js | 6 +++--- test/integration/cli-profiles.test.js | 7 ++++--- test/integration/helpers.js | 8 ++++---- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fd168c5..3f95e64 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,8 @@ ## 2.1.1 (not yet released) -(nothing yet) +- #39 Test suite: Change the test config 'destructiveAllowed' var to + 'writeActionsAllowed'. ## 2.1.0 diff --git a/README.md b/README.md index 39f5d50..5df5958 100644 --- a/README.md +++ b/README.md @@ -275,7 +275,7 @@ test-integration`). Integration tests require a config file, by default at $ cat test/config.json { "profileName": "east3b", - "destructiveAllowed": true, + "allowWriteActions": true, "image": "minimal-64", "package": "t4-standard-128M" } @@ -292,7 +292,7 @@ You can use `TRITON_TEST_CONFIG` to override the test file, e.g.: $ cat test/coal.json { "profileName": "coal", - "destructiveAllowed": true + "allowWriteActions": true } $ TRITON_TEST_CONFIG=test/coal.json make test diff --git a/test/config.json.sample b/test/config.json.sample index 683bab8..957fa18 100644 --- a/test/config.json.sample +++ b/test/config.json.sample @@ -11,10 +11,10 @@ "insecure": false } - // Optional. Set this to allow the parts of the test suite - // that create and destroy resources: instances, images, networks, etc. + // Optional. Set this to allow the parts of the test suite that create, + // update and destroy resources: instances, images, networks, etc. // This is essentially the "safe" guard. - "destructiveAllowed": true + "allowWriteActions": true // The params used for test provisions. By default the tests use: // the smallest RAM package, the latest base* image. diff --git a/test/integration/cli-manage-workflow.test.js b/test/integration/cli-manage-workflow.test.js index f39ae28..2c5457a 100644 --- a/test/integration/cli-manage-workflow.test.js +++ b/test/integration/cli-manage-workflow.test.js @@ -27,7 +27,7 @@ var h = require('./helpers'); var INST_ALIAS = f('node-triton-test-%s-vm1', os.hostname()); var opts = { - skip: !h.CONFIG.destructiveAllowed + skip: !h.CONFIG.allowWriteActions }; // global variable to hold vm instance JSON @@ -52,8 +52,8 @@ function _jsonStreamParse(s) { // --- Tests if (opts.skip) { - console.error('** skipping manage workflow tests'); - console.error('** set "destructiveAllowed" to enable'); + console.error('** skipping %s tests', __filename); + console.error('** set "allowWriteActions" in test config to enable'); } test('triton manage workflow', opts, function (tt) { tt.comment('Test config:'); diff --git a/test/integration/cli-profiles.test.js b/test/integration/cli-profiles.test.js index df3547c..8e92b04 100644 --- a/test/integration/cli-profiles.test.js +++ b/test/integration/cli-profiles.test.js @@ -22,14 +22,15 @@ var PROFILE_FILE = path.join(__dirname, 'test-profile.json'); var PROFILE_DATA = JSON.parse(fs.readFileSync(PROFILE_FILE, 'utf8')); var opts = { - skip: !h.CONFIG.destructiveAllowed + skip: !h.CONFIG.allowWriteActions }; +// // --- Tests if (opts.skip) { - console.error('** skipping triton profile creation tests'); - console.error('** set "destructiveAllowed" to enable'); + console.error('** skipping %s tests', __filename); + console.error('** set "allowWriteActions" in test config to enable'); } test('triton profiles (read only)', function (tt) { diff --git a/test/integration/helpers.js b/test/integration/helpers.js index 2898411..6e9fa80 100644 --- a/test/integration/helpers.js +++ b/test/integration/helpers.js @@ -49,8 +49,8 @@ try { throw new Error('one of "profile" or "profileName" must be defined ' + 'in ' + configPath); } - assert.optionalBool(CONFIG.destructiveAllowed, - 'test/config.json#destructiveAllowed'); + assert.optionalBool(CONFIG.allowWriteActions, + 'test/config.json#allowWriteActions'); } catch (e) { error('* * *'); error('node-triton integration tests require a config file. By default'); @@ -70,8 +70,8 @@ try { } if (CONFIG.profile.insecure === undefined) CONFIG.profile.insecure = false; -if (CONFIG.destructiveAllowed === undefined) - CONFIG.destructiveAllowed = false; +if (CONFIG.allowWriteActions === undefined) + CONFIG.allowWriteActions = false; var TRITON = [process.execPath, path.resolve(__dirname, '../../bin/triton')]; var UA = 'node-triton-test';