test/depot_query: add test for zero-sized archives

This test covers the situation where depot_query evaluates depot content
that is incompletely extracted. In particular, if the 'archives' file
already exists but has a size of zero, depot_query would produce a
page fault. This situation can be manually provoked by deliberately
creating a zero-sized archives file for any otherwise correct pkg.

This patch also fixes the success indicator of the test. It wrongly
matched an early line of the log output.

Issue 
This commit is contained in:
Norman Feske 2019-11-29 11:26:22 +01:00 committed by Christian Helmuth
parent 9814fc5447
commit 2aa6471608

@ -52,7 +52,25 @@ install_config {
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <tar name="depot.tar"/> </vfs>
<vfs>
<tar name="depot.tar"/>
<dir name="badguy">
<dir name="pkg">
<dir name="invalid">
<dir name="current">
<inline name="archives"/>
<inline name="runtime">
<runtime ram="1M" caps="100" binary="chroot">
<content>
<rom label="chroot"/>
</content>
</runtime>
</inline>
</dir>
</dir>
</dir>
</dir>
</vfs>
<policy label="depot_query -> depot" root="/" />
<policy label="fs_rom -> " root="/" />
</config>
@ -94,6 +112,7 @@ install_config {
<service name="LOG"> <parent/> </service>
<service name="Timer"> <parent/> </service>
</common_routes>
<start name="invalid" pkg="badguy/pkg/invalid/current"/>
<start name="test" pkg="} [depot_user] {/pkg/} [query_pkg] {"/>
</config>
<route>
@ -121,5 +140,5 @@ build_boot_image { init depot_query depot_deploy vfs.lib.so }
append qemu_args " -nographic "
run_genode_until {.*child "test-fs_report" exited with exit value 0.*\n} 30
run_genode_until {.*\] child "test-fs_report" exited with exit value 0.*\n} 30