Skip to content

Commit 2de5d11

Browse files
committed
Show successful ports beside verify stage tests
1 parent 11168e2 commit 2de5d11

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

cli.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,17 @@ program
772772
'Stages: L1 → L7'
773773
]));
774774
const report = await runPipeline(target, { timeoutSeconds });
775+
const successfulPorts = [...new Set(
776+
report.pipeline.levels
777+
.filter((item) => item.ok && Number.isInteger(item.port))
778+
.map((item) => item.port)
779+
)].sort((a, b) => a - b);
780+
console.log(renderPanel('🧪 STAGE RESULTS', report.pipeline.levels.map((item) => {
781+
const status = item.ok ? chalk.green('PASS') : chalk.red('FAIL');
782+
const portLabel = item.ok && Number.isInteger(item.port)
783+
? ` ${THEME.success(`(port ${item.port} ✅)`)}` : '';
784+
return `${chalk.white(item.level)} ${THEME.muted(item.name)}: ${status}${portLabel}`;
785+
})));
775786
const body = JSON.stringify(report, null, 2);
776787
if (options.output) {
777788
fs.writeFileSync(options.output, body);
@@ -782,6 +793,7 @@ program
782793
console.log(renderPanel('✅ VERIFY SUMMARY', [
783794
`Passed levels: ${chalk.white(report.pipeline.summary.passedLevels)}/${chalk.white(report.pipeline.summary.totalLevels)}`,
784795
`Pass rate: ${chalk.white(`${report.pipeline.summary.passRate}%`)}`,
796+
`Successful ports: ${chalk.white(successfulPorts.length > 0 ? successfulPorts.join(', ') : '-')}`,
785797
`Generated: ${THEME.muted(report.generatedAt)}`
786798
]));
787799
} catch (error) {

src/checks/l4_tcp_443.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ async function run(target, context) {
77
return {
88
level: 'L4',
99
name: 'tcp-443',
10+
port: 443,
11+
protocol: 'tcp',
1012
ok: result.ok,
1113
details: result.ok ? 'TCP/443 is reachable' : `TCP/443 failed: ${result.error || 'unknown'}`
1214
};

src/checks/l5_tcp_80.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ async function run(target, context) {
77
return {
88
level: 'L5',
99
name: 'tcp-80',
10+
port: 80,
11+
protocol: 'tcp',
1012
ok: result.ok,
1113
details: result.ok ? 'TCP/80 is reachable' : `TCP/80 failed: ${result.error || 'unknown'}`
1214
};

0 commit comments

Comments
 (0)