-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Victor Shaw
committed
Mar 11, 2019
1 parent
ca9836b
commit ce90061
Showing
4 changed files
with
91 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const { spawnSync } = require('child_process'); | ||
const path = require('path'); | ||
const assert = require('assert'); | ||
const { org, env, user, password, key, secret, otoken } = require('./env.js'); | ||
|
||
const cliPath = path.join(__dirname, '..', 'cli', 'edgemicro-cert'); | ||
describe('OAuth token option for management API calls', done => { | ||
it('edgemicro-cert check -t', done => { | ||
let bash = spawnSync(cliPath, ['check', '-e', env, '-o', org, '-t', otoken]); | ||
let outString = Buffer.from(bash.stdout).toString(); | ||
assert.equal(outString.includes('checked cert successfully'), true); | ||
done(); | ||
}); | ||
|
||
it('edgemicro-cert delete -t', done => { | ||
let bash = spawnSync(cliPath, ['delete', '-e', env, '-o', org, '-t', otoken]); | ||
let outString = Buffer.from(bash.stdout).toString(); | ||
assert.equal(outString.includes('KVM deleted'), true); | ||
done(); | ||
}); | ||
|
||
it('edgemicro-cert install -t', done => { | ||
let bash = spawnSync(cliPath, ['install', '-e', env, '-o', org, '-t', otoken]); | ||
let outString = Buffer.from(bash.stdout).toString(); | ||
assert.equal(outString.includes('installed cert'), true); | ||
done(); | ||
}); | ||
|
||
it('recheck edgemicro-cert check -t', done => { | ||
let bash = spawnSync(cliPath, ['check', '-e', env, '-o', org, '-t', otoken]); | ||
let outString = Buffer.from(bash.stdout).toString(); | ||
console.log('outString', outString); | ||
assert.equal(outString.includes('checked cert successfully'), true); | ||
done(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters