| Index: tools/telemetry/telemetry/core/platform/posix_platform_backend_unittest.py
|
| diff --git a/tools/telemetry/telemetry/core/platform/posix_platform_backend_unittest.py b/tools/telemetry/telemetry/core/platform/posix_platform_backend_unittest.py
|
| index 4c83697da1453af97dc2df364610b2a6c4a19a58..eed5c0cd27e387f45fe66effa75d190036165332 100644
|
| --- a/tools/telemetry/telemetry/core/platform/posix_platform_backend_unittest.py
|
| +++ b/tools/telemetry/telemetry/core/platform/posix_platform_backend_unittest.py
|
| @@ -51,6 +51,31 @@ class PosixPlatformBackendTest(unittest.TestCase):
|
| result = backend.GetChildPids(1)
|
| self.assertEquals(set(result), set([2, 3]))
|
|
|
| + def testSudoersFileParsing(self):
|
| + binary_path = '/usr/bin/pkill'
|
| + self.assertFalse(
|
| + posix_platform_backend._BinaryExistsInSudoersFiles(binary_path, ''))
|
| + self.assertFalse(
|
| + posix_platform_backend._BinaryExistsInSudoersFiles(
|
| + binary_path,' (ALL) ALL'))
|
| + self.assertFalse(
|
| + posix_platform_backend._BinaryExistsInSudoersFiles(
|
| + binary_path,' (root) NOPASSWD: /usr/bin/pkill_DUMMY'))
|
| + self.assertFalse(
|
| + posix_platform_backend._BinaryExistsInSudoersFiles(
|
| + binary_path,' (root) NOPASSWD: pkill'))
|
| +
|
| +
|
| + self.assertTrue(
|
| + posix_platform_backend._BinaryExistsInSudoersFiles(
|
| + binary_path,'(root) NOPASSWD: /usr/bin/pkill'))
|
| + self.assertTrue(
|
| + posix_platform_backend._BinaryExistsInSudoersFiles(
|
| + binary_path,' (root) NOPASSWD: /usr/bin/pkill'))
|
| + self.assertTrue(
|
| + posix_platform_backend._BinaryExistsInSudoersFiles(
|
| + binary_path,' (root) NOPASSWD: /usr/bin/pkill arg1 arg2'))
|
| +
|
| @benchmark.Enabled('linux', 'mac')
|
| def testIsApplicationRunning(self):
|
| platform = platform_module.GetHostPlatform()
|
|
|