aboutsummaryrefslogtreecommitdiff
path: root/docker/netiquette/test/runner.mjs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2019-12-04 18:04:30 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2019-12-04 18:04:30 +0100
commitfcc2328a3bf49eb5310413058cc9ebaf8e7819f8 (patch)
treec6faabae8badd96455453b72472ac08a2fe0b1c2 /docker/netiquette/test/runner.mjs
parent0b3eb8ec1b3ba3691410744f6397437c9832e74d (diff)
downloadinfrastructure-fcc2328a3bf49eb5310413058cc9ebaf8e7819f8.tar.gz
infrastructure-fcc2328a3bf49eb5310413058cc9ebaf8e7819f8.zip
WIP netiquette
Diffstat (limited to 'docker/netiquette/test/runner.mjs')
-rw-r--r--docker/netiquette/test/runner.mjs28
1 files changed, 28 insertions, 0 deletions
diff --git a/docker/netiquette/test/runner.mjs b/docker/netiquette/test/runner.mjs
new file mode 100644
index 0000000..b4da1de
--- /dev/null
+++ b/docker/netiquette/test/runner.mjs
@@ -0,0 +1,28 @@
+'use strict'
+
+import io from './io.mjs'
+import iptables from './iptables.mjs'
+
+(async () => {
+ const res = await [
+ ...io,
+ ...iptables
+ ].map(async f => {
+ try {
+ await f()
+ return 'passed'
+ }
+ catch(e) {
+ console.error(e)
+ return 'failed'
+ }
+ }).reduce(async (acc, r) => {
+ const accumulator = await acc
+ const result = await r
+ accumulator.total++
+ accumulator[result]++
+ return accumulator
+ }, {total: 0, passed: 0, failed: 0})
+
+ console.log(`Done. passed: ${res.passed}, failed: ${res.failed}, total: ${res.total}`)
+})()