web/website/tests/system-board-provision.test.mjs
2026-11-27 23:43:05 +00:00

14 lines
1.5 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import {spawnSync} from 'node:child_process';
import {fileURLToPath} from 'node:url';
const available=spawnSync('php',['-v'],{encoding:'utf8'}).status===0;
test('native automatic board provisioner syntax and verified membership policy',{skip:!available},()=>{
for(const name of ['system-board-provision.php','system-board-membership.php','provision-system-boards.php','board-key-publication.php','publish-board-keys.php']){
const result=spawnSync('php',['-l',fileURLToPath(new URL('../integrations/mybb/'+name,import.meta.url))],{encoding:'utf8'});assert.equal(result.status,0,result.stderr||result.stdout);
}
const result=spawnSync('php',[fileURLToPath(new URL('../integrations/mybb/test-system-board-provision.php',import.meta.url))],{encoding:'utf8'});assert.equal(result.status,0,result.stderr||result.stdout);
const read=spawnSync('php',[fileURLToPath(new URL('../integrations/mybb/test-board-key-read-path.php',import.meta.url))],{encoding:'utf8'});assert.equal(read.status,0,read.stderr||read.stdout);
const recovery=spawnSync('php',[fileURLToPath(new URL('../integrations/mybb/test-board-key-recovery.php',import.meta.url))],{encoding:'utf8'});assert.equal(recovery.status,0,recovery.stderr||recovery.stdout);
const keys=spawnSync('php',[fileURLToPath(new URL('../integrations/mybb/test-board-key-publication.php',import.meta.url))],{encoding:'utf8'});assert.equal(keys.status,0,keys.stderr||keys.stdout);
});