2018-10-01 14:53:37 +00:00
|
|
|
#
|
2018-12-19 14:07:46 +00:00
|
|
|
# Integration of Depot Autopilot into a Run-tool-based test infrastructure
|
2018-10-01 14:53:37 +00:00
|
|
|
#
|
2018-12-19 14:07:46 +00:00
|
|
|
# For a detailed documentation of the user interface and the features of this
|
|
|
|
# Run script please see _repos/gems/src/app/depot_autopilot/README_.
|
2018-10-01 14:53:37 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
##############################################################
|
|
|
|
## Local copies of run tool procedures with small adaptions ##
|
|
|
|
## ##
|
|
|
|
## FIXME: Adapt original and remove local copies ##
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
proc autopilot_wait_for_output { wait_for_re timeout_value running_spawn_id } {
|
|
|
|
global output
|
2018-12-07 12:48:49 +00:00
|
|
|
global run_genode_failed
|
2018-10-01 14:53:37 +00:00
|
|
|
|
|
|
|
if {$wait_for_re == "forever"} {
|
|
|
|
set timeout -1
|
|
|
|
interact {
|
|
|
|
\003 {
|
|
|
|
send_user "Expect: 'interact' received 'strg+c' and was cancelled\n";
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
-i $running_spawn_id
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
set timeout $timeout_value
|
|
|
|
}
|
|
|
|
|
|
|
|
set platform_msg [run_boot_string]
|
|
|
|
if {$platform_msg eq ""} {
|
|
|
|
set platform_msg "undefined platform command startup string sequence"
|
|
|
|
}
|
|
|
|
|
|
|
|
expect {
|
|
|
|
-i $running_spawn_id $platform_msg { puts stderr "Error: platform rebooted unexpectedly"; exit -4 }
|
|
|
|
-i $running_spawn_id -re $wait_for_re { }
|
2018-12-05 15:13:57 +00:00
|
|
|
|
2019-01-07 19:42:43 +00:00
|
|
|
# sel4
|
|
|
|
-i $running_spawn_id -re {Error: ~Cnode - not implemented.*?\n} {
|
|
|
|
puts stderr "Error: Core presumably went out of resources";
|
|
|
|
set run_genode_failed 1
|
|
|
|
return
|
|
|
|
}
|
2018-12-05 15:13:57 +00:00
|
|
|
# pistachio kernel fault
|
2019-01-07 19:42:43 +00:00
|
|
|
-i $running_spawn_id -re {--- "KD# Exception caught" ---.*?\n} {
|
2018-12-05 15:13:57 +00:00
|
|
|
puts stderr "Error: Kernel fault";
|
2018-12-07 12:48:49 +00:00
|
|
|
set run_genode_failed 1
|
2018-12-05 15:13:57 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
# sel4 unknown fault caught by core
|
2019-01-07 19:42:43 +00:00
|
|
|
-i $running_spawn_id -re {Error: unexpected exception during fault.*?stopped.*?\n} {
|
2018-12-05 15:13:57 +00:00
|
|
|
puts stderr "Error: Unknown fault";
|
2018-12-07 12:48:49 +00:00
|
|
|
set run_genode_failed 1
|
|
|
|
return
|
2018-12-05 15:13:57 +00:00
|
|
|
}
|
|
|
|
# can happen, for instance, on socat TCP-timeout
|
2018-12-05 12:30:03 +00:00
|
|
|
eof {
|
|
|
|
puts stderr "Error: Spawned process died unexpectedly";
|
2018-12-07 12:48:49 +00:00
|
|
|
set run_genode_failed 1
|
2018-12-05 12:30:03 +00:00
|
|
|
return
|
|
|
|
}
|
2018-10-01 14:53:37 +00:00
|
|
|
timeout {
|
|
|
|
puts stderr "Error: Test execution timed out";
|
2018-12-07 12:48:49 +00:00
|
|
|
set run_genode_failed 1
|
2018-10-01 14:53:37 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
append output $expect_out(buffer)
|
|
|
|
}
|
|
|
|
|
|
|
|
proc autopilot_create_tar_from_depot_binaries { archive_path args } {
|
|
|
|
|
|
|
|
# filter out api and src archives from requested depot content
|
|
|
|
set content {}
|
|
|
|
foreach subdir [_collect_from_depot $args] {
|
|
|
|
if {[regexp [_depot_archive_versioned_path_pattern] $subdir dummy user type]} {
|
|
|
|
if {$type == "src"} continue;
|
|
|
|
if {$type == "api"} continue;
|
|
|
|
}
|
|
|
|
lappend content $subdir
|
|
|
|
}
|
|
|
|
|
|
|
|
check_for_missing_depot_archives
|
|
|
|
|
|
|
|
eval "exec tar cf $archive_path -T /dev/null -C [depot_dir] [lsort -unique $content]"
|
|
|
|
}
|
|
|
|
|
|
|
|
proc autopilot_run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
|
|
|
|
#
|
|
|
|
# If a running_spawn_id is specified, wait for the expected output
|
|
|
|
#
|
|
|
|
if {$running_spawn_id != -1} {
|
|
|
|
autopilot_wait_for_output $wait_for_re $timeout_value $running_spawn_id
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
set retry 3
|
|
|
|
while { $retry != 0 } {
|
|
|
|
|
2019-02-01 10:50:08 +00:00
|
|
|
if {![run_power_cycle]} {
|
|
|
|
puts "Power cycle step failed, retry."
|
2018-10-01 14:53:37 +00:00
|
|
|
sleep 3
|
|
|
|
incr retry -1;
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
if {![run_load]} {
|
|
|
|
puts "Load step failed, retry."
|
|
|
|
|
|
|
|
# kill the spawned load process if there is one
|
|
|
|
if {[load_spawn_id] != -1} {
|
2019-09-26 12:51:39 +00:00
|
|
|
kill_spawned [load_spawn_id]
|
2018-10-01 14:53:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
incr retry -1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if {![run_log $wait_for_re $timeout_value]} {
|
|
|
|
puts "Log step failed, retry."
|
|
|
|
incr retry -1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
puts stderr "Boot process failed 3 times in series. I give up!";
|
|
|
|
exit -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
########################
|
|
|
|
## Utility procedures ##
|
|
|
|
########################
|
|
|
|
|
2018-11-26 14:04:57 +00:00
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Whether the run script is used interactively
|
|
|
|
#
|
|
|
|
proc interactive {} {
|
|
|
|
return [expr ![get_cmd_switch --autopilot]]
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-03 16:05:03 +00:00
|
|
|
#
|
|
|
|
# Get value of an environment variable
|
|
|
|
#
|
|
|
|
proc get_env_var { var_name default_value } {
|
|
|
|
if {[info exists ::env($var_name)]} {
|
|
|
|
return $::env($var_name)
|
|
|
|
}
|
|
|
|
return $default_value
|
|
|
|
}
|
|
|
|
|
2018-10-01 14:53:37 +00:00
|
|
|
#
|
|
|
|
# Check if archives are available without doing anything with them
|
|
|
|
#
|
|
|
|
proc check_archives_available { args } {
|
|
|
|
|
|
|
|
# filter out api and src archives from requested depot content
|
|
|
|
set content {}
|
|
|
|
foreach subdir [_collect_from_depot $args] {
|
|
|
|
if {[regexp [_depot_archive_versioned_path_pattern] $subdir dummy user type]} {
|
|
|
|
if {$type == "src"} continue;
|
|
|
|
if {$type == "api"} continue;
|
|
|
|
}
|
|
|
|
lappend content $subdir
|
|
|
|
}
|
|
|
|
|
|
|
|
check_for_missing_depot_archives
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Return routes for boot modules that shall overlay the test-depot content
|
|
|
|
#
|
|
|
|
proc single_test_module_routes { } {
|
|
|
|
|
2018-12-03 16:05:03 +00:00
|
|
|
global test_modules
|
2018-10-01 14:53:37 +00:00
|
|
|
set result ""
|
2018-12-03 16:05:03 +00:00
|
|
|
foreach module $test_modules {
|
2018-10-01 14:53:37 +00:00
|
|
|
append result {
|
|
|
|
<service name="ROM" label_last="} $module {"> <parent/> </service>}
|
|
|
|
}
|
|
|
|
return $result
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Return autopilot start-nodes for the test packages that shall be run
|
|
|
|
#
|
|
|
|
proc test_pkgs_start_nodes { } {
|
|
|
|
|
|
|
|
global test_pkgs
|
|
|
|
|
|
|
|
set result ""
|
|
|
|
foreach test_pkg $test_pkgs {
|
2019-01-17 14:03:41 +00:00
|
|
|
if {[skip_test $test_pkg]} {
|
2018-10-01 14:53:37 +00:00
|
|
|
append result {
|
|
|
|
<start name="} $test_pkg {" skip="true"/>}
|
|
|
|
} else {
|
|
|
|
append result {
|
2018-11-26 14:04:57 +00:00
|
|
|
<start name="} $test_pkg {" pkg="} [depot_user] {/pkg/} $test_pkg {/} [_current_depot_archive_version pkg $test_pkg] {"/>}
|
2018-10-01 14:53:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return $result
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Prepare to call run_genode_until (again, with a changed setup)
|
|
|
|
#
|
|
|
|
proc prepare_to_run_genode { } {
|
|
|
|
|
|
|
|
global output
|
|
|
|
global qemu_args
|
|
|
|
global previous_results
|
|
|
|
global previous_time_ms
|
2018-11-19 13:04:55 +00:00
|
|
|
global previous_succeeded
|
|
|
|
global previous_failed
|
|
|
|
global previous_skipped
|
2018-10-01 14:53:37 +00:00
|
|
|
global test_pkgs
|
2018-12-03 16:05:03 +00:00
|
|
|
global test_srcs
|
|
|
|
global test_builds
|
|
|
|
global test_modules
|
2018-12-19 14:07:46 +00:00
|
|
|
global test_repeat
|
2018-10-01 14:53:37 +00:00
|
|
|
global last_test_pkg
|
2018-12-07 12:48:49 +00:00
|
|
|
global run_genode_failed
|
2018-10-01 14:53:37 +00:00
|
|
|
global serial_id
|
|
|
|
global timeout
|
2018-12-03 16:33:53 +00:00
|
|
|
global initial_qemu_args
|
2018-10-01 14:53:37 +00:00
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
# reset the QEMU arguments to the value when the run script was entered
|
2018-12-03 16:33:53 +00:00
|
|
|
set qemu_args $initial_qemu_args
|
2018-10-01 14:53:37 +00:00
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
# compose list of the package archives to add to the depot archive
|
|
|
|
set depot_tar_pkg_archives ""
|
2018-10-01 14:53:37 +00:00
|
|
|
foreach test_pkg $test_pkgs {
|
2019-01-17 14:03:41 +00:00
|
|
|
if {![skip_test $test_pkg]} {
|
|
|
|
append depot_tar_pkg_archives " [depot_user]/pkg/$test_pkg "
|
2018-10-01 14:53:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
# compose list of the source archives to add to the depot archive
|
|
|
|
set depot_tar_src_archives ""
|
|
|
|
foreach test_src $test_srcs {
|
|
|
|
if {![skip_test $test_src]} {
|
|
|
|
append depot_tar_src_archives " [depot_user]/src/$test_src "
|
2018-11-20 13:30:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
# compose list of the archives to import to the boot directory
|
|
|
|
set import_archives ""
|
2018-10-01 14:53:37 +00:00
|
|
|
append import_archives {
|
2018-11-26 14:04:57 +00:00
|
|
|
} [depot_user] {/src/} [base_src] {
|
|
|
|
} [depot_user] {/src/report_rom
|
|
|
|
} [depot_user] {/src/fs_rom
|
|
|
|
} [depot_user] {/src/vfs
|
|
|
|
} [depot_user] {/src/loader
|
|
|
|
} [depot_user] {/src/init
|
|
|
|
} [depot_user] {/src/depot_query
|
2018-10-01 14:53:37 +00:00
|
|
|
}
|
2019-01-17 14:03:41 +00:00
|
|
|
if {![skip_test test-lx_block]} {
|
2018-11-26 14:04:57 +00:00
|
|
|
append import_archives [depot_user] {/raw/test-lx_block }
|
2018-10-01 14:53:37 +00:00
|
|
|
}
|
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
# check existance of all required archives at once
|
|
|
|
set all_archives [concat $depot_tar_pkg_archives \
|
|
|
|
$depot_tar_src_archives \
|
|
|
|
$import_archives]
|
|
|
|
if {[interactive]} {
|
|
|
|
check_archives_available {*}$all_archives
|
|
|
|
} else {
|
|
|
|
check_archives_available {*}$import_archives
|
|
|
|
}
|
2018-10-01 14:53:37 +00:00
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
# create the depot archive in the boot directory
|
|
|
|
create_boot_directory
|
|
|
|
autopilot_create_tar_from_depot_binaries [run_dir]/genode/depot.tar \
|
|
|
|
{*}$depot_tar_pkg_archives
|
2018-11-23 18:04:53 +00:00
|
|
|
set depot_tar_wo_src_size [file size [run_dir]/genode/depot.tar]
|
2019-01-17 14:03:41 +00:00
|
|
|
append_src_and_api_depot_packages_to_tar [run_dir]/genode/depot.tar \
|
|
|
|
{*}$depot_tar_src_archives
|
2018-11-23 18:04:53 +00:00
|
|
|
set depot_tar_size [file size [run_dir]/genode/depot.tar]
|
2019-01-17 14:03:41 +00:00
|
|
|
puts "Depot archive has a size of $depot_tar_size bytes \
|
|
|
|
($depot_tar_wo_src_size bytes without sources)"
|
2018-10-01 14:53:37 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the root-init config
|
|
|
|
#
|
|
|
|
append config {
|
|
|
|
<config prio_levels="2">
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_PORT"/>
|
2018-12-03 12:21:32 +00:00
|
|
|
<service name="IO_MEM"/>
|
2018-10-01 14:53:37 +00:00
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="TRACE"/>
|
|
|
|
</parent-provides>
|
|
|
|
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
|
|
|
<default caps="100"/>
|
|
|
|
|
|
|
|
<start name="timer" priority="0">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Timer"/> </provides>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="report_rom" priority="-1">
|
|
|
|
<binary name="report_rom"/>
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config verbose="no">
|
|
|
|
<policy label="depot_autopilot -> blueprint" report="depot_query -> blueprint"/>
|
|
|
|
<policy label="depot_query -> query" report="depot_autopilot -> query"/>
|
|
|
|
<policy label="dynamic -> config" report="depot_autopilot -> init.config"/>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="vfs" priority="-1">
|
2018-11-20 13:30:49 +00:00
|
|
|
<resource name="RAM" quantum="16M"/>
|
2018-10-01 14:53:37 +00:00
|
|
|
<provides> <service name="File_system"/> </provides>
|
|
|
|
<config>
|
2018-11-20 13:30:49 +00:00
|
|
|
<vfs>
|
|
|
|
<dir name="depot"> <tar name="depot.tar"/> </dir>
|
|
|
|
<dir name="gcov_data"> <ram/> </dir>
|
|
|
|
</vfs>
|
|
|
|
<policy label="depot_query -> depot" root="/depot" />
|
|
|
|
<policy label="fs_rom -> " root="/depot" />
|
|
|
|
<policy label="dynamic -> gcov -> gcov -> depot" root="/depot" />
|
|
|
|
<policy label_suffix=" -> gcov_data" root="/gcov_data" writeable="yes" />
|
2018-10-01 14:53:37 +00:00
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
2018-11-29 17:39:40 +00:00
|
|
|
<start name="fs_rom" priority="-1" caps="300">
|
file_vault: version 23.05
* ARM support and detaching from Ada/SPARK
* Remove all CBE-related code - especially the Ada/SPARK-based CBE library.
* We have no means or motivation of further maintaining big projects in
Ada/SPARK (the core Genode team is native to C++).
* The Genode Ada/SPARK toolchain and runtime don't support ARM so far - an
important architecture for Genode. This would mean extra commitment in
Ada/SPARK.
* We realize that block encryption more and more becomes a fundamental
feature of Genode systems.
* Implement a new block encryption library named Tresor that is inspired by
the design and feature set of the former CBE library and that is entirely
C++ and part of the Genode gems repository.
* The Tresor block encryption is backwards-compatible with the on-disk
data layout of the former CBE block encryption.
* Except from the snapshot management and the "dump" tool, the Tresor
block encryption provides the same feature set as the former CBE block
encryption and accepts the same user requests at the level of the
Tresor library API.
* So far, the Tresor block encryption does not support the creation of
user-defined snapshots.
* In contrast to the former CBE, the Tresor ecosystem has
no "dump" tool beause with the CBE library it turned out to be rarely of
use.
* In contrast to the Block back-end of the CBE "init" tool, the Tresor
"init" tool uses a File System back-end.
* The former CBE VFS-plugin is replaced with a new Tresor VFS-Plugin.
* The Tresor-VFS plugin in general is similar to the former CBE VFS but
has a slightly different API when it comes to re-keying and re-sizing.
Each of these operations now is controlled via two files. The first
file is named <operation> and the user writes the start command to it.
The user must then read this file once in order to drive the operation.
The read returns the result of the operation, once it is finished.
The second file is named <operation>_progress and can be watched and
read for obtaining the progress of the operation as percentage.
* The file vault is adapted to use the new Tresor ecosystem
instead of the former CBE ecosystem and thereby also gains ARM support.
* The former CBE tester and CBE VFS-tests are replaced by equivalent
Tresor variants and are now run on ARM as well (testing with a persistent
storage back-end is supported only when running on Linux).
* So far, the new Tresor block encryption has no internal cache for meta
data blocks like the former CBE.
* Add config/report user interface
* Add a second option for the administration front end to the file vault
named "config and report". With this front end the File Vault communicates
with the user via XML strings. A ROM session is requested for user input
and a Report session for user output. The front end type must be set at
startup via the component config and is a static setting. The graphical
front end that was used up to now is named "menu view" and remains the
default.
* The File Vault can now reflect its internal state and user input ("config
and report" mode only) at the LOG session via two new static config
attributes "verbose_state" and "verbose_ui_config" (both defaulting to
"no").
* The Shutdown button in "menu view" mode is replaced with a Lock button. The
new button doesn't terminate the File Vault but merely lock the encrypted
container and return to a cleared passphrase input. The same transition is
also provided in "config and report" mode.
* The file_vault.run script is replaced with file_vault_menu_view.run and
file_vault_cfg_report.run that address the two front end modes. In contrast
to the former script, which is interactive, the latter script is suitable
for automatic testing.
* There is a new recipe/pkg/test-file_vault_cfg_report that essentially does
the same as file_vault_cfg_report.run but uses the File Vault package and
can be executed with the Depot Autopilot. The new test package is added to
the default test list of depot_autopilot.run
* The File Vault README is updated to the new version of the component and
has gained a chapter "functional description".
* Fixes a regression with the cbe_init_trust_anchor component that prevented
reacting to a failed unlock attempt in the File Vault.
* The new Tresor software Trust Anchor has an optional deterministic mode in
which it replaces the normally randomized symmetric keys with 0. This mode
comes in handy for debugging. However, it should never be activated in
productive systems. When activated, the user is warned extensively on the
LOG that this system mode is insecure.
Ref #4819
2023-05-22 12:37:13 +00:00
|
|
|
<resource name="RAM" quantum="32M"/>
|
2018-10-01 14:53:37 +00:00
|
|
|
<provides> <service name="ROM"/> </provides>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="depot_query" priority="-1">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<config query="rom">
|
|
|
|
<vfs> <dir name="depot"> <fs label="depot"/> </dir> </vfs>
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="query"> <child name="report_rom"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="depot_autopilot" priority="-1">
|
2019-11-18 15:02:30 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
2018-10-01 14:53:37 +00:00
|
|
|
<provides> <service name="LOG"/> </provides>
|
2018-12-19 14:07:46 +00:00
|
|
|
<config repeat="} $test_repeat {" arch="} [depot_spec] {" children_label_prefix="dynamic -> ">
|
2018-10-01 14:53:37 +00:00
|
|
|
<static>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="Timer"/>
|
|
|
|
<service name="TRACE"/>
|
2018-11-20 13:30:49 +00:00
|
|
|
<service name="File_system"/>
|
2018-10-01 14:53:37 +00:00
|
|
|
</parent-provides>
|
|
|
|
</static>
|
|
|
|
<common_routes>
|
|
|
|
|
|
|
|
} [single_test_module_routes] {
|
|
|
|
|
2018-11-20 13:30:49 +00:00
|
|
|
<service name="ROM" label_last="ld.lib.so"> <parent/> </service>
|
|
|
|
<service name="ROM" label_last="init"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="Timer"> <parent/> </service>
|
|
|
|
<service name="RM"> <parent/> </service>
|
|
|
|
<service name="TRACE"> <parent/> </service>
|
|
|
|
<service name="File_system" label="gcov -> depot"> <parent/> </service>
|
|
|
|
<service name="File_system" label_suffix="gcov_data"> <parent/> </service>
|
2018-10-01 14:53:37 +00:00
|
|
|
</common_routes>
|
|
|
|
|
2018-11-19 13:04:55 +00:00
|
|
|
<previous-results time_sec="} [expr ($previous_time_ms + 999) / 1000] {"
|
|
|
|
succeeded="} $previous_succeeded {"
|
|
|
|
skipped="} $previous_skipped {"
|
2018-12-06 14:17:03 +00:00
|
|
|
failed="} $previous_failed {">} [string map {\" .} $previous_results] {</previous-results>
|
2018-10-01 14:53:37 +00:00
|
|
|
|
|
|
|
} [test_pkgs_start_nodes] {
|
|
|
|
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="PD" unscoped_label="depot_autopilot"> <parent/> </service>
|
|
|
|
<service name="CPU" unscoped_label="depot_autopilot"> <parent/> </service>
|
|
|
|
<service name="LOG" unscoped_label="depot_autopilot"> <parent/> </service>
|
|
|
|
<service name="ROM" unscoped_label="depot_autopilot"> <parent/> </service>
|
|
|
|
<service name="ROM" unscoped_label="ld.lib.so"> <parent/> </service>
|
|
|
|
<service name="ROM" label="blueprint"> <child name="report_rom"/> </service>
|
|
|
|
<service name="Report" label="query"> <child name="report_rom"/> </service>
|
|
|
|
<service name="Report" label="init.config"> <child name="report_rom"/> </service>
|
|
|
|
<service name="Timer" label=""> <child name="timer"/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="dynamic" caps="8000" priority="-1">
|
2019-06-05 13:26:46 +00:00
|
|
|
<resource name="RAM" quantum="286M"/>
|
2018-10-01 14:53:37 +00:00
|
|
|
<binary name="init"/>
|
|
|
|
<route>
|
|
|
|
|
|
|
|
} [single_test_module_routes] {
|
|
|
|
|
|
|
|
<service name="ROM" label_last="ld.lib.so"> <parent/> </service>
|
|
|
|
<service name="ROM" label_last="init"> <parent/> </service>
|
|
|
|
<service name="ROM" label="config"> <child name="report_rom"/> </service>
|
|
|
|
<service name="ROM"> <child name="fs_rom"/> </service>
|
|
|
|
<service name="LOG" unscoped_label="dynamic"> <parent/> </service>
|
|
|
|
<service name="LOG"> <child name="depot_autopilot"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
</config>}
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Create the rest of the boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
set build_components { app/depot_autopilot }
|
2018-12-03 16:05:03 +00:00
|
|
|
append build_components $test_builds
|
2018-10-01 14:53:37 +00:00
|
|
|
build $build_components
|
|
|
|
|
|
|
|
import_from_depot {*}$import_archives
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build boot image from boot modules
|
|
|
|
#
|
|
|
|
|
2023-11-17 17:11:02 +00:00
|
|
|
set boot_modules [build_artifacts]
|
2018-12-03 16:05:03 +00:00
|
|
|
append boot_modules $test_modules
|
2018-10-01 14:53:37 +00:00
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
|
|
|
set last_test_pkg ""
|
2018-12-07 12:48:49 +00:00
|
|
|
set run_genode_failed 0
|
2018-10-01 14:53:37 +00:00
|
|
|
set serial_id -1
|
2018-12-04 10:27:39 +00:00
|
|
|
set timeout 40
|
2018-12-03 16:33:53 +00:00
|
|
|
|
2021-11-03 11:21:46 +00:00
|
|
|
append qemu_args " -nographic "
|
2018-10-01 14:53:37 +00:00
|
|
|
}
|
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
|
2018-12-07 12:48:49 +00:00
|
|
|
#
|
|
|
|
# Initialize variables that accumulate test results for possible reboots
|
|
|
|
#
|
|
|
|
proc init_previous_results {} {
|
|
|
|
global previous_results_on_exit
|
|
|
|
global previous_results
|
|
|
|
global previous_time_ms
|
|
|
|
global previous_succeeded
|
|
|
|
global previous_failed
|
|
|
|
global previous_skipped
|
|
|
|
|
|
|
|
set previous_results_on_exit 1
|
|
|
|
set previous_results ""
|
|
|
|
set previous_time_ms 0
|
|
|
|
set previous_succeeded 0
|
|
|
|
set previous_failed 0
|
|
|
|
set previous_skipped 0
|
|
|
|
}
|
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Whether a test shall be skipped or not
|
|
|
|
#
|
|
|
|
proc skip_test { test } {
|
|
|
|
global skip_test
|
|
|
|
if {![info exists skip_test($test)]} {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
return $skip_test($test)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Whether all given archives and the archives they depend on are available
|
|
|
|
#
|
|
|
|
proc archives_available { archives } {
|
|
|
|
|
|
|
|
global _missing_depot_archives
|
|
|
|
set buf $_missing_depot_archives
|
|
|
|
set _missing_depot_archives ""
|
|
|
|
_collect_from_depot $archives
|
|
|
|
set result [expr [llength $_missing_depot_archives] == 0]
|
|
|
|
set _missing_depot_archives $buf
|
|
|
|
return $result
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-19 14:07:46 +00:00
|
|
|
#
|
|
|
|
# Initialize variables that can be configured via the user interface
|
|
|
|
#
|
|
|
|
proc init_test_setting {} {
|
|
|
|
|
|
|
|
global test_pkgs
|
|
|
|
global test_srcs
|
|
|
|
global test_builds
|
|
|
|
global test_modules
|
|
|
|
global test_repeat
|
|
|
|
global default_test_pkgs
|
|
|
|
global default_test_srcs
|
|
|
|
|
|
|
|
#
|
|
|
|
# Initialize the lists of test package-archives, source-archives,
|
|
|
|
# build-targets, and boot-modules to be considered by the run script
|
|
|
|
#
|
2019-01-17 14:03:41 +00:00
|
|
|
set test_pkgs [get_env_var TEST_PKGS "default"]
|
|
|
|
set test_srcs [get_env_var TEST_SRCS "default"]
|
2018-12-19 14:07:46 +00:00
|
|
|
set test_builds [get_env_var TEST_BUILDS ""]
|
|
|
|
set test_modules [get_env_var TEST_MODULES ""]
|
|
|
|
set test_repeat [get_env_var TEST_REPEAT "false"]
|
|
|
|
|
|
|
|
set nr_of_tests_to_run 0
|
2019-01-17 14:03:41 +00:00
|
|
|
|
|
|
|
# initialize list of test package archives
|
|
|
|
if {$test_pkgs == "default"} {
|
|
|
|
set test_pkgs $default_test_pkgs
|
|
|
|
}
|
|
|
|
foreach test_pkg $test_pkgs {
|
|
|
|
if {[skip_test $test_pkg]} {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
incr nr_of_tests_to_run
|
|
|
|
if {[interactive]} {
|
|
|
|
continue
|
2018-12-19 14:07:46 +00:00
|
|
|
}
|
2019-01-17 14:03:41 +00:00
|
|
|
if {[archives_available [depot_user]/pkg/$test_pkg]} {
|
|
|
|
continue
|
2018-12-19 14:07:46 +00:00
|
|
|
}
|
2019-01-17 14:03:41 +00:00
|
|
|
set test_pkgs [lsearch -all -inline -not -exact \
|
|
|
|
$test_pkgs $test_pkg]
|
|
|
|
|
|
|
|
puts stderr "Warning: remove test package of \"$test_pkg\" because of\
|
|
|
|
missing archives"
|
|
|
|
}
|
|
|
|
# initialize list of test source archives
|
|
|
|
if {$test_srcs == "default"} {
|
|
|
|
set test_srcs $default_test_srcs
|
|
|
|
}
|
|
|
|
foreach test_src $test_srcs {
|
|
|
|
if {[skip_test $test_src]} {
|
|
|
|
continue
|
2018-12-19 14:07:46 +00:00
|
|
|
}
|
2019-01-17 14:03:41 +00:00
|
|
|
if {[interactive]} {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if {[archives_available [depot_user]/src/$test_src]} {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
set test_srcs [lsearch -all -inline -not -exact \
|
|
|
|
$test_srcs $test_src]
|
|
|
|
|
|
|
|
puts stderr "Warning: remove test source of \"$test_src\" because of\
|
|
|
|
missing archives"
|
2018-12-19 14:07:46 +00:00
|
|
|
}
|
2019-01-16 15:48:56 +00:00
|
|
|
puts "Number of tests to run: $nr_of_tests_to_run"
|
2018-12-19 14:07:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
#
|
|
|
|
# Overwrite exit procedure to ensure to always print a results overview
|
|
|
|
#
|
2018-12-07 12:48:49 +00:00
|
|
|
rename exit run_tool_exit
|
|
|
|
proc exit {{status 0}} {
|
|
|
|
|
|
|
|
global previous_results_on_exit
|
|
|
|
global previous_results
|
|
|
|
global previous_time_ms
|
|
|
|
global previous_succeeded
|
|
|
|
global previous_failed
|
|
|
|
global previous_skipped
|
|
|
|
|
|
|
|
if {![info exists previous_results_on_exit] || \
|
|
|
|
![info exists previous_results] || \
|
|
|
|
![info exists previous_time_ms] || \
|
|
|
|
![info exists previous_succeeded] || \
|
|
|
|
![info exists previous_failed] || \
|
|
|
|
![info exists previous_skipped]} \
|
|
|
|
{
|
|
|
|
init_previous_results
|
|
|
|
}
|
|
|
|
if {$previous_results_on_exit != 0} {
|
|
|
|
set previous_time_sec [expr $previous_time_ms / 1000]
|
|
|
|
set previous_time_sec_frac [expr $previous_time_ms - $previous_time_sec * 1000]
|
|
|
|
set previous_results_list [split $previous_results "\n"]
|
|
|
|
puts ""
|
|
|
|
puts "Failed to let Depot Autopilot finish!"
|
|
|
|
puts "Result overview simulated by run script:"
|
|
|
|
puts ""
|
|
|
|
puts "\[init -> depot_autopilot] --- Finished after $previous_time_sec.$previous_time_sec_frac sec ---"
|
|
|
|
puts "\[init -> depot_autopilot] "
|
|
|
|
foreach previous_result $previous_results_list {
|
|
|
|
puts "\[init -> depot_autopilot] $previous_result"
|
|
|
|
}
|
|
|
|
puts "\[init -> depot_autopilot] "
|
|
|
|
puts "\[init -> depot_autopilot] succeeded: $previous_succeeded failed: $previous_failed skipped: $previous_skipped"
|
|
|
|
puts "\[init -> depot_autopilot] "
|
|
|
|
}
|
|
|
|
run_tool_exit $status
|
|
|
|
}
|
|
|
|
|
2018-10-01 14:53:37 +00:00
|
|
|
|
|
|
|
##################
|
|
|
|
## Main routine ##
|
|
|
|
##################
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check platform support
|
|
|
|
#
|
|
|
|
if {[expr ![have_spec x86] && \
|
2018-11-30 10:18:24 +00:00
|
|
|
![have_spec arm_v6] && \
|
2019-05-21 12:02:45 +00:00
|
|
|
![have_spec arm_v7a] && \
|
2021-12-16 16:03:40 +00:00
|
|
|
![have_spec arm_v8a] && \
|
|
|
|
![have_spec riscv]]} \
|
2018-10-01 14:53:37 +00:00
|
|
|
{
|
|
|
|
puts "\n Run script is not supported on this platform. \n";
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2018-12-04 17:48:51 +00:00
|
|
|
#
|
|
|
|
# Default list of test package-archives
|
|
|
|
#
|
|
|
|
# Was obtained by issuing:
|
|
|
|
#
|
|
|
|
# ! cd <GENODE_DIR>/repos
|
|
|
|
# ! find . -type d -wholename *recipes/pkg/test-* -printf '%f\n' | sort
|
|
|
|
#
|
|
|
|
set default_test_pkgs {
|
2019-01-29 17:01:47 +00:00
|
|
|
test-spark
|
|
|
|
test-spark_exception
|
|
|
|
test-spark_secondary_stack
|
2022-02-11 11:16:29 +00:00
|
|
|
test-black_hole
|
2018-12-04 17:48:51 +00:00
|
|
|
test-clipboard
|
2019-02-20 13:04:22 +00:00
|
|
|
test-depot_query_index
|
2018-12-04 17:48:51 +00:00
|
|
|
test-ds_ownership
|
|
|
|
test-dynamic_config
|
|
|
|
test-dynamic_config_loader
|
2020-03-23 14:44:24 +00:00
|
|
|
test-entrypoint
|
2018-12-04 17:48:51 +00:00
|
|
|
test-expat
|
|
|
|
test-fault_detection
|
file_vault: version 23.05
* ARM support and detaching from Ada/SPARK
* Remove all CBE-related code - especially the Ada/SPARK-based CBE library.
* We have no means or motivation of further maintaining big projects in
Ada/SPARK (the core Genode team is native to C++).
* The Genode Ada/SPARK toolchain and runtime don't support ARM so far - an
important architecture for Genode. This would mean extra commitment in
Ada/SPARK.
* We realize that block encryption more and more becomes a fundamental
feature of Genode systems.
* Implement a new block encryption library named Tresor that is inspired by
the design and feature set of the former CBE library and that is entirely
C++ and part of the Genode gems repository.
* The Tresor block encryption is backwards-compatible with the on-disk
data layout of the former CBE block encryption.
* Except from the snapshot management and the "dump" tool, the Tresor
block encryption provides the same feature set as the former CBE block
encryption and accepts the same user requests at the level of the
Tresor library API.
* So far, the Tresor block encryption does not support the creation of
user-defined snapshots.
* In contrast to the former CBE, the Tresor ecosystem has
no "dump" tool beause with the CBE library it turned out to be rarely of
use.
* In contrast to the Block back-end of the CBE "init" tool, the Tresor
"init" tool uses a File System back-end.
* The former CBE VFS-plugin is replaced with a new Tresor VFS-Plugin.
* The Tresor-VFS plugin in general is similar to the former CBE VFS but
has a slightly different API when it comes to re-keying and re-sizing.
Each of these operations now is controlled via two files. The first
file is named <operation> and the user writes the start command to it.
The user must then read this file once in order to drive the operation.
The read returns the result of the operation, once it is finished.
The second file is named <operation>_progress and can be watched and
read for obtaining the progress of the operation as percentage.
* The file vault is adapted to use the new Tresor ecosystem
instead of the former CBE ecosystem and thereby also gains ARM support.
* The former CBE tester and CBE VFS-tests are replaced by equivalent
Tresor variants and are now run on ARM as well (testing with a persistent
storage back-end is supported only when running on Linux).
* So far, the new Tresor block encryption has no internal cache for meta
data blocks like the former CBE.
* Add config/report user interface
* Add a second option for the administration front end to the file vault
named "config and report". With this front end the File Vault communicates
with the user via XML strings. A ROM session is requested for user input
and a Report session for user output. The front end type must be set at
startup via the component config and is a static setting. The graphical
front end that was used up to now is named "menu view" and remains the
default.
* The File Vault can now reflect its internal state and user input ("config
and report" mode only) at the LOG session via two new static config
attributes "verbose_state" and "verbose_ui_config" (both defaulting to
"no").
* The Shutdown button in "menu view" mode is replaced with a Lock button. The
new button doesn't terminate the File Vault but merely lock the encrypted
container and return to a cleared passphrase input. The same transition is
also provided in "config and report" mode.
* The file_vault.run script is replaced with file_vault_menu_view.run and
file_vault_cfg_report.run that address the two front end modes. In contrast
to the former script, which is interactive, the latter script is suitable
for automatic testing.
* There is a new recipe/pkg/test-file_vault_cfg_report that essentially does
the same as file_vault_cfg_report.run but uses the File Vault package and
can be executed with the Depot Autopilot. The new test package is added to
the default test list of depot_autopilot.run
* The File Vault README is updated to the new version of the component and
has gained a chapter "functional description".
* Fixes a regression with the cbe_init_trust_anchor component that prevented
reacting to a failed unlock attempt in the File Vault.
* The new Tresor software Trust Anchor has an optional deterministic mode in
which it replaces the normally randomized symmetric keys with 0. This mode
comes in handy for debugging. However, it should never be activated in
productive systems. When activated, the user is warned extensively on the
LOG that this system mode is insecure.
Ref #4819
2023-05-22 12:37:13 +00:00
|
|
|
test-file_vault_config_report
|
2023-06-01 13:56:07 +00:00
|
|
|
test-file_vault_config_report_no_entropy
|
2018-12-04 17:48:51 +00:00
|
|
|
test-fs_packet
|
|
|
|
test-fs_report
|
|
|
|
test-fs_rom_update
|
|
|
|
test-fs_rom_update_fs
|
|
|
|
test-fs_rom_update_ram
|
2019-03-12 14:03:01 +00:00
|
|
|
test-fs_tool
|
2018-12-04 17:48:51 +00:00
|
|
|
test-init
|
|
|
|
test-init_loop
|
|
|
|
test-ldso
|
|
|
|
test-libc
|
2019-01-10 16:47:16 +00:00
|
|
|
test-libc_connect_lwip
|
|
|
|
test-libc_connect_lxip
|
|
|
|
test-libc_connect_vfs_server_lwip
|
|
|
|
test-libc_connect_vfs_server_lxip
|
2018-12-04 17:48:51 +00:00
|
|
|
test-libc_counter
|
2020-03-05 15:51:20 +00:00
|
|
|
test-libc_execve
|
2020-10-16 17:29:21 +00:00
|
|
|
test-libc_fifo_pipe
|
2020-03-05 16:02:09 +00:00
|
|
|
test-libc_fork
|
2018-12-04 17:48:51 +00:00
|
|
|
test-libc_getenv
|
|
|
|
test-libc_pipe
|
|
|
|
test-libc_vfs
|
|
|
|
test-libc_vfs_audit
|
|
|
|
test-libc_vfs_block
|
|
|
|
test-libc_vfs_counter
|
|
|
|
test-libc_vfs_fs
|
|
|
|
test-libc_vfs_fs_chained
|
|
|
|
test-libc_vfs_ram
|
|
|
|
test-log
|
|
|
|
test-lx_block
|
|
|
|
test-mmio
|
|
|
|
test-new_delete
|
|
|
|
test-nic_loopback
|
2019-01-06 20:17:07 +00:00
|
|
|
test-part_block_gpt
|
|
|
|
test-part_block_mbr
|
2023-03-14 14:07:13 +00:00
|
|
|
test-pipe_read_ready
|
2018-12-04 17:48:51 +00:00
|
|
|
test-pthread
|
|
|
|
test-ram_fs_chunk
|
|
|
|
test-read_only_rom
|
|
|
|
test-reconstructible
|
|
|
|
test-registry
|
|
|
|
test-report_rom
|
|
|
|
test-resource_request
|
|
|
|
test-resource_yield
|
|
|
|
test-rm_fault
|
|
|
|
test-rm_fault_no_nox
|
|
|
|
test-rm_nested
|
2020-04-03 13:51:36 +00:00
|
|
|
test-rm_stress
|
2018-12-04 17:48:51 +00:00
|
|
|
test-rom_filter
|
2021-03-09 09:51:49 +00:00
|
|
|
test-sandbox
|
2018-12-06 04:19:19 +00:00
|
|
|
test-sanitizer
|
2018-12-04 17:48:51 +00:00
|
|
|
test-sequence
|
|
|
|
test-signal
|
|
|
|
test-slab
|
2018-12-05 13:51:34 +00:00
|
|
|
test-stack_smash
|
2018-12-04 17:48:51 +00:00
|
|
|
test-stdcxx
|
|
|
|
test-synced_interface
|
|
|
|
test-tcp_bulk_lwip
|
|
|
|
test-tcp_bulk_lxip
|
|
|
|
test-terminal_crosslink
|
|
|
|
test-timer
|
2019-06-14 21:14:32 +00:00
|
|
|
test-tls
|
2020-05-07 19:23:07 +00:00
|
|
|
test-token
|
2018-12-04 17:48:51 +00:00
|
|
|
test-trace
|
2022-02-17 10:59:59 +00:00
|
|
|
test-trace_buffer
|
2018-12-04 17:48:51 +00:00
|
|
|
test-trace_logger
|
|
|
|
test-utf8
|
2020-06-16 09:05:34 +00:00
|
|
|
test-vfs_block
|
2018-12-04 17:48:51 +00:00
|
|
|
test-vfs_stress_fs
|
|
|
|
test-vfs_stress_ram
|
|
|
|
test-weak_ptr
|
|
|
|
test-xml_generator
|
|
|
|
test-xml_node
|
|
|
|
gcov
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Default list of test source-archives
|
|
|
|
#
|
|
|
|
set default_test_srcs {
|
|
|
|
test-xml_generator
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Whether the platform supports non-executable dataspaces
|
|
|
|
#
|
|
|
|
proc non_executable_supported { } {
|
|
|
|
if {[have_spec hw] && [have_spec x86_64]} { return true }
|
|
|
|
if {[have_spec hw] && [have_spec arm]} { return true }
|
|
|
|
if {[have_spec nova] && [have_spec x86_64]} { return true }
|
|
|
|
if {[have_spec foc] && [have_spec x86_64]} { return true }
|
|
|
|
if {[have_spec foc] && [have_spec arm]} { return true }
|
|
|
|
if {[have_spec sel4] && [have_spec arm]} { return true }
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2023-06-01 13:56:07 +00:00
|
|
|
proc skip_test_if { condition test } {
|
|
|
|
|
|
|
|
global skip_test
|
|
|
|
if {$condition} {
|
|
|
|
set skip_test($test) true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-04 17:48:51 +00:00
|
|
|
#
|
|
|
|
# Whether to skip a test - if undefined for a test, the test is not skipped
|
|
|
|
#
|
2023-06-01 13:56:07 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# pbxa9 and zynq_qemu don't support jitterentropy
|
|
|
|
#
|
|
|
|
skip_test_if [expr ([have_board pbxa9] || [have_board zynq_qemu])] test-file_vault_config_report
|
|
|
|
skip_test_if [expr !([have_board pbxa9] || [have_board zynq_qemu])] test-file_vault_config_report_no_entropy
|
|
|
|
|
tresor: do not use on-disc-layouted structs
* Removes all previous structs that represented an on-disc block layout
and were therfore subject to a number of layout restrictions (packed,
padding members, enum representations, etc.).
* Adds a replacement struct without any layout restrictions for each of the
removed structs. The new structs are named similar to the old structs.
* Adds block encoding and decoding utilities for easily converting from the
new structs to on-disc blocks and vice-versa (Block_scanner, Block_generator,
T::decode_to_blk, T::encode_from_blk)
* Adapts all affected places in the library to encode and decode proberly
instead of simply casting pointers.
* Thereby cleans up the hashing utilities to use typed-reference args instead
of void pointers.
* Re-enables run/tresor_tester and test-file_vault_vonfig_report for platforms
rpi, imx53_qsb, imx53_qsb_tz, imx6q_sabrelite, imx7d_sabre.
Ref #4819
2023-06-09 11:50:34 +00:00
|
|
|
# rpi has a quite limited amount of RAM
|
|
|
|
skip_test_if [have_board rpi] test-file_vault_config_report
|
|
|
|
skip_test_if [have_board rpi] test-file_vault_config_report_no_entropy
|
2023-06-01 13:56:07 +00:00
|
|
|
|
2019-01-17 14:03:41 +00:00
|
|
|
set skip_test(test-fault_detection) [expr [have_spec pistachio] || [have_spec fiasco]]
|
2020-03-03 11:29:23 +00:00
|
|
|
set skip_test(test-fs_packet) [expr ![interactive] && [have_include "power_on/qemu"]]
|
2022-09-21 13:32:55 +00:00
|
|
|
set skip_test(test-libc) [expr [have_spec sel4] || [have_board rpi] || [have_board imx53_qsb_tz]]
|
2021-01-13 09:15:10 +00:00
|
|
|
set skip_test(test-lx_block) [expr ![have_board linux]]
|
|
|
|
set skip_test(test-rm_fault) [expr [have_board linux] || ![non_executable_supported]]
|
|
|
|
set skip_test(test-rm_fault_no_nox) [expr [have_board linux] || ![skip_test test-rm_fault]]
|
|
|
|
set skip_test(test-rm_nested) [expr [have_board linux]]
|
2019-06-12 08:25:52 +00:00
|
|
|
set skip_test(test-slab) [expr ![interactive] && [have_include "power_on/qemu"]]
|
2019-06-11 08:35:36 +00:00
|
|
|
set skip_test(test-spark_exception) [expr [have_spec arm]]
|
2019-12-18 15:09:04 +00:00
|
|
|
set skip_test(test-tcp_bulk_lwip) [expr ![have_spec x86] && ![have_include "power_on/qemu"]]
|
|
|
|
set skip_test(test-tcp_bulk_lxip) [expr ![have_spec x86] && ![have_include "power_on/qemu"]]
|
2018-12-04 17:48:51 +00:00
|
|
|
|
2022-09-21 13:32:55 +00:00
|
|
|
if {[have_spec foc]} {
|
|
|
|
set skip_test(test-entrypoint) [have_board pbxa9]
|
|
|
|
set skip_test(test-libc) [have_board pbxa9]
|
|
|
|
set skip_test(test-tcp_bulk_lxip) [have_board pbxa9]
|
2023-07-06 07:29:20 +00:00
|
|
|
# foc on pbxa9 caps RAM at 256 MiB - skip tests with excessive RAM demand
|
|
|
|
skip_test_if [have_board pbxa9] test-file_vault_config_report
|
|
|
|
skip_test_if [have_board pbxa9] test-file_vault_config_report_no_entropy
|
2022-09-21 13:32:55 +00:00
|
|
|
}
|
2021-12-16 16:03:40 +00:00
|
|
|
if {[have_spec riscv]} {
|
|
|
|
set skip_test(gcov) true
|
|
|
|
set skip_test(test-libc_connect_lxip) true
|
|
|
|
set skip_test(test-libc_connect_vfs_server_lxip) true
|
2022-09-21 12:45:39 +00:00
|
|
|
set skip_test(test-rm_fault_no_nox) true
|
2021-12-16 16:03:40 +00:00
|
|
|
set skip_test(test-spark) true
|
|
|
|
set skip_test(test-spark_exception) true
|
|
|
|
set skip_test(test-spark_secondary_stack) true
|
|
|
|
set skip_test(test-tcp_bulk_lxip) true
|
2022-09-21 12:45:39 +00:00
|
|
|
set skip_test(test-trace_logger) true
|
2021-12-16 16:03:40 +00:00
|
|
|
set skip_test(test-xml_generator) true
|
2023-05-30 09:32:01 +00:00
|
|
|
set skip_test(test-file_vault_config_report) true
|
2021-12-16 16:03:40 +00:00
|
|
|
}
|
|
|
|
|
2018-12-04 17:48:51 +00:00
|
|
|
#
|
|
|
|
# FIXME
|
|
|
|
#
|
|
|
|
# When doing the libc_getenv test on autopilot+foc+x86 and one of the
|
|
|
|
# subsequent tests crashes the system so it gets rebooted by the run script,
|
|
|
|
# the system doesn't come up again. It gets stuck after core initialization.
|
|
|
|
#
|
2019-06-12 08:25:52 +00:00
|
|
|
set skip_test(test-libc_getenv) [expr ![interactive] && [have_spec foc] && [have_spec x86]]
|
2018-12-04 17:48:51 +00:00
|
|
|
|
2018-12-03 16:33:53 +00:00
|
|
|
# remember initial qemu args in case we have to re-boot later
|
|
|
|
set initial_qemu_args ""
|
|
|
|
if {[info exists qemu_args]} {
|
|
|
|
set initial_qemu_args $qemu_args
|
|
|
|
}
|
|
|
|
|
2018-12-19 14:07:46 +00:00
|
|
|
# initialize global variables
|
|
|
|
init_test_setting
|
2018-12-07 12:48:49 +00:00
|
|
|
init_previous_results
|
2018-11-20 13:30:49 +00:00
|
|
|
|
2019-06-07 11:59:29 +00:00
|
|
|
#
|
|
|
|
# Some platforms have a problem with executing all tests in a single boot.
|
|
|
|
# Thus, we have to re-boot them periodically.
|
|
|
|
#
|
|
|
|
set max_nr_of_tests_per_boot 0
|
|
|
|
if {[have_spec sel4]} {
|
|
|
|
set max_nr_of_tests_per_boot 20
|
|
|
|
}
|
|
|
|
|
2018-12-03 16:05:03 +00:00
|
|
|
# generic preparation for each system boot
|
2018-10-01 14:53:37 +00:00
|
|
|
prepare_to_run_genode
|
|
|
|
|
|
|
|
while {1} {
|
|
|
|
|
2019-06-07 11:59:29 +00:00
|
|
|
# check whether the system is already running
|
2018-10-01 14:53:37 +00:00
|
|
|
if {$serial_id == -1} {
|
2019-06-07 11:59:29 +00:00
|
|
|
|
|
|
|
# boot the system and wait for the depot autopilot to come up
|
2018-12-07 12:48:49 +00:00
|
|
|
autopilot_run_genode_until {depot_autopilot\] --- .*?\n} $timeout
|
|
|
|
set serial_id [output_spawn_id]
|
2019-06-07 11:59:29 +00:00
|
|
|
set nr_of_tests_this_boot 0
|
2018-12-07 12:48:49 +00:00
|
|
|
|
|
|
|
# if the system didn't even boot, exit (prints previous results)
|
|
|
|
if {$run_genode_failed} {
|
|
|
|
exit -1
|
|
|
|
}
|
2018-10-01 14:53:37 +00:00
|
|
|
} else {
|
2019-06-07 11:59:29 +00:00
|
|
|
|
|
|
|
# wait for the next step of the depot autopilot
|
2018-10-01 14:53:37 +00:00
|
|
|
set init_time_ms [clock clicks -millisec]
|
|
|
|
autopilot_run_genode_until {depot_autopilot\] --- .*?\n} $timeout $serial_id
|
|
|
|
set previous_time_ms [expr $previous_time_ms + [expr ([clock clicks -millisec] - $init_time_ms)] ]
|
2018-12-07 12:48:49 +00:00
|
|
|
set serial_id [output_spawn_id]
|
|
|
|
|
|
|
|
# remove last test from list and check if we have to reboot the system
|
2018-10-01 14:53:37 +00:00
|
|
|
set test_pkgs [lsearch -all -inline -not -exact $test_pkgs $last_test_pkg]
|
2018-12-07 12:48:49 +00:00
|
|
|
if {$run_genode_failed} {
|
2018-10-01 14:53:37 +00:00
|
|
|
|
|
|
|
# shut-down running system
|
2019-09-26 12:51:39 +00:00
|
|
|
kill_spawned $serial_id
|
2018-11-20 15:34:31 +00:00
|
|
|
run_power_off
|
2018-10-01 14:53:37 +00:00
|
|
|
|
|
|
|
# remember result of last test
|
|
|
|
if {$previous_results != ""} {
|
|
|
|
append previous_results \012
|
|
|
|
}
|
|
|
|
append previous_results { } [format {%-31s %-6s %7s} $last_test_pkg "failed " "$timeout.000"] { reboot}
|
2018-11-19 13:04:55 +00:00
|
|
|
incr previous_failed
|
2018-10-01 14:53:37 +00:00
|
|
|
|
|
|
|
# prepare system re-boot
|
|
|
|
prepare_to_run_genode
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# if the autopilot finished all tests, evaluate its return value
|
|
|
|
if {[regexp {depot_autopilot\] --- Finished} $output]} {
|
|
|
|
set output ""
|
|
|
|
run_genode_until {child "depot_autopilot" exited with exit value.*?\n} 10 $serial_id
|
2018-12-07 12:48:49 +00:00
|
|
|
set previous_results_on_exit 0
|
2018-10-01 14:53:37 +00:00
|
|
|
grep_output {^\[init\] }
|
|
|
|
compare_output_to {[init] child "depot_autopilot" exited with exit value 0}
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
# if the autopilot started a new test, set a new timeout
|
|
|
|
if {[regexp {depot_autopilot\] --- Run} $output]} {
|
|
|
|
|
2019-06-07 11:59:29 +00:00
|
|
|
# if we ran and finished another test beforehand, parse its result
|
2018-10-01 14:53:37 +00:00
|
|
|
if {$last_test_pkg != ""} {
|
|
|
|
|
|
|
|
# remember result of last test in case the system must be restartet
|
|
|
|
set last_test_result ""
|
|
|
|
regexp {depot_autopilot\] ( [^\033]+)} $output ignored last_test_result
|
|
|
|
regsub -all {<} $last_test_result {\<} last_test_result
|
2018-11-19 13:04:55 +00:00
|
|
|
|
|
|
|
set failed_off [string first " failed" $last_test_result]
|
|
|
|
set skipped_off [string first " skipped" $last_test_result]
|
|
|
|
set ok_off [string first " ok" $last_test_result]
|
|
|
|
|
|
|
|
if {$failed_off > 0 && ($skipped_off < 0 || $failed_off < $skipped_off) && ($ok_off < 0 || $failed_off < $ok_off)} {
|
|
|
|
incr previous_failed
|
|
|
|
} elseif {$skipped_off > 0 && ($ok_off < 0 || $skipped_off < $ok_off)} {
|
|
|
|
incr previous_skipped
|
|
|
|
} elseif {$ok_off > 0} {
|
|
|
|
incr previous_succeeded
|
|
|
|
} else {
|
|
|
|
puts "Error: malformed test result"
|
|
|
|
puts $last_test_result
|
|
|
|
exit -1
|
|
|
|
}
|
2018-10-01 14:53:37 +00:00
|
|
|
if {$previous_results != ""} {
|
|
|
|
append previous_results \012
|
|
|
|
}
|
|
|
|
append previous_results $last_test_result
|
2019-06-07 11:59:29 +00:00
|
|
|
incr nr_of_tests_this_boot
|
2018-10-01 14:53:37 +00:00
|
|
|
}
|
2018-12-19 14:07:46 +00:00
|
|
|
# if the Autopilot is currently repeating, reset repeat-influenced variables
|
|
|
|
if {[llength $test_pkgs] == 0} {
|
|
|
|
init_test_setting
|
|
|
|
init_previous_results
|
|
|
|
}
|
2018-10-01 14:53:37 +00:00
|
|
|
# determine timeout for the next timeout
|
2019-06-07 12:21:44 +00:00
|
|
|
set min_timeout 30
|
2018-10-01 14:53:37 +00:00
|
|
|
regexp {depot_autopilot\] --- Run "(.*?)" \(max ([0-9]*?) } $output] ignore last_test_pkg min_timeout
|
2019-06-07 12:21:44 +00:00
|
|
|
set timeout [expr $min_timeout + 30]
|
2018-10-01 14:53:37 +00:00
|
|
|
|
2019-06-07 11:59:29 +00:00
|
|
|
# re-boot if the maximum number of tests per boot is set and reached
|
|
|
|
if { [expr $max_nr_of_tests_per_boot && \
|
|
|
|
$nr_of_tests_this_boot >= $max_nr_of_tests_per_boot] } \
|
|
|
|
{
|
|
|
|
# shut-down running system
|
|
|
|
puts "Re-booting to meet maximum number of tests per boot for this platform"
|
2019-09-26 12:51:39 +00:00
|
|
|
kill_spawned $serial_id
|
2019-06-07 11:59:29 +00:00
|
|
|
run_power_off
|
|
|
|
|
|
|
|
# prepare system re-boot
|
|
|
|
prepare_to_run_genode
|
|
|
|
continue
|
|
|
|
}
|
2018-10-01 14:53:37 +00:00
|
|
|
set output ""
|
|
|
|
}
|
|
|
|
}
|