| 123456789101112131415161718192021222324252627282930313233343536 |
- 'use strict';
- const { readFileSync } = require('fs');
- const path = require('path');
- const { expect } = require('chai');
- const { Ven } = require('../../client/ven');
- const app = require('../../server');
- const { sequelize } = require('../../db');
- const { port } = require('../../config');
- describe('VEN registration', function() {
- describe('successful self-registration', async function() {
- let ven;
- before(async () => {
- await sequelize.sync();
- await app.start();
- const clientCrtPem = readFileSync(path.join(__dirname, 'integration-client.crt'), 'utf-8');
- ven = new Ven(`http://127.0.0.1:${port}`, clientCrtPem, 'aabbccddeeff', '17:32:59:FD:0E:B5:99:31:27:9C', 'ven.js1');
- });
- it('should successfully register and receive a vtnId', async () => {
- const registrationResponse = await ven.register();
- expect(registrationResponse.vtnId).to.be.a('string');
- });
- after(async () => {
- await app.stop();
- });
- });
- });
|