2017-04-06 00:58:31 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "devices.h"
|
|
|
|
|
|
|
|
#include <android-base/scopeguard.h>
|
2017-06-21 21:46:41 +02:00
|
|
|
#include <android-base/test_utils.h>
|
2017-04-06 00:58:31 +02:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
2017-06-21 21:46:41 +02:00
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
using namespace std::string_literals;
|
|
|
|
|
2017-06-22 21:53:17 +02:00
|
|
|
namespace android {
|
|
|
|
namespace init {
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
class DeviceHandlerTester {
|
|
|
|
public:
|
2017-06-21 21:46:41 +02:00
|
|
|
void TestGetSymlinks(const std::string& platform_device, const Uevent& uevent,
|
2017-06-23 21:43:48 +02:00
|
|
|
const std::vector<std::string> expected_links) {
|
2017-06-21 21:46:41 +02:00
|
|
|
TemporaryDir fake_sys_root;
|
|
|
|
device_handler_.sysfs_mount_point_ = fake_sys_root.path;
|
2017-04-05 02:53:45 +02:00
|
|
|
|
2017-06-21 21:46:41 +02:00
|
|
|
std::string platform_device_dir = fake_sys_root.path + platform_device;
|
2017-08-10 21:22:44 +02:00
|
|
|
mkdir_recursive(platform_device_dir, 0777);
|
2017-06-17 01:48:47 +02:00
|
|
|
|
2017-06-21 21:46:41 +02:00
|
|
|
std::string platform_bus = fake_sys_root.path + "/bus/platform"s;
|
2017-08-10 21:22:44 +02:00
|
|
|
mkdir_recursive(platform_bus, 0777);
|
2017-06-21 21:46:41 +02:00
|
|
|
symlink(platform_bus.c_str(), (platform_device_dir + "/subsystem").c_str());
|
|
|
|
|
2017-08-10 21:22:44 +02:00
|
|
|
mkdir_recursive(android::base::Dirname(fake_sys_root.path + uevent.path), 0777);
|
2017-05-26 00:58:59 +02:00
|
|
|
|
|
|
|
std::vector<std::string> result;
|
2017-06-23 21:43:48 +02:00
|
|
|
result = device_handler_.GetBlockDeviceSymlinks(uevent);
|
2017-05-26 00:58:59 +02:00
|
|
|
|
|
|
|
auto expected_size = expected_links.size();
|
|
|
|
ASSERT_EQ(expected_size, result.size());
|
|
|
|
if (expected_size == 0) return;
|
|
|
|
|
|
|
|
// Explicitly iterate so the results are visible if a failure occurs
|
|
|
|
for (unsigned int i = 0; i < expected_size; ++i) {
|
|
|
|
EXPECT_EQ(expected_links[i], result[i]);
|
|
|
|
}
|
2017-04-06 00:58:31 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
private:
|
|
|
|
DeviceHandler device_handler_;
|
|
|
|
};
|
|
|
|
|
|
|
|
TEST(device_handler, get_block_device_symlinks_success_platform) {
|
2017-04-06 00:58:31 +02:00
|
|
|
// These are actual paths from bullhead
|
|
|
|
const char* platform_device = "/devices/soc.0/f9824900.sdhci";
|
2017-05-26 00:58:59 +02:00
|
|
|
Uevent uevent = {
|
2017-04-06 00:58:31 +02:00
|
|
|
.path = "/devices/soc.0/f9824900.sdhci/mmc_host/mmc0/mmc0:0001/block/mmcblk0",
|
2017-04-11 22:53:37 +02:00
|
|
|
.partition_name = "",
|
2017-04-06 00:58:31 +02:00
|
|
|
.partition_num = -1,
|
|
|
|
};
|
|
|
|
std::vector<std::string> expected_result{"/dev/block/platform/soc.0/f9824900.sdhci/mmcblk0"};
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
DeviceHandlerTester device_handler_tester_;
|
2017-06-23 21:43:48 +02:00
|
|
|
device_handler_tester_.TestGetSymlinks(platform_device, uevent, expected_result);
|
2017-04-06 00:58:31 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, get_block_device_symlinks_success_platform_with_partition) {
|
2017-04-06 00:58:31 +02:00
|
|
|
// These are actual paths from bullhead
|
|
|
|
const char* platform_device = "/devices/soc.0/f9824900.sdhci";
|
2017-05-26 00:58:59 +02:00
|
|
|
Uevent uevent = {
|
2017-04-06 00:58:31 +02:00
|
|
|
.path = "/devices/soc.0/f9824900.sdhci/mmc_host/mmc0/mmc0:0001/block/mmcblk0p1",
|
|
|
|
.partition_name = "modem",
|
|
|
|
.partition_num = 1,
|
|
|
|
};
|
|
|
|
std::vector<std::string> expected_result{
|
|
|
|
"/dev/block/platform/soc.0/f9824900.sdhci/by-name/modem",
|
|
|
|
"/dev/block/platform/soc.0/f9824900.sdhci/by-num/p1",
|
|
|
|
"/dev/block/platform/soc.0/f9824900.sdhci/mmcblk0p1",
|
|
|
|
};
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
DeviceHandlerTester device_handler_tester_;
|
2017-06-23 21:43:48 +02:00
|
|
|
device_handler_tester_.TestGetSymlinks(platform_device, uevent, expected_result);
|
2017-04-06 00:58:31 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, get_block_device_symlinks_success_platform_with_partition_only_num) {
|
2017-04-06 00:58:31 +02:00
|
|
|
const char* platform_device = "/devices/soc.0/f9824900.sdhci";
|
2017-05-26 00:58:59 +02:00
|
|
|
Uevent uevent = {
|
2017-04-06 00:58:31 +02:00
|
|
|
.path = "/devices/soc.0/f9824900.sdhci/mmc_host/mmc0/mmc0:0001/block/mmcblk0p1",
|
2017-04-11 22:53:37 +02:00
|
|
|
.partition_name = "",
|
2017-04-06 00:58:31 +02:00
|
|
|
.partition_num = 1,
|
|
|
|
};
|
|
|
|
std::vector<std::string> expected_result{
|
|
|
|
"/dev/block/platform/soc.0/f9824900.sdhci/by-num/p1",
|
|
|
|
"/dev/block/platform/soc.0/f9824900.sdhci/mmcblk0p1",
|
|
|
|
};
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
DeviceHandlerTester device_handler_tester_;
|
2017-06-23 21:43:48 +02:00
|
|
|
device_handler_tester_.TestGetSymlinks(platform_device, uevent, expected_result);
|
2017-04-06 00:58:31 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, get_block_device_symlinks_success_platform_with_partition_only_name) {
|
2017-04-06 00:58:31 +02:00
|
|
|
const char* platform_device = "/devices/soc.0/f9824900.sdhci";
|
2017-05-26 00:58:59 +02:00
|
|
|
Uevent uevent = {
|
2017-04-06 00:58:31 +02:00
|
|
|
.path = "/devices/soc.0/f9824900.sdhci/mmc_host/mmc0/mmc0:0001/block/mmcblk0p1",
|
|
|
|
.partition_name = "modem",
|
|
|
|
.partition_num = -1,
|
|
|
|
};
|
|
|
|
std::vector<std::string> expected_result{
|
|
|
|
"/dev/block/platform/soc.0/f9824900.sdhci/by-name/modem",
|
|
|
|
"/dev/block/platform/soc.0/f9824900.sdhci/mmcblk0p1",
|
|
|
|
};
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
DeviceHandlerTester device_handler_tester_;
|
2017-06-23 21:43:48 +02:00
|
|
|
device_handler_tester_.TestGetSymlinks(platform_device, uevent, expected_result);
|
2017-04-06 00:58:31 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, get_block_device_symlinks_success_pci) {
|
2017-04-06 00:58:31 +02:00
|
|
|
const char* platform_device = "/devices/do/not/match";
|
2017-05-26 00:58:59 +02:00
|
|
|
Uevent uevent = {
|
2017-04-11 22:53:37 +02:00
|
|
|
.path = "/devices/pci0000:00/0000:00:1f.2/mmcblk0", .partition_name = "", .partition_num = -1,
|
2017-04-06 00:58:31 +02:00
|
|
|
};
|
|
|
|
std::vector<std::string> expected_result{"/dev/block/pci/pci0000:00/0000:00:1f.2/mmcblk0"};
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
DeviceHandlerTester device_handler_tester_;
|
2017-06-23 21:43:48 +02:00
|
|
|
device_handler_tester_.TestGetSymlinks(platform_device, uevent, expected_result);
|
2017-04-06 00:58:31 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, get_block_device_symlinks_pci_bad_format) {
|
2017-04-05 02:53:45 +02:00
|
|
|
const char* platform_device = "/devices/do/not/match";
|
2017-05-26 00:58:59 +02:00
|
|
|
Uevent uevent = {
|
2017-04-11 22:53:37 +02:00
|
|
|
.path = "/devices/pci//mmcblk0", .partition_name = "", .partition_num = -1,
|
2017-04-05 02:53:45 +02:00
|
|
|
};
|
|
|
|
std::vector<std::string> expected_result{};
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
DeviceHandlerTester device_handler_tester_;
|
2017-06-23 21:43:48 +02:00
|
|
|
device_handler_tester_.TestGetSymlinks(platform_device, uevent, expected_result);
|
2017-04-05 02:53:45 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, get_block_device_symlinks_success_vbd) {
|
2017-04-06 00:58:31 +02:00
|
|
|
const char* platform_device = "/devices/do/not/match";
|
2017-05-26 00:58:59 +02:00
|
|
|
Uevent uevent = {
|
2017-04-11 22:53:37 +02:00
|
|
|
.path = "/devices/vbd-1234/mmcblk0", .partition_name = "", .partition_num = -1,
|
2017-04-06 00:58:31 +02:00
|
|
|
};
|
|
|
|
std::vector<std::string> expected_result{"/dev/block/vbd/1234/mmcblk0"};
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
DeviceHandlerTester device_handler_tester_;
|
2017-06-23 21:43:48 +02:00
|
|
|
device_handler_tester_.TestGetSymlinks(platform_device, uevent, expected_result);
|
2017-04-06 00:58:31 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, get_block_device_symlinks_vbd_bad_format) {
|
2017-04-05 02:53:45 +02:00
|
|
|
const char* platform_device = "/devices/do/not/match";
|
2017-05-26 00:58:59 +02:00
|
|
|
Uevent uevent = {
|
2017-04-11 22:53:37 +02:00
|
|
|
.path = "/devices/vbd-/mmcblk0", .partition_name = "", .partition_num = -1,
|
2017-04-05 02:53:45 +02:00
|
|
|
};
|
|
|
|
std::vector<std::string> expected_result{};
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
DeviceHandlerTester device_handler_tester_;
|
2017-06-23 21:43:48 +02:00
|
|
|
device_handler_tester_.TestGetSymlinks(platform_device, uevent, expected_result);
|
2017-04-05 02:53:45 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, get_block_device_symlinks_no_matches) {
|
2017-04-06 00:58:31 +02:00
|
|
|
const char* platform_device = "/devices/soc.0/f9824900.sdhci";
|
2017-05-26 00:58:59 +02:00
|
|
|
Uevent uevent = {
|
2017-04-06 00:58:31 +02:00
|
|
|
.path = "/devices/soc.0/not_the_device/mmc_host/mmc0/mmc0:0001/block/mmcblk0p1",
|
2017-04-11 22:53:37 +02:00
|
|
|
.partition_name = "",
|
2017-04-06 00:58:31 +02:00
|
|
|
.partition_num = -1,
|
|
|
|
};
|
|
|
|
std::vector<std::string> expected_result;
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
DeviceHandlerTester device_handler_tester_;
|
2017-06-23 21:43:48 +02:00
|
|
|
device_handler_tester_.TestGetSymlinks(platform_device, uevent, expected_result);
|
2017-04-06 00:58:31 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, sanitize_null) {
|
|
|
|
SanitizePartitionName(nullptr);
|
2017-04-06 00:58:31 +02:00
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, sanitize_empty) {
|
2017-04-06 00:58:31 +02:00
|
|
|
std::string empty;
|
2017-05-26 00:58:59 +02:00
|
|
|
SanitizePartitionName(&empty);
|
2017-04-06 00:58:31 +02:00
|
|
|
EXPECT_EQ(0u, empty.size());
|
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, sanitize_allgood) {
|
2017-04-06 00:58:31 +02:00
|
|
|
std::string good =
|
|
|
|
"abcdefghijklmnopqrstuvwxyz"
|
|
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
|
|
"0123456789"
|
|
|
|
"_-.";
|
|
|
|
std::string good_copy = good;
|
2017-05-26 00:58:59 +02:00
|
|
|
SanitizePartitionName(&good);
|
2017-04-06 00:58:31 +02:00
|
|
|
EXPECT_EQ(good_copy, good);
|
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, sanitize_somebad) {
|
2017-04-06 00:58:31 +02:00
|
|
|
std::string string = "abc!@#$%^&*()";
|
2017-05-26 00:58:59 +02:00
|
|
|
SanitizePartitionName(&string);
|
2017-04-06 00:58:31 +02:00
|
|
|
EXPECT_EQ("abc__________", string);
|
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, sanitize_allbad) {
|
2017-04-06 00:58:31 +02:00
|
|
|
std::string string = "!@#$%^&*()";
|
2017-05-26 00:58:59 +02:00
|
|
|
SanitizePartitionName(&string);
|
2017-04-06 00:58:31 +02:00
|
|
|
EXPECT_EQ("__________", string);
|
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, sanitize_onebad) {
|
2017-04-06 00:58:31 +02:00
|
|
|
std::string string = ")";
|
2017-05-26 00:58:59 +02:00
|
|
|
SanitizePartitionName(&string);
|
2017-04-06 00:58:31 +02:00
|
|
|
EXPECT_EQ("_", string);
|
|
|
|
}
|
2017-04-06 02:55:46 +02:00
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, DevPermissionsMatchNormal) {
|
2017-04-06 02:55:46 +02:00
|
|
|
// Basic from ueventd.rc
|
|
|
|
// /dev/null 0666 root root
|
|
|
|
Permissions permissions("/dev/null", 0666, 0, 0);
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/null"));
|
|
|
|
EXPECT_FALSE(permissions.Match("/dev/nullsuffix"));
|
|
|
|
EXPECT_FALSE(permissions.Match("/dev/nul"));
|
|
|
|
EXPECT_EQ(0666U, permissions.perm());
|
|
|
|
EXPECT_EQ(0U, permissions.uid());
|
|
|
|
EXPECT_EQ(0U, permissions.gid());
|
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, DevPermissionsMatchPrefix) {
|
2017-04-06 02:55:46 +02:00
|
|
|
// Prefix from ueventd.rc
|
|
|
|
// /dev/dri/* 0666 root graphics
|
|
|
|
Permissions permissions("/dev/dri/*", 0666, 0, 1000);
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/dri/some_dri_device"));
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/dri/some_other_dri_device"));
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/dri/"));
|
|
|
|
EXPECT_FALSE(permissions.Match("/dev/dr/non_match"));
|
|
|
|
EXPECT_EQ(0666U, permissions.perm());
|
|
|
|
EXPECT_EQ(0U, permissions.uid());
|
|
|
|
EXPECT_EQ(1000U, permissions.gid());
|
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, DevPermissionsMatchWildcard) {
|
2017-04-06 02:55:46 +02:00
|
|
|
// Wildcard example
|
|
|
|
// /dev/device*name 0666 root graphics
|
|
|
|
Permissions permissions("/dev/device*name", 0666, 0, 1000);
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/devicename"));
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/device123name"));
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/deviceabcname"));
|
|
|
|
EXPECT_FALSE(permissions.Match("/dev/device123name/subdevice"));
|
|
|
|
EXPECT_FALSE(permissions.Match("/dev/deviceame"));
|
|
|
|
EXPECT_EQ(0666U, permissions.perm());
|
|
|
|
EXPECT_EQ(0U, permissions.uid());
|
|
|
|
EXPECT_EQ(1000U, permissions.gid());
|
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, DevPermissionsMatchWildcardPrefix) {
|
2017-04-06 02:55:46 +02:00
|
|
|
// Wildcard+Prefix example
|
|
|
|
// /dev/device*name* 0666 root graphics
|
|
|
|
Permissions permissions("/dev/device*name*", 0666, 0, 1000);
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/devicename"));
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/device123name"));
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/deviceabcname"));
|
|
|
|
EXPECT_TRUE(permissions.Match("/dev/device123namesomething"));
|
|
|
|
// FNM_PATHNAME doesn't match '/' with *
|
|
|
|
EXPECT_FALSE(permissions.Match("/dev/device123name/something"));
|
|
|
|
EXPECT_FALSE(permissions.Match("/dev/deviceame"));
|
|
|
|
EXPECT_EQ(0666U, permissions.perm());
|
|
|
|
EXPECT_EQ(0U, permissions.uid());
|
|
|
|
EXPECT_EQ(1000U, permissions.gid());
|
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, SysfsPermissionsMatchWithSubsystemNormal) {
|
2017-04-06 02:55:46 +02:00
|
|
|
// /sys/devices/virtual/input/input* enable 0660 root input
|
|
|
|
SysfsPermissions permissions("/sys/devices/virtual/input/input*", "enable", 0660, 0, 1001);
|
|
|
|
EXPECT_TRUE(permissions.MatchWithSubsystem("/sys/devices/virtual/input/input0", "input"));
|
|
|
|
EXPECT_FALSE(permissions.MatchWithSubsystem("/sys/devices/virtual/input/not_input0", "input"));
|
|
|
|
EXPECT_EQ(0660U, permissions.perm());
|
|
|
|
EXPECT_EQ(0U, permissions.uid());
|
|
|
|
EXPECT_EQ(1001U, permissions.gid());
|
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, SysfsPermissionsMatchWithSubsystemClass) {
|
2017-04-06 02:55:46 +02:00
|
|
|
// /sys/class/input/event* enable 0660 root input
|
|
|
|
SysfsPermissions permissions("/sys/class/input/event*", "enable", 0660, 0, 1001);
|
|
|
|
EXPECT_TRUE(permissions.MatchWithSubsystem(
|
|
|
|
"/sys/devices/soc.0/f9924000.i2c/i2c-2/2-0020/input/input0/event0", "input"));
|
|
|
|
EXPECT_FALSE(permissions.MatchWithSubsystem(
|
|
|
|
"/sys/devices/soc.0/f9924000.i2c/i2c-2/2-0020/input/input0/not_event0", "input"));
|
|
|
|
EXPECT_FALSE(permissions.MatchWithSubsystem(
|
|
|
|
"/sys/devices/soc.0/f9924000.i2c/i2c-2/2-0020/input/input0/event0", "not_input"));
|
|
|
|
EXPECT_EQ(0660U, permissions.perm());
|
|
|
|
EXPECT_EQ(0U, permissions.uid());
|
|
|
|
EXPECT_EQ(1001U, permissions.gid());
|
|
|
|
}
|
|
|
|
|
2017-05-26 00:58:59 +02:00
|
|
|
TEST(device_handler, SysfsPermissionsMatchWithSubsystemBus) {
|
2017-04-06 02:55:46 +02:00
|
|
|
// /sys/bus/i2c/devices/i2c-* enable 0660 root input
|
|
|
|
SysfsPermissions permissions("/sys/bus/i2c/devices/i2c-*", "enable", 0660, 0, 1001);
|
|
|
|
EXPECT_TRUE(permissions.MatchWithSubsystem("/sys/devices/soc.0/f9967000.i2c/i2c-5", "i2c"));
|
|
|
|
EXPECT_FALSE(permissions.MatchWithSubsystem("/sys/devices/soc.0/f9967000.i2c/not-i2c", "i2c"));
|
|
|
|
EXPECT_FALSE(
|
|
|
|
permissions.MatchWithSubsystem("/sys/devices/soc.0/f9967000.i2c/i2c-5", "not_i2c"));
|
|
|
|
EXPECT_EQ(0660U, permissions.perm());
|
|
|
|
EXPECT_EQ(0U, permissions.uid());
|
|
|
|
EXPECT_EQ(1001U, permissions.gid());
|
|
|
|
}
|
2017-06-22 21:53:17 +02:00
|
|
|
|
|
|
|
} // namespace init
|
|
|
|
} // namespace android
|