clistyle: Some fixes to integration tests for 'triton inst' changes

This commit is contained in:
Trent Mick 2016-01-04 10:45:13 -08:00
parent a05de11fb3
commit 83c6448202
2 changed files with 12 additions and 10 deletions

View File

@ -63,7 +63,8 @@ test('triton manage workflow', opts, function (tt) {
});
tt.test(' cleanup existing inst with alias ' + INST_ALIAS, function (t) {
h.triton(['inst', '-j', INST_ALIAS], function (err, stdout, stderr) {
h.triton(['inst', 'get', '-j', INST_ALIAS],
function (err, stdout, stderr) {
if (err) {
if (err.code === 3) { // `triton` code for ResourceNotFound
t.ok(true, 'no pre-existing alias in the way');
@ -177,25 +178,25 @@ test('triton manage workflow', opts, function (tt) {
});
// test `triton instance -j` with the UUID, the alias, and the short ID
tt.test(' triton instance', function (t) {
tt.test(' triton instance get', function (t) {
var uuid = instance.id;
var shortId = common.uuidToShortId(uuid);
vasync.parallel({
funcs: [
function (cb) {
h.safeTriton(t, ['instance', '-j', INST_ALIAS],
h.safeTriton(t, ['instance', 'get', '-j', INST_ALIAS],
function (stdout) {
cb(null, stdout);
});
},
function (cb) {
h.safeTriton(t, ['instance', '-j', uuid],
h.safeTriton(t, ['instance', 'get', '-j', uuid],
function (stdout) {
cb(null, stdout);
});
},
function (cb) {
h.safeTriton(t, ['instance', '-j', shortId],
h.safeTriton(t, ['instance', 'get', '-j', shortId],
function (stdout) {
cb(null, stdout);
});
@ -286,7 +287,7 @@ test('triton manage workflow', opts, function (tt) {
// wait for the machine to stop
tt.test(' triton confirm stopped', function (t) {
h.safeTriton(t, {json: true, args: ['instance', '-j', INST_ALIAS]},
h.safeTriton(t, {json: true, args: ['inst', 'get', '-j', INST_ALIAS]},
function (d) {
instance = d;
@ -307,7 +308,7 @@ test('triton manage workflow', opts, function (tt) {
// wait for the machine to start
tt.test(' confirm running', function (t) {
h.safeTriton(t, {json: true, args: ['instance', '-j', INST_ALIAS]},
h.safeTriton(t, {json: true, args: ['inst', 'get', '-j', INST_ALIAS]},
function (d) {
instance = d;
t.equal(d.state, 'running', 'machine running');

View File

@ -31,10 +31,11 @@ var subs = [
['account', 'whoami'],
['services'],
['datacenters'],
['create-instance', 'create'],
['instances', 'insts', 'list', 'ls'],
['instance', 'inst'],
['instance-audit', 'audit'],
['instance list', 'instance ls', 'instances', 'insts', 'ls'],
['instance get'],
['instance create', 'create'],
['instance audit'],
['start-instance', 'start'],
['stop-instance', 'stop'],
['reboot-instance', 'reboot'],