<runtime ram="32M" caps="1000" binary="init">

	<events>
		<timeout meaning="failed" sec="30" />
		<log meaning="succeeded">child "test-libc_vfs_block" exited with exit value 0</log>
		<log meaning="failed">Error: </log>
	</events>

	<content>
		<rom label="ld.lib.so"/>
		<rom label="libc.lib.so"/>
		<rom label="vfs.lib.so"/>
		<rom label="vfs_import.lib.so"/>
		<rom label="vfs_block"/>
		<rom label="test-libc_vfs_block"/>
	</content>

	<config>
		<parent-provides>
			<service name="ROM"/>
			<service name="PD"/>
			<service name="RM"/>
			<service name="CPU"/>
			<service name="LOG"/>
		</parent-provides>
		<default-route>
			<any-service> <parent/> <any-child/> </any-service>
		</default-route>
		<default caps="100"/>
		<start name="vfs_block">
			<resource name="RAM" quantum="2M"/>
			<provides> <service name="Block"/> </provides>
			<config>
				<vfs>
					<ram/>
					<import>
						<zero name="block_file" size="16K"/>
					</import>
				</vfs>
				<default-policy file="/block_file" block_size="4096"
				                writeable="yes"/>
			</config>
		</start>
		<start name="test-libc_vfs_block">
			<resource name="RAM" quantum="4M"/>
			<config>
				<vfs> <dir name="dev"> <block/> </dir> </vfs>
				<libc/>

				<!-- Populate the block device with a pattern and validate the
					 write operation by reading back the content. -->
				<sequence>
					<write  content="abcdefghIJKLMNOPqrstuvwxYZABCDEF"/>
					<expect content="abcdefghIJKLMNOPqrstuvwxYZABCDEF"/>
				</sequence>

				<!-- Write single 512 block. This requires the successive reading,
					 modification, and writing of the compound 4096 block. -->
				<sequence>
					<write  at="9" content="%"/>
					<expect content="abcdefghI%KLMNOPqrstuvwxYZABCDEF"/>
				</sequence>

				<!-- Reset the pattern and write multiple 512 blocks that cross
					 a 4096 boundary. -->
				<sequence>
					<write  content="abcdefghIJKLMNOPqrstuvwxYZABCDEF"/>
					<write  at="15" content="123"/>
					<expect content="abcdefghIJKLMNO123stuvwxYZABCDEF"/>
				</sequence>
			</config>
		</start>
	</config>
</runtime>
