create_boot_directory
if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} {
puts "Autopilot mode is not supported on this platform."
exit 0
}
import_from_depot \
[depot_user]/src/[base_src] \
[depot_user]/src/coreutils \
[depot_user]/src/bash \
[depot_user]/src/init \
[depot_user]/src/libc \
[depot_user]/src/fs_rom \
[depot_user]/src/posix \
[depot_user]/src/report_rom \
[depot_user]/src/vfs \
[depot_user]/src/vfs_import
install_config {
first
second
fourth
}
build { app/sequence app/fs_query }
build_boot_image { sequence fs_query }
append qemu_args " -nographic "
run_genode_until {.*child "test" exited with exit value 0.*\n} 50
set original_output $output
grep_output {\[init -> report_rom\].*}
set num_listings [regexp -all {report 'fs_query -> listing'} $output dummy]
# we expect at least four intermediate reports
if {$num_listings < 4} {
puts "Error: Test failed with too few reports generated"
exit 1
}
#
# We cannot reliably compare the full output because some file operations
# may trigger one or two reports depending on the timing of signal delivery.
# However, we can at least check the last report for validity.
#
regsub {.*report 'fs_query -> listing'} $output {} output
compare_output_to {
[init -> report_rom]
[init -> report_rom]
[init -> report_rom] first
[init -> report_rom] updated
[init -> report_rom]
[init -> report_rom] fourth
[init -> report_rom]
[init -> report_rom]
[init -> report_rom]
}
set output $original_output
grep_output {\[init -> report_rom_empty_vfs\].*}
compare_output_to {
[init -> report_rom_empty_vfs] report 'fs_query_empty_vfs -> listing'
[init -> report_rom_empty_vfs]
[init -> report_rom_empty_vfs]
[init -> report_rom_empty_vfs]
}