2018-05-27 16:41:35 +02:00
'use strict' ;
2018-06-08 07:13:55 +02:00
const common = require ( '../common' ) ;
if ( ! common . hasCrypto )
common . skip ( 'missing crypto' ) ;
2018-05-27 16:41:35 +02:00
const assert = require ( 'assert' ) ;
const child _process = require ( 'child_process' ) ;
const path = require ( 'path' ) ;
process . env . NODE _DEBUG _NATIVE = 'http2' ;
2018-07-28 12:12:32 +05:30
process . env . NODE _DEBUG = 'http2' ;
2018-05-27 16:41:35 +02:00
const { stdout , stderr } = child _process . spawnSync ( process . execPath , [
path . resolve ( _ _dirname , 'test-http2-ping.js' )
] , { encoding : 'utf8' } ) ;
2020-01-30 16:37:02 +02:00
assert ( stderr . match ( /Setting the NODE_DEBUG environment variable to 'http2' can expose sensitive data \(such as passwords, tokens and authentication headers\) in the resulting log\.\r?\n/ ) ,
2018-07-28 12:12:32 +05:30
stderr ) ;
2020-01-30 16:37:02 +02:00
assert ( stderr . match ( /Http2Session client \(\d+\) handling data frame for stream \d+\r?\n/ ) ,
2018-05-27 16:41:35 +02:00
stderr ) ;
2020-01-30 16:37:02 +02:00
assert ( stderr . match ( /HttpStream \d+ \(\d+\) \[Http2Session client \(\d+\)\] reading starting\r?\n/ ) ,
2018-05-27 16:41:35 +02:00
stderr ) ;
2020-01-30 16:37:02 +02:00
assert ( stderr . match ( /HttpStream \d+ \(\d+\) \[Http2Session client \(\d+\)\] closed with code 0\r?\n/ ) ,
2019-12-07 18:22:52 +02:00
stderr ) ;
2020-01-30 16:37:02 +02:00
assert ( stderr . match ( /HttpStream \d+ \(\d+\) \[Http2Session server \(\d+\)\] closed with code 0\r?\n/ ) ,
2019-12-07 18:22:52 +02:00
stderr ) ;
2020-01-30 16:37:02 +02:00
assert ( stderr . match ( /HttpStream \d+ \(\d+\) \[Http2Session server \(\d+\)\] tearing down stream\r?\n/ ) ,
2018-05-27 16:41:35 +02:00
stderr ) ;
assert . strictEqual ( stdout . trim ( ) , '' ) ;