aboutsummaryrefslogtreecommitdiff
path: root/docker/netiquette/test/runner.mjs
diff options
context:
space:
mode:
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}`)
+})()