file_vault: do not consider ui_config version

The version in ui_report and ui_config were merely used for making test output
more readable. However, there are other ways to achieve this goal.

Ref #5190
This commit is contained in:
Martin Stein 2024-04-22 11:45:05 +02:00 committed by Christian Helmuth
parent 2bcc85b5f5
commit d5e3f73884
5 changed files with 35 additions and 128 deletions

View File

@ -6,11 +6,11 @@
<fail after_seconds="70"/> <fail after_seconds="70"/>
<succeed> <succeed>
&lt;ui_report version="step_*" state="uninitialized"* &lt;ui_report state="uninitialized"*
&lt;ui_report version="step_*" state="initializing"* &lt;ui_report state="initializing"*
&lt;ui_report version="step_*" state="unlocked"* &lt;ui_report state="unlocked"*
&lt;ui_report version="step_*" state="locked"* &lt;ui_report state="locked"*
&lt;ui_report version="step_*" state="unlocked"* &lt;ui_report state="unlocked"*
</succeed> </succeed>
<content> <content>
@ -40,43 +40,18 @@
<provides><service name="ROM"/> </provides> <provides><service name="ROM"/> </provides>
<config verbose="no"> <config verbose="no">
<rom name="file_vault_ui_config"> <rom name="file_vault_ui_config">
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_1_wait"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config passphrase="abcdefgh" client_fs_size="1M" journaling_buf_size="1M"/> </inline>
<ui_config version="step_2_init" passphrase="abcdefgh" client_fs_size="1M" journaling_buf_size="1M"/>
</inline>
<sleep milliseconds="10000"/> <sleep milliseconds="10000"/>
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_3_lock"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config passphrase="00000001"/> </inline>
<ui_config version="step_4_bad_unlock" passphrase="00000001"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_5_wait"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config passphrase="abcdefgh"/> </inline>
<ui_config version="step_6_unlock" passphrase="abcdefgh"/>
</inline>
<sleep milliseconds="600000"/> <sleep milliseconds="600000"/>
</rom> </rom>
</config> </config>
<route> <route>

View File

@ -6,11 +6,11 @@
<fail after_seconds="70"/> <fail after_seconds="70"/>
<succeed> <succeed>
&lt;ui_report version="step_*" state="uninitialized"* &lt;ui_report state="uninitialized"*
&lt;ui_report version="step_*" state="initializing"* &lt;ui_report state="initializing"*
&lt;ui_report version="step_*" state="unlocked"* &lt;ui_report state="unlocked"*
&lt;ui_report version="step_*" state="locked"* &lt;ui_report state="locked"*
&lt;ui_report version="step_*" state="unlocked"* &lt;ui_report state="unlocked"*
</succeed> </succeed>
<content> <content>
@ -40,43 +40,18 @@
<provides><service name="ROM"/> </provides> <provides><service name="ROM"/> </provides>
<config verbose="no"> <config verbose="no">
<rom name="file_vault_ui_config"> <rom name="file_vault_ui_config">
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_1_wait"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config passphrase="abcdefgh" client_fs_size="1M" journaling_buf_size="1M"/> </inline>
<ui_config version="step_2_init" passphrase="abcdefgh" client_fs_size="1M" journaling_buf_size="1M"/>
</inline>
<sleep milliseconds="10000"/> <sleep milliseconds="10000"/>
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_3_lock"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config passphrase="00000001"/> </inline>
<ui_config version="step_4_bad_unlock" passphrase="00000001"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_5_wait"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config passphrase="abcdefgh"/> </inline>
<ui_config version="step_6_unlock" passphrase="abcdefgh"/>
</inline>
<sleep milliseconds="600000"/> <sleep milliseconds="600000"/>
</rom> </rom>
</config> </config>
<route> <route>

View File

@ -72,47 +72,20 @@ append config {
<start name="dynamic_rom" caps="100"> <start name="dynamic_rom" caps="100">
<resource name="RAM" quantum="4M"/> <resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/> </provides> <provides><service name="ROM"/> </provides>
<config verbose="no"> <config verbose="yes">
<rom name="file_vault_ui_config"> <rom name="file_vault_ui_config">
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_1_wait"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config passphrase="abcdefgh" client_fs_size="1M" journaling_buf_size="1M"/> </inline>
<ui_config version="step_2_init" passphrase="abcdefgh"
client_fs_size="1M"
journaling_buf_size="1M"/>
</inline>
<sleep milliseconds="10000"/> <sleep milliseconds="10000"/>
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_3_lock"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config passphrase="00000001"/> </inline>
<ui_config version="step_4_bad_unlock" passphrase="00000001"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_5_wait"/>
</inline>
<sleep milliseconds="6000"/> <sleep milliseconds="6000"/>
<inline> <inline> <ui_config passphrase="abcdefgh"/> </inline>
<ui_config version="step_6_unlock" passphrase="abcdefgh"/>
</inline>
<sleep milliseconds="600000"/> <sleep milliseconds="600000"/>
</rom> </rom>
</config> </config>
<route> <route>

View File

@ -110,31 +110,22 @@ append config {
<start name="dynamic_rom" caps="100"> <start name="dynamic_rom" caps="100">
<resource name="RAM" quantum="4M"/> <resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/> </provides> <provides><service name="ROM"/> </provides>
<config> <config verbose="yes">
<rom name="file_vault_ui_config"> <rom name="file_vault_ui_config">
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_1_wait"/>
</inline>
<sleep milliseconds="3000"/> <sleep milliseconds="3000"/>
<inline>} <inline>}
if {[container_initialized]} { append config " if {[container_initialized]} { append config "
<ui_config version=\"step_2_unlock\" passphrase=\"[passphrase]\"/>" <ui_config passphrase=\"[passphrase]\"/>"
} else { append config " } else { append config "
<ui_config version=\"step_2_init\" passphrase=\"[passphrase]\" client_fs_size=\"1M\" journaling_buf_size=\"1M\"/>" <ui_config passphrase=\"[passphrase]\" client_fs_size=\"1M\" journaling_buf_size=\"1M\"/>"
} }
append config { append config {
</inline> </inline>
<sleep milliseconds="50000"/> <sleep milliseconds="50000"/>
<inline> <inline> <ui_config/> </inline>
<ui_config version="step_3_lock"/>
</inline>
<sleep milliseconds="3600000"/> <sleep milliseconds="3600000"/>
</rom> </rom>
<rom name="dynamic_init_config"> <rom name="dynamic_init_config">
@ -437,7 +428,7 @@ lappend_if [have_board linux] boot_modules [file tail [lx_fs_dir]]
build_boot_image $boot_modules build_boot_image $boot_modules
append qemu_args " -display none " append qemu_args " -display none "
run_genode_until "<ui_report version=\"step_3_lock\" state=\"locked\".*\n" 100 run_genode_until "child \"bash\" exited with exit value 0.*\n" 100
grep_output {\[init -> dynamic_init -> log_terminal\].*} grep_output {\[init -> dynamic_init -> log_terminal\].*}

View File

@ -44,8 +44,6 @@ namespace File_vault {
fn(); }); fn(); });
} }
using Version_string = String<80>;
inline size_t min_journal_buf(Number_of_bytes capacity) inline size_t min_journal_buf(Number_of_bytes capacity)
{ {
size_t result { (size_t)capacity >> 8 }; size_t result { (size_t)capacity >> 8 };
@ -122,7 +120,6 @@ namespace File_vault {
}; };
State state { INVALID }; State state { INVALID };
Version_string version { };
Number_of_bytes image_size { }; Number_of_bytes image_size { };
Number_of_bytes capacity { }; Number_of_bytes capacity { };
Number_of_clients num_clients { }; Number_of_clients num_clients { };
@ -134,7 +131,6 @@ namespace File_vault {
Ui_report(Xml_node const &node) Ui_report(Xml_node const &node)
: :
state(string_to_state(node.attribute_value("state", State_string()))), state(string_to_state(node.attribute_value("state", State_string()))),
version(node.attribute_value("version", Version_string())),
image_size(node.attribute_value("image_size", Number_of_bytes())), image_size(node.attribute_value("image_size", Number_of_bytes())),
capacity(node.attribute_value("capacity", Number_of_bytes())), capacity(node.attribute_value("capacity", Number_of_bytes())),
num_clients(node.attribute_value("num_clients", 0ULL)) num_clients(node.attribute_value("num_clients", 0ULL))
@ -146,7 +142,6 @@ namespace File_vault {
void generate(Xml_generator &xml) void generate(Xml_generator &xml)
{ {
xml.attribute("state", state_to_string(state)); xml.attribute("state", state_to_string(state));
xml.attribute("version", version);
xml.attribute("image_size", image_size); xml.attribute("image_size", image_size);
xml.attribute("capacity", capacity); xml.attribute("capacity", capacity);
xml.attribute("num_clients", num_clients.value); xml.attribute("num_clients", num_clients.value);
@ -212,7 +207,6 @@ namespace File_vault {
void generate(Xml_generator &xml) { xml.attribute("id", id.value); } void generate(Xml_generator &xml) { xml.attribute("id", id.value); }
}; };
Version_string version { };
Passphrase passphrase { }; Passphrase passphrase { };
Number_of_bytes client_fs_size { }; Number_of_bytes client_fs_size { };
Number_of_bytes journaling_buf_size { }; Number_of_bytes journaling_buf_size { };
@ -221,7 +215,6 @@ namespace File_vault {
Ui_config(Xml_node const &node) Ui_config(Xml_node const &node)
: :
version(node.attribute_value("version", Version_string())),
passphrase(node.attribute_value("passphrase", Passphrase())), passphrase(node.attribute_value("passphrase", Passphrase())),
client_fs_size(node.attribute_value("client_fs_size", Number_of_bytes())), client_fs_size(node.attribute_value("client_fs_size", Number_of_bytes())),
journaling_buf_size(node.attribute_value("journaling_buf_size", Number_of_bytes())) journaling_buf_size(node.attribute_value("journaling_buf_size", Number_of_bytes()))