From df6e1c5fb75f805afbd4ef5e600f7ef789bd7273 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Sun, 17 Sep 2017 13:47:46 +0200
Subject: [PATCH] [fix] Unit Tests were opening ports with UPnP

---
 test/fast/modules/bma/module-test.js | 1 +
 test/integration/cli.js              | 2 +-
 test/integration/tests.js            | 2 +-
 test/integration/tools/node.js       | 2 +-
 test/integration/v1.0-modules-api.js | 2 +-
 5 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/test/fast/modules/bma/module-test.js b/test/fast/modules/bma/module-test.js
index 88ae5ce66..135dfa971 100644
--- a/test/fast/modules/bma/module-test.js
+++ b/test/fast/modules/bma/module-test.js
@@ -29,6 +29,7 @@ describe('Module usage', () => {
     }, 'duniter-automated-test');
     yield stack.executeStack(['node', 'index.js', 'test1',
       '--memory',
+      '--noupnp',
       '--ipv4', '127.0.0.1',
       '--port', '10400'
     ]);
diff --git a/test/integration/cli.js b/test/integration/cli.js
index 821ac555d..f6e554514 100644
--- a/test/integration/cli.js
+++ b/test/integration/cli.js
@@ -116,7 +116,7 @@ describe("CLI", function() {
   }));
 
   it('config --autoconf', () => co(function*() {
-    let res = yield execute(['config', '--autoconf']);
+    let res = yield execute(['config', '--autoconf', '--noupnp']);
     res.should.have.property("pair").property('pub').not.equal("");
     res.should.have.property("pair").property('sec').not.equal("");
   }));
diff --git a/test/integration/tests.js b/test/integration/tests.js
index 6433f307b..3848b6b9b 100644
--- a/test/integration/tests.js
+++ b/test/integration/tests.js
@@ -24,7 +24,7 @@ describe("Integration", function() {
 
   describe("Node 1", function() {
 
-    const node1 = node('db1', { currency: 'bb', ipv4: 'localhost', port: 9999, remoteipv4: 'localhost', remoteport: 9999, httplogs: false,
+    const node1 = node('db1', { upnp: false, currency: 'bb', ipv4: 'localhost', port: 9999, remoteipv4: 'localhost', remoteport: 9999, httplogs: false,
       rootoffset: 0,
       sigQty: 1,
       pair: {
diff --git a/test/integration/tools/node.js b/test/integration/tools/node.js
index 1c508c6f8..bea8fb7b7 100644
--- a/test/integration/tools/node.js
+++ b/test/integration/tools/node.js
@@ -180,7 +180,7 @@ function Node (dbName, options) {
       options.remoteipv4 = options.remoteipv4 || null;
       options.remoteipv6 = options.remoteipv6 || null;
       options.remoteport = options.remoteport || 10901;
-      const cliOptions = []
+      const cliOptions = ['--ws2p-noupnp']
       if (options.port) {
         cliOptions.push('--port')
         cliOptions.push(options.port)
diff --git a/test/integration/v1.0-modules-api.js b/test/integration/v1.0-modules-api.js
index f1a62982c..a0f0d81e4 100644
--- a/test/integration/v1.0-modules-api.js
+++ b/test/integration/v1.0-modules-api.js
@@ -158,7 +158,7 @@ describe("v1.0 Module API", () => {
 
     function run() {
       const args = Array.from(arguments);
-      return stack.executeStack(['node', 'index.js', '--memory'].concat(args));
+      return stack.executeStack(['node', 'index.js', '--memory', '--ws2p-noupnp'].concat(args));
     }
 
     before(() => co(function*() {
-- 
GitLab