T_GLOBAL_META(
T_META_NAMESPACE("xnu.vfs.dmc"),
- T_META_ASROOT(true)
-);
+ T_META_ASROOT(true),
+ T_META_RUN_CONCURRENTLY(true)
+ );
#pragma mark Entitled Tests
#ifndef TEST_UNENTITLED
T_DECL(fsctl_get_uninitialized,
- "Initial fsctl.get should return zeros",
- T_META_ASROOT(false))
+ "Initial fsctl.get should return zeros",
+ T_META_ASROOT(false))
{
int err;
char *mount_path;
}
T_DECL(fsctl_set,
- "fsctl.set should succeed and fsctl.get should verify")
+ "fsctl.set should succeed and fsctl.get should verify")
{
int err;
char *mount_path;
}
T_DECL(fsctl_set_zero,
- "fsctl.set zero values should fall back to original mount settings")
+ "fsctl.set zero values should fall back to original mount settings")
{
char *mount_path;
disk_conditioner_info info = {0};
}
T_DECL(fsctl_set_out_of_bounds,
- "fsctl.set out-of-bounds values should fall back to original mount settings")
+ "fsctl.set out-of-bounds values should fall back to original mount settings")
{
char *mount_path;
disk_conditioner_info info;
}
T_DECL(fsctl_restore_mount_fields,
- "fsctl.set should restore fields on mount_t that it temporarily overrides")
+ "fsctl.set should restore fields on mount_t that it temporarily overrides")
{
int err;
char *mount_path;
}
T_DECL(fsctl_get_nonroot,
- "fsctl.get should not require root",
- T_META_ASROOT(false))
+ "fsctl.get should not require root",
+ T_META_ASROOT(false))
{
int err;
char *mount_path;
}
T_DECL(fsctl_set_nonroot,
- "fsctl.set should require root",
- T_META_ASROOT(false))
+ "fsctl.set should require root",
+ T_META_ASROOT(false))
{
int err;
char *mount_path;
}
T_DECL(fsctl_delays,
- "Validate I/O delays when DMC is enabled")
+ "Validate I/O delays when DMC is enabled",
+ T_META_RUN_CONCURRENTLY(false))
{
char *path;
int fd;
#pragma mark Unentitled Tests
T_DECL(fsctl_get_unentitled,
- "fsctl.get should not require entitlement")
+ "fsctl.get should not require entitlement")
{
int err;
char *mount_path;
}
T_DECL(fsctl_set_unentitled,
- "fsctl.set should require entitlement")
+ "fsctl.set should require entitlement")
{
int err;
char *mount_path;
#pragma mark Helpers
-static char *mktempdir(void) {
+static char *
+mktempdir(void)
+{
char *path = malloc(PATH_MAX);
strcpy(path, "/tmp/dmc.XXXXXXXX");
atexit_b(^{ free(path); });
* Faster than creating a ram disk to test with
* when access to the filesystem is not necessary
*/
-static char *mktempmount(void) {
+static char *
+mktempmount(void)
+{
char *mount_path = mktempdir();
T_WITH_ERRNO;
* Wrapper around dt_launch_tool/dt_waitpid
* that works like libc:system()
*/
-static int system_legal(const char *command) {
+static int
+system_legal(const char *command)
+{
pid_t pid = -1;
int exit_status = 0;
const char *argv[] = {
* that contains a usable HFS+ filesystem
* mounted via a ram disk
*/
-static char *mkramdisk(void) {
+static char *
+mkramdisk(void)
+{
char cmd[1024];
char *mount_path = mktempdir();
char *dev_disk_file = malloc(256);
return mount_path;
}
-static uint64_t time_for_read(int fd, const char *expected) {
+static uint64_t
+time_for_read(int fd, const char *expected)
+{
int err;
ssize_t ret;
char buf[READSIZE];
err = memcmp(buf, expected, sizeof(buf));
T_ASSERT_EQ_INT(0, err, "read expected contents from temporary file");
- return (stop - start);
+ return stop - start;
}
-static void perf_setup(char **path, int *fd) {
+static void
+perf_setup(char **path, int *fd)
+{
int temp_fd;
char *temp_path;