Skip to content

Commit d84e04a

Browse files
committed
move ca to ca folder
1 parent 82f74df commit d84e04a

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

docker.sh

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export binPath=$CURRENT/common/bin/
66
down() {
77

88
npm stop
9-
sudo rm -rf $CURRENT/stateVolumes/*
109
}
1110

1211
prepareNetwork() {

test/caTest.js

+27-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {consoleLogger} from '@davidkhala/logger/log4.js';
77
import * as caCryptoGen from '../config/caCryptoGen.js';
88
import {importFrom} from '@davidkhala/light/es6.mjs';
99
import {ping} from '../common/nodejs/ca/ca.js';
10+
import CertificateServiceWrapper from '../common/nodejs/ca/certificateService.js';
1011

1112
const logger = consoleLogger('ca service');
1213
const {TLS} = importFrom(import.meta, '../config/orgs.json');
@@ -32,8 +33,6 @@ describe('caCryptoGen', () => {
3233
});
3334

3435
describe('ca service', () => {
35-
const org = 'icdd';
36-
const admin = helper.getOrgAdmin(org);
3736
const protocol = `http${TLS ? 's' : ''}`;
3837
const hostname = 'localhost';
3938
const port = 8054;
@@ -93,5 +92,31 @@ describe('identity service', function () {
9392
assert.ifError(await idService.getOne({enrollmentID: 'admin'}));
9493

9594
});
95+
it('delete: on not exist', async () => {
96+
assert.ifError(await idService.delete({enrollmentID: 'admin'}));
97+
});
98+
it('delete: on exist', async () => {
99+
const newUser = 'new';
100+
await idService.createIfNotExist({
101+
enrollmentID: newUser,
102+
affiliation: org,
103+
role: 'client'
104+
});
105+
const result = await idService.delete({enrollmentID: newUser});
106+
logger.debug(result);
107+
});
96108
});
109+
describe('certificateService', function () {
110+
const org = 'icdd';
111+
const admin = helper.getOrgAdmin(org);
112+
const protocol = `http${TLS ? 's' : ''}`;
113+
const hostname = 'localhost';
114+
const port = 8054;
97115

116+
const caService = new CAService({protocol, hostname, port});
117+
const certService = new CertificateServiceWrapper(caService, admin, logger);
118+
it('get all', async () => {
119+
const results = await certService.getAll();
120+
logger.info(results);
121+
});
122+
});

0 commit comments

Comments
 (0)