OverlayFsUtils

public class OverlayFsUtils
extends TestWatcher

java.lang.Object
   ↳ org.junit.rules.TestWatcher
     ↳ com.android.sts.common.OverlayFsUtils


TestWatcher that enables writing to read-only partitions and reboots device when done.

Summary

Fields

static final Pattern PERM_PATTERN

Public constructors

OverlayFsUtils(BaseHostJUnit4Test test)

Public methods

boolean anyOverlayFsMounted()
void finished(Description d)
void makeWritable(String dir, int megabytes)

Mounts an OverlayFS dir over the top most common dir in the list.

Fields

PERM_PATTERN

static final Pattern PERM_PATTERN

Public constructors

OverlayFsUtils

public OverlayFsUtils (BaseHostJUnit4Test test)

Parameters
test BaseHostJUnit4Test

Public methods

anyOverlayFsMounted

public boolean anyOverlayFsMounted ()

Returns
boolean

Throws
DeviceNotAvailableException

finished

public void finished (Description d)

Parameters
d Description

makeWritable

public void makeWritable (String dir, 
                int megabytes)

Mounts an OverlayFS dir over the top most common dir in the list.

The directory should be writable after this returns successfully. To cleanup, reboot the device as unfortunately unmounting overlayfs is complicated.

Parameters
dir String: The directory to make writable. Directories with single quotes are not supported.

megabytes int

Throws
DeviceNotAvailableException
IOException
IllegalStateException