11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciif (!common.hasCrypto)
41cb0ef41Sopenharmony_ci  common.skip('missing crypto');
51cb0ef41Sopenharmony_ciconst assert = require('assert');
61cb0ef41Sopenharmony_ciconst child_process = require('child_process');
71cb0ef41Sopenharmony_ciconst path = require('path');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciprocess.env.NODE_DEBUG_NATIVE = 'http2';
101cb0ef41Sopenharmony_ciprocess.env.NODE_DEBUG = 'http2';
111cb0ef41Sopenharmony_ciconst { stdout, stderr } = child_process.spawnSync(process.execPath, [
121cb0ef41Sopenharmony_ci  path.resolve(__dirname, 'test-http2-ping.js'),
131cb0ef41Sopenharmony_ci], { encoding: 'utf8' });
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ciassert(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/),
161cb0ef41Sopenharmony_ci       stderr);
171cb0ef41Sopenharmony_ciassert(stderr.match(/Http2Session client \(\d+\) handling data frame for stream \d+\r?\n/),
181cb0ef41Sopenharmony_ci       stderr);
191cb0ef41Sopenharmony_ciassert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session client \(\d+\)\] reading starting\r?\n/),
201cb0ef41Sopenharmony_ci       stderr);
211cb0ef41Sopenharmony_ciassert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session client \(\d+\)\] closed with code 0\r?\n/),
221cb0ef41Sopenharmony_ci       stderr);
231cb0ef41Sopenharmony_ciassert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session server \(\d+\)\] closed with code 0\r?\n/),
241cb0ef41Sopenharmony_ci       stderr);
251cb0ef41Sopenharmony_ciassert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session server \(\d+\)\] tearing down stream\r?\n/),
261cb0ef41Sopenharmony_ci       stderr);
271cb0ef41Sopenharmony_ciassert.strictEqual(stdout.trim(), '');
28