assert_spec linux # check that babeltrace2 is present set babeltrace_missing [catch { spawn babeltrace2 -V expect { {Babeltrace 2.*} { } eof { return } timeout { return } } }] if {$babeltrace_missing} { puts "\nPlease install babeltrace2 on your host system." exit 1; } # check that python-pcapng is present set python_pcapng_missing [catch { spawn -noecho sh -c "echo \"import pcapng\" | python" expect { {No module} { return } {not found} { return } eof { } } }] if {$python_pcapng_missing} { puts "\nPlease install python-pcapng on your host system." exit 1; } build { app/ping server/lx_fs } create_boot_directory import_from_depot \ [depot_user]/src/[base_src] \ [depot_user]/src/init \ [depot_user]/src/libc \ [depot_user]/src/nic_router \ [depot_user]/src/report_rom \ [depot_user]/src/vfs \ [depot_user]/src/linux_rtc_drv \ [depot_user]/src/trace_recorder \ [depot_user]/raw/trace_recorder \ [depot_user]/src/trace_recorder_policy \ [depot_user]/src/dynamic_rom install_config { } exec rm -rf bin/fs exec mkdir -p bin/fs build_boot_image [list {*}[build_artifacts] fs] append qemu_args " -nographic " run_genode_until {Enabled ctf writer for init -> ping -> ep} 20 set spawn_id [output_spawn_id] run_genode_until {.*child "ping" exited with exit value 0.*} 60 $spawn_id ####################### # validate CTF output # ####################### set ctf_path [exec find bin/fs -type d -name nic_router] exec test -s $ctf_path/ep # check generated trace by reading CTF trace as fast as possible using a dummy output exec babeltrace2 $ctf_path --output-format=dummy ########################## # validate PCAPNG output # ########################## # create python script for pcapng parsing set fd [open [run_dir]/genode/check_pcapng.py "w"] puts $fd { import sys import pcapng with open(sys.argv[1], "rb") as fp: scanner = pcapng.FileScanner(fp) for block in pcapng.FileScanner(fp): pass } close $fd set pcap_file [exec find bin/fs -name nic_router.pcapng] exec test -s $pcap_file # check generated trace by python script exec python [run_dir]/genode/check_pcapng.py $pcap_file