blob: 936d4c7b952eef8e77f8cbf04c0e39cce73f37df [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.blackout.test;
using zx;
const MAX_DEVICE_PATH uint64 = 100;
/// Protocol to control the target-side component of power failure tests for the filesystems.
@discoverable
closed protocol Controller {
/// Run the setup step for this test. Often, this involves formatting the filesystem of choice
/// onto the block device, and perhaps setting up a base of files to work with.
strict Setup(struct {
device_label string:MAX_DEVICE_PATH;
device_path string:<MAX_DEVICE_PATH, optional>;
seed uint64;
}) -> () error zx.Status;
/// Run the test step for this test. This kicks off the load generation algorithm for this
/// test, which will run indefinitely. It's expected that this load will be interrupted by a
/// power cycle. If the provided duration is non-zero, this protocol will return after
/// approximately that amount of time, but the load will continue to run. If the duration
/// provided is zero, then the test will return when it's done, which for a lot of normal
/// blackout tests might be never.
strict Test(struct {
device_label string:MAX_DEVICE_PATH;
device_path string:<MAX_DEVICE_PATH, optional>;
seed uint64;
duration uint64;
}) -> () error zx.Status;
/// Run the verify step for this test. Most of the time it involves running fsck on the block
/// device and returning the result.
strict Verify(struct {
device_label string:MAX_DEVICE_PATH;
device_path string:<MAX_DEVICE_PATH, optional>;
seed uint64;
}) -> () error zx.Status;
};