joyent/node-triton#39 change the test config 'destructiveAllowed' var to 'writeActionsAllowed'

Fixes #39
This commit is contained in:
Trent Mick 2015-10-07 12:19:26 -07:00
parent 796f4d069e
commit 0ee966e1c8
6 changed files with 18 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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:');

View File

@ -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) {

View File

@ -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';