diff --git a/epsilon/scripts/benchmark.py b/epsilon/scripts/benchmark.py index 708a369..ae5f4aa 100644 --- a/epsilon/scripts/benchmark.py +++ b/epsilon/scripts/benchmark.py @@ -423,7 +423,7 @@ def discoverCurrentWorkingDevice(): """ possibilities = [] cwd = os.getcwd() - for L in file('/etc/mtab'): + for L in file('/proc/self/mounts'): parts = L.split() if cwd.startswith(parts[1]): possibilities.append((len(parts[1]), parts[0])) diff --git a/epsilon/test/test_benchmark.py b/epsilon/test/test_benchmark.py index 6b41b79..c938822 100644 --- a/epsilon/test/test_benchmark.py +++ b/epsilon/test/test_benchmark.py @@ -16,16 +16,17 @@ try: filepath.FilePath('/proc/diskstats').open().close() + filepath.FilePath('/proc/self/mounts').open().close() except IOError: - hasDiskstats = False + hasProc = False else: - hasDiskstats = True + hasProc = True class DiskstatTestCase(unittest.TestCase): - if not hasDiskstats: - skip = 'epsilon.benchmark requires access to /proc/diskstats' + if not hasProc: + skip = 'epsilon.benchmark requires access to /proc' def testDiskLineParser(self): @@ -406,8 +407,8 @@ def cbKilled(exc): class SnapshotTestCase(unittest.TestCase): - if not hasDiskstats: - skip = 'epsilon.benchmark requires access to /proc/diskstats' + if not hasProc: + skip = 'epsilon.benchmark requires access to /proc' def testStart(self): @@ -424,8 +425,8 @@ def testStop(self): class BenchmarkProcessTestCase(SpawnMixin, unittest.TestCase): - if not hasDiskstats: - skip = 'epsilon.benchmark requires access to /proc/diskstats' + if not hasProc: + skip = 'epsilon.benchmark requires access to /proc' processProtocol = benchmark.BenchmarkProcess