| 34 | } |
| 35 | |
| 36 | async function validateReadFileProc() { |
| 37 | // Test to make sure reading a file under the /proc directory works. Adapted |
| 38 | // from test-fs-read-file-sync-hostname.js. |
| 39 | // Refs: |
| 40 | // - https://groups.google.com/forum/#!topic/nodejs-dev/rxZ_RoH1Gn0 |
| 41 | // - https://github.com/nodejs/node/issues/21331 |
| 42 | |
| 43 | // Test is Linux-specific. |
| 44 | if (!common.isLinux) |
| 45 | return; |
| 46 | |
| 47 | await using fileHandle = await open('/proc/sys/kernel/hostname', 'r'); |
| 48 | const hostname = await fileHandle.readFile(); |
| 49 | assert.ok(hostname.length > 0); |
| 50 | } |
| 51 | |
| 52 | async function doReadAndCancel() { |
| 53 | // Signal aborted from the start |