/proc/bare_os/initd_readiness.json schema 2
This commit is contained in:
@@ -2913,6 +2913,9 @@ async function executeKernel(disk, store, swarm, initSource) {
|
||||
procBareOsInitdDagText() {
|
||||
return getLastBareInitdDagSnapshotJson()
|
||||
},
|
||||
procBareOsInitdReadinessText() {
|
||||
return `${JSON.stringify(bareInitdReadinessSnapshot())}\n`
|
||||
},
|
||||
procBareOsMetricsLiveText() {
|
||||
const now = Date.now()
|
||||
if (
|
||||
|
||||
@@ -360,6 +360,7 @@ export const BARE_OS_PROC_FILE_TO_ID_HYPERCORE_PACK_HRPC_LIFECYCLE = Object.free
|
||||
* procBareOsProvenanceText?: () => string,
|
||||
* procBareOsPearIpcRegistryText?: () => string,
|
||||
* procBareOsInitdDagText?: () => string,
|
||||
* procBareOsInitdReadinessText?: () => string,
|
||||
* procBareOsBootGraphJsonText?: () => string,
|
||||
* procBareOsBootBudgetSummaryText?: () => string,
|
||||
* procBareOsMetricsLiveText?: () => string,
|
||||
@@ -567,6 +568,10 @@ export function createVfs(
|
||||
typeof vfsOptions.procBareOsInitdDagText === 'function'
|
||||
? vfsOptions.procBareOsInitdDagText
|
||||
: null
|
||||
const procBareOsInitdReadinessText =
|
||||
typeof vfsOptions.procBareOsInitdReadinessText === 'function'
|
||||
? vfsOptions.procBareOsInitdReadinessText
|
||||
: null
|
||||
const procBareOsBootGraphJsonText =
|
||||
typeof vfsOptions.procBareOsBootGraphJsonText === 'function'
|
||||
? vfsOptions.procBareOsBootGraphJsonText
|
||||
@@ -1549,6 +1554,12 @@ export function createVfs(
|
||||
const t = procBareOsInitdDagText ? procBareOsInitdDagText() : 'null\n'
|
||||
return utf8Encode(t)
|
||||
}
|
||||
if (f === 'bare_os_initd_readiness') {
|
||||
const t = procBareOsInitdReadinessText
|
||||
? procBareOsInitdReadinessText()
|
||||
: '{"schema":2,"units":[],"note":"initd readiness provider missing","atMs":0}\n'
|
||||
return utf8Encode(t)
|
||||
}
|
||||
if (f === 'bare_os_boot_graph') {
|
||||
const t = procBareOsBootGraphJsonText
|
||||
? procBareOsBootGraphJsonText()
|
||||
@@ -1849,6 +1860,10 @@ export function createVfs(
|
||||
name: 'initd_dag.json',
|
||||
path: '/proc/bare_os/initd_dag.json'
|
||||
},
|
||||
{
|
||||
name: 'initd_readiness.json',
|
||||
path: '/proc/bare_os/initd_readiness.json'
|
||||
},
|
||||
{
|
||||
name: 'boot_graph.json',
|
||||
path: '/proc/bare_os/boot_graph.json'
|
||||
@@ -2604,6 +2619,7 @@ export function createVfs(
|
||||
provenance: 'bare_os_provenance',
|
||||
'pear_ipc.json': 'bare_os_pear_ipc_registry',
|
||||
'initd_dag.json': 'bare_os_initd_dag',
|
||||
'initd_readiness.json': 'bare_os_initd_readiness',
|
||||
'boot_graph.json': 'bare_os_boot_graph',
|
||||
'boot_budget_summary.json': 'bare_os_boot_budget_summary',
|
||||
metrics_live: 'bare_os_metrics_live',
|
||||
@@ -3141,6 +3157,14 @@ export function createVfs(
|
||||
file: 'bare_os_initd_dag'
|
||||
}
|
||||
}
|
||||
if (sub === 'bare_os_initd_readiness.json') {
|
||||
return {
|
||||
virtualPseudo: true,
|
||||
kind: 'proc',
|
||||
node: 'file',
|
||||
file: 'bare_os_initd_readiness'
|
||||
}
|
||||
}
|
||||
if (sub === 'bare_os_boot_graph.json') {
|
||||
return {
|
||||
virtualPseudo: true,
|
||||
@@ -4709,6 +4733,7 @@ export function createVfs(
|
||||
'bare_os_indexer_catchup.json',
|
||||
'bare_os_multisig_quorum_pointer.json',
|
||||
'bare_os_initd_dag.json',
|
||||
'bare_os_initd_readiness.json',
|
||||
'bare_os_boot_graph.json',
|
||||
'bare_os_boot_budget_summary.json',
|
||||
'bare_os_chat.json',
|
||||
@@ -4889,6 +4914,7 @@ export function createVfs(
|
||||
'hypermininet_topology.json',
|
||||
'index.json',
|
||||
'initd_dag.json',
|
||||
'initd_readiness.json',
|
||||
'boot_graph.json',
|
||||
'boot_budget_summary.json',
|
||||
'initd_graph.json',
|
||||
|
||||
@@ -2544,6 +2544,32 @@ test('vfs /proc/self/environ omits secret-like env keys', async (t) => {
|
||||
rmSync(dir, { recursive: true, force: true })
|
||||
})
|
||||
|
||||
test('vfs exposes /proc/bare_os/initd_readiness.json', async (t) => {
|
||||
const dir = testCorestoreDir('vfsinitdreadiness')
|
||||
const store = new Corestore(dir)
|
||||
const sys = new Hyperdrive(store)
|
||||
const personal = new Hyperdrive(store.namespace('pvinitdreadiness'))
|
||||
await sys.ready()
|
||||
await personal.ready()
|
||||
const vfs = createVfs(sys, personal, {
|
||||
HOME: '/home/guest',
|
||||
PWD: '/home/guest',
|
||||
PATH: '/bin'
|
||||
})
|
||||
const raw = b4a.toString(await vfs.readFile('/proc/bare_os/initd_readiness.json'))
|
||||
const parsed = JSON.parse(raw)
|
||||
t.is(parsed.schema, 2)
|
||||
t.alike(parsed.units, [])
|
||||
const idxRaw = b4a.toString(await vfs.readFile('/proc/bare_os/index.json'))
|
||||
const idx = JSON.parse(idxRaw)
|
||||
t.ok(
|
||||
Array.isArray(idx.entries) &&
|
||||
idx.entries.some((e) => e && e.name === 'initd_readiness.json')
|
||||
)
|
||||
await store.close()
|
||||
rmSync(dir, { recursive: true, force: true })
|
||||
})
|
||||
|
||||
test('vfs /tmp maps to personal drive per HOME basename', async (t) => {
|
||||
const dir = testCorestoreDir('vfstmp')
|
||||
const store = new Corestore(dir)
|
||||
|
||||
Reference in New Issue
Block a user