test-init: add test to check for affinity warning

Issue #1412
This commit is contained in:
Alexander Boettcher 2020-01-16 09:15:44 +01:00 committed by Christian Helmuth
parent 5be3bf4f26
commit c5c5f8754c
2 changed files with 29 additions and 0 deletions

View File

@ -1521,6 +1521,26 @@
<expect_log string="[init -> server] [dummy] started version 2"/>
<sleep ms="150"/>
<message string="test invalid affinity configuration warning"/>
<init_config version="affinity">
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="PD"/>
<service name="LOG"/>
</parent-provides>
<default caps="100"/>
<start name="affinity">
<affinity xpos="0"/>
<binary name="dummy"/>
<resource name="RAM" quantum="2M"/>
<config/>
<route> <any-service> <parent/> </any-service> </route>
</start>
</init_config>
<expect_warning string="[init] " colored="Warning: affinity-space configuration missing, but affinity defined for child: affinity"/>
<sleep ms="150"/>
<message string="test complete"/>

View File

@ -250,6 +250,15 @@ struct Test::Main : Log_message_handler
_expect_log = true;
return;
}
if (step.type() == "expect_warning") {
_expect_log_msg = _curr_step_xml().attribute_value("string", Log_message_handler::Message());
Log_message_handler::Message colored (_curr_step_xml().attribute_value("colored", Log_message_handler::Message()));
_expect_log_msg = Log_message_handler::Message(_expect_log_msg,
"\033[34m",
colored);
_expect_log = true;
return;
}
if (step.type() == "expect_init_state") {
if (xml_matches(step, _init_state.xml())) {