update tests to match api changes
This commit is contained in:
parent
5002d3fd72
commit
b55b6998ba
32
test.js
32
test.js
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// https://git.coolaj86.com/coolaj86/acme-challenge-test.js
|
// https://git.rootprojects.org/root/acme-dns-01-test.js
|
||||||
var tester = require('acme-challenge-test');
|
var tester = require('acme-dns-01-test');
|
||||||
|
|
||||||
// Usage: node ./test.js example.com xxxxxxxxx
|
// Usage: node ./test.js example.com xxxxxxxxx
|
||||||
var zone = process.argv[2];
|
var zone = process.argv[2];
|
||||||
|
@ -10,38 +10,20 @@ var zone = process.argv[2];
|
||||||
var challenger = require('./index.js').create({
|
var challenger = require('./index.js').create({
|
||||||
apiUser:process.argv[3],
|
apiUser:process.argv[3],
|
||||||
apiKey : process.argv[4],
|
apiKey : process.argv[4],
|
||||||
username: process.argv[5]||process.argv[3]
|
clientIp:process.argv[5],
|
||||||
|
username: process.argv[6]||process.argv[3]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// The dry-run tests can pass on, literally, 'example.com'
|
// The dry-run tests can pass on, literally, 'example.com'
|
||||||
// but the integration tests require that you have control over the domain
|
// but the integration tests require that you have control over the domain
|
||||||
var domain = zone;
|
|
||||||
|
|
||||||
tester
|
tester
|
||||||
.test('dns-01', domain, challenger)
|
.testZone('dns-01', zone, challenger)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
console.info('PASS', domain);
|
console.info('PASS', zone);
|
||||||
///*
|
|
||||||
domain = 'foo.' + zone;
|
|
||||||
|
|
||||||
return tester
|
|
||||||
.test('dns-01', domain, challenger)
|
|
||||||
.then(function() {
|
|
||||||
console.info('PASS', domain);
|
|
||||||
})
|
|
||||||
.then(function() {
|
|
||||||
domain = '*.foo.' + zone;
|
|
||||||
|
|
||||||
return tester.test('dns-01', domain, challenger).then(function() {
|
|
||||||
console.info('PASS', domain);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
//*/
|
|
||||||
})
|
})
|
||||||
.catch(function(e) {
|
.catch(function(e) {
|
||||||
console.info('ERROR', domain);
|
console.info('FAIL', zone);
|
||||||
|
|
||||||
console.error(e.message);
|
console.error(e.message);
|
||||||
console.error(e.stack);
|
console.error(e.stack);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue