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
|
||||
'use strict';
|
||||
|
||||
// https://git.coolaj86.com/coolaj86/acme-challenge-test.js
|
||||
var tester = require('acme-challenge-test');
|
||||
// https://git.rootprojects.org/root/acme-dns-01-test.js
|
||||
var tester = require('acme-dns-01-test');
|
||||
|
||||
// Usage: node ./test.js example.com xxxxxxxxx
|
||||
var zone = process.argv[2];
|
||||
|
@ -10,38 +10,20 @@ var zone = process.argv[2];
|
|||
var challenger = require('./index.js').create({
|
||||
apiUser:process.argv[3],
|
||||
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'
|
||||
// but the integration tests require that you have control over the domain
|
||||
var domain = zone;
|
||||
|
||||
tester
|
||||
.test('dns-01', domain, challenger)
|
||||
.testZone('dns-01', zone, challenger)
|
||||
.then(function() {
|
||||
console.info('PASS', domain);
|
||||
///*
|
||||
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);
|
||||
});
|
||||
});
|
||||
//*/
|
||||
console.info('PASS', zone);
|
||||
})
|
||||
.catch(function(e) {
|
||||
console.info('ERROR', domain);
|
||||
|
||||
console.info('FAIL', zone);
|
||||
console.error(e.message);
|
||||
console.error(e.stack);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue