11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_cirequire('../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ciconst cp = require('child_process'); 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ciif (process.argv[2] === 'child') { 71cb0ef41Sopenharmony_ci // The following console.log() call is part of the test's functionality. 81cb0ef41Sopenharmony_ci console.log(process.ppid); 91cb0ef41Sopenharmony_ci} else { 101cb0ef41Sopenharmony_ci const child = cp.spawnSync(process.execPath, [__filename, 'child']); 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci assert.strictEqual(child.status, 0); 131cb0ef41Sopenharmony_ci assert.strictEqual(child.signal, null); 141cb0ef41Sopenharmony_ci assert.strictEqual(+child.stdout.toString().trim(), process.pid); 151cb0ef41Sopenharmony_ci assert.strictEqual(child.stderr.toString().trim(), ''); 161cb0ef41Sopenharmony_ci} 17