class TestLoopBase
Defined at line 51 of file ../../src/power/testing/system-integration/util/test_util.h
Public Methods
void TestLoopBase ()
Defined at line 229 of file ../../src/power/testing/system-integration/util/test_util.cc
void ~TestLoopBase ()
Defined at line 230 of file ../../src/power/testing/system-integration/util/test_util.cc
zx::event GetCapturedToken (const std::string & element_name)
Get the duplicated DependencyToken captured by the intercepted Topology.AddElement call.
Defined at line 232 of file ../../src/power/testing/system-integration/util/test_util.cc
Protected Methods
void Initialize ()
Defined at line 245 of file ../../src/power/testing/system-integration/util/test_util.cc
test_sagcontrol::SystemActivityGovernorState GetBootCompleteState ()
Defined at line 283 of file ../../src/power/testing/system-integration/util/test_util.cc
bool SetBootComplete ()
Defined at line 302 of file ../../src/power/testing/system-integration/util/test_util.cc
zx_status_t AwaitSystemSuspend ()
Defined at line 290 of file ../../src/power/testing/system-integration/util/test_util.cc
zx_status_t StartSystemResume ()
Defined at line 313 of file ../../src/power/testing/system-integration/util/test_util.cc
zx_status_t ChangeSagState (test_sagcontrol::SystemActivityGovernorState state, zx::duration poll_delay)
Change the SAG state and wait for the transition to complete.
Defined at line 330 of file ../../src/power/testing/system-integration/util/test_util.cc
void MatchInspectData (diagnostics::reader::ArchiveReader &reader,const std::string &moniker,const std::optional<std::string> &inspect_tree_name,const std::vector<std::string> &inspect_path,std::variant<bool, uint64_t>value)
Wait for an inspect selector to match a specific value.
Defined at line 359 of file ../../src/power/testing/system-integration/util/test_util.cc
zx::result<std::string> GetPowerElementId (diagnostics::reader::ArchiveReader &reader,const std::string &pb_moniker,const std::string &power_element_name)
Defined at line 433 of file ../../src/power/testing/system-integration/util/test_util.cc
zx::eventpair PrepareDriver (std::string_viewnode_filter,std::string_viewdriver_url_suffix,boolexpect_new_koid,booluse_df_elements,std::vector<CustomDictionaryEntry>custom_entries,std::vector<std::string>target_child_nodes)
Prepare the target driver for power system testing. This is done by creating a dictionary
with the power protocols from the test-specific instances of the SAG and power broker,
and restarting the target driver and its children with access to this dictionary.
|expect_new_koid| whether to expect the restarted node to have a new driver host koid, this
should be true if the target driver is not colocated with its parent driver, otherwise it
should be false.
Returns a zx::eventpair that should be held onto for the duration of the test. When released
the target driver and children are restarted again and lose access to the test-specific
power protocols.
Defined at line 472 of file ../../src/power/testing/system-integration/util/test_util.cc
zx::eventpair PrepareDriverWithPowerTokenOverrides (std::string_viewnode_filter,std::string_viewdriver_url_suffix,boolexpect_new_koid,const std::vector<std::string> &target_child_nodes,std::vector<CustomDictionaryEntry>custom_entries)
Prepare the target driver and target child nodes with power token overrides for non-intrusive
driver power testing.
Workflow performed by this helper:
1. Discovers the target driver matching |node_filter| and |driver_url_suffix|.
2. Creates power token overrides for each child node listed in |target_child_nodes|.
3. Creates an aggregator power element ("fake-all-drivers") in the test realm's Power Broker
topology with level dependencies on each child node token override.
4. Registers the aggregator element ("fake-all-drivers") dependency token with the
System Activity Governor (SAG) via CpuElementManager.AddExecutionStateDependency.
5. Restarts the target driver subtree with the test dictionary, CPU token override, and child
node token overrides via Driver Manager.
6. Awaits the target driver and child nodes to restart and successfully bind.
Parameters
Returns
A zx::eventpair (release fence) that must be retained for the duration of the test.
When dropped, Driver Manager restarts the driver subtree and restores original
bindings.
Defined at line 731 of file ../../src/power/testing/system-integration/util/test_util.cc
fuchsia_component_sandbox::DictionaryRef CreateDictionaryForTest (std::vector<CustomDictionaryEntry> custom_entries)
Create and export a component framework dictionary that contains connectors for the various
power framework protocols, that are connected to the test-specific SAG and power broker that
is accessible in the incoming namespace of the test component. See 'meta/client.shard.cml'.
Defined at line 739 of file ../../src/power/testing/system-integration/util/test_util.cc
std::vector<fuchsia_driver_development::NodeInfo> GetNodeInfo (std::string_view node_filter)
Query the driver framework for nodes that have a moniker matching the |node_filter|.
Defined at line 814 of file ../../src/power/testing/system-integration/util/test_util.cc